Intergrate model for supplier #15
|
@ -17,14 +17,14 @@ func GetSupplier() Supplier {
|
||||||
return Supplier{}
|
return Supplier{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s Supplier) GetSupplierInfo(supplierID model.GetSupplierRequest) (*model.ResponseSupplierInfo, error) {
|
func (s Supplier) GetListSupplierInfo(supplierID model.GetSupplierRequest) ([]*model.ResponseSupplierInfo, error) {
|
||||||
msg, err := natsio.GetServer().Request(subject.Supplier.GetSupplierInfo, toBytes(supplierID))
|
msg, err := natsio.GetServer().Request(subject.Supplier.GetListSupplierInfo, toBytes(supplierID))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var r struct {
|
var r struct {
|
||||||
Data *model.ResponseSupplierInfo `json:"data"`
|
Data []*model.ResponseSupplierInfo `json:"data"`
|
||||||
Error string `json:"error"`
|
Error string `json:"error"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,10 @@ func getSupplierValue(val string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
var Supplier = struct {
|
var Supplier = struct {
|
||||||
GetSupplierInfo string
|
|
||||||
GetListSupplierInfo string
|
GetListSupplierInfo string
|
||||||
GetSupplierContractBySupplierID string
|
GetSupplierContractBySupplierID string
|
||||||
FindAll string
|
FindAll string
|
||||||
}{
|
}{
|
||||||
GetSupplierInfo: getSupplierValue("get_supplier_info"),
|
|
||||||
GetListSupplierInfo: getSupplierValue("get_list_supplier_info"),
|
GetListSupplierInfo: getSupplierValue("get_list_supplier_info"),
|
||||||
GetSupplierContractBySupplierID: getSupplierValue("get_supplier_contract_by_supplier_id"),
|
GetSupplierContractBySupplierID: getSupplierValue("get_supplier_contract_by_supplier_id"),
|
||||||
FindAll: getSupplierValue("find_all"),
|
FindAll: getSupplierValue("find_all"),
|
||||||
|
|
Loading…
Reference in New Issue