diff --git a/client/supplier.go b/client/supplier.go index 3dd028c..62592b0 100644 --- a/client/supplier.go +++ b/client/supplier.go @@ -17,15 +17,15 @@ func GetSupplier() Supplier { return Supplier{} } -func (s Supplier) GetSupplierInfo(supplierID model.GetSupplierRequest) (*model.ResponseSupplierInfo, error) { - msg, err := natsio.GetServer().Request(subject.Supplier.GetSupplierInfo, toBytes(supplierID)) +func (s Supplier) GetListSupplierInfo(supplierID model.GetSupplierRequest) ([]*model.ResponseSupplierInfo, error) { + msg, err := natsio.GetServer().Request(subject.Supplier.GetListSupplierInfo, toBytes(supplierID)) if err != nil { return nil, err } var r struct { - Data *model.ResponseSupplierInfo `json:"data"` - Error string `json:"error"` + Data []*model.ResponseSupplierInfo `json:"data"` + Error string `json:"error"` } if err := json.Unmarshal(msg.Data, &r); err != nil { diff --git a/subject/supplier.go b/subject/supplier.go index 573b25e..17ca8d0 100644 --- a/subject/supplier.go +++ b/subject/supplier.go @@ -7,12 +7,10 @@ func getSupplierValue(val string) string { } var Supplier = struct { - GetSupplierInfo string GetListSupplierInfo string GetSupplierContractBySupplierID string FindAll string }{ - GetSupplierInfo: getSupplierValue("get_supplier_info"), GetListSupplierInfo: getSupplierValue("get_list_supplier_info"), GetSupplierContractBySupplierID: getSupplierValue("get_supplier_contract_by_supplier_id"), FindAll: getSupplierValue("find_all"),