diff --git a/client/supplier.go b/client/supplier.go index 38619c1..1488a1b 100644 --- a/client/supplier.go +++ b/client/supplier.go @@ -117,15 +117,15 @@ func (s Supplier) UpdateWarehouseIntoServiceSupplier(p model.UpdateSupplierWareh return nil } -// GetWarehouseFreeship ... -func (s Supplier) GetWarehouseFreeship() (*model.ResponseListWarehouseIDByBusinessType, error) { - msg, err := natsio.GetServer().Request(subject.Supplier.GetListWarehouseFreeship, toBytes(bson.M{})) +// GetListWarehouseFreeShip ... +func (s Supplier) GetListWarehouseFreeShip() (*model.SupplierListWarehouseFreeShipResponse, error) { + msg, err := natsio.GetServer().Request(subject.Supplier.GetListWarehouseFreeShip, toBytes(bson.M{})) if err != nil { return nil, err } var r struct { - Data *model.ResponseListWarehouseIDByBusinessType `json:"data"` + Data *model.SupplierListWarehouseFreeShipResponse `json:"data"` Error string `json:"error"` } @@ -140,7 +140,7 @@ func (s Supplier) GetWarehouseFreeship() (*model.ResponseListWarehouseIDByBusine } // GetFreeShipInfo ... -func (s Supplier) GetFreeShipInfo(p []model.SupplierFreeShipInfoRequestPayload) ([]*model.SupplierFreeShipInfoResponse, error) { +func (s Supplier) GetFreeShipInfo(p model.SupplierFreeShipInfoRequestPayload) ([]*model.SupplierFreeShipInfoResponse, error) { msg, err := natsio.GetServer().Request(subject.Supplier.GetFreeShipInfo, toBytes(p)) if err != nil { return nil, err diff --git a/model/supplier_request.go b/model/supplier_request.go index c461656..d01c551 100644 --- a/model/supplier_request.go +++ b/model/supplier_request.go @@ -50,5 +50,5 @@ type SupplierCashflowCreatePayload struct { } type SupplierFreeShipInfoRequestPayload struct { - SupplierID string `json:"supplierId"` + SupplierID []string `json:"supplierId"` } diff --git a/model/supplier_response.go b/model/supplier_response.go index 48ccb80..7584160 100644 --- a/model/supplier_response.go +++ b/model/supplier_response.go @@ -30,7 +30,7 @@ type SupplierAll struct { Total int64 `json:"total"` } -type ResponseListWarehouseIDByBusinessType struct { +type SupplierListWarehouseFreeShipResponse struct { Warehouses []string `json:"warehouses"` } @@ -39,10 +39,10 @@ type SupplierCashflowCreateResponse struct { } type FreeShip struct { - ID string `json:"_id"` - ShortName string `json:"shortName"` - MilestoneText []string `json:"milestoneText"` - Order int `json:"-"` + ID string `json:"_id"` + ShortName string `json:"shortName"` + ListMilestoneText []string `json:"milestoneText"` + Order int `json:"-"` } type SupplierFreeShipInfoResponse struct { diff --git a/subject/supplier.go b/subject/supplier.go index a581494..12cc3ea 100644 --- a/subject/supplier.go +++ b/subject/supplier.go @@ -10,14 +10,14 @@ var Supplier = struct { GetListSupplierInfo string GetSupplierContractBySupplierID string FindAll string - GetListWarehouseFreeship string + GetListWarehouseFreeShip string CreateCashflow string GetFreeShipInfo string }{ GetListSupplierInfo: getSupplierValue("get_list_supplier_info"), GetSupplierContractBySupplierID: getSupplierValue("get_supplier_contract_by_supplier_id"), FindAll: getSupplierValue("find_all"), - GetListWarehouseFreeship: getSupplierValue("get_list_warehouse_freeship"), + GetListWarehouseFreeShip: getSupplierValue("get_list_warehouse_free_ship"), CreateCashflow: getSupplierValue("create_cashflow"), GetFreeShipInfo: getSupplierValue("get_free_ship_info"), }