Merge branch 'develop' of git.selly.red:Selly-Modules/natsio into develop

This commit is contained in:
Tue 2022-10-31 10:09:31 +07:00
commit 79528f72e4
4 changed files with 13 additions and 13 deletions

View File

@ -117,15 +117,15 @@ func (s Supplier) UpdateWarehouseIntoServiceSupplier(p model.UpdateSupplierWareh
return nil return nil
} }
// GetWarehouseFreeship ... // GetListWarehouseFreeShip ...
func (s Supplier) GetWarehouseFreeship() (*model.ResponseListWarehouseIDByBusinessType, error) { func (s Supplier) GetListWarehouseFreeShip() (*model.SupplierListWarehouseFreeShipResponse, error) {
msg, err := natsio.GetServer().Request(subject.Supplier.GetListWarehouseFreeship, toBytes(bson.M{})) msg, err := natsio.GetServer().Request(subject.Supplier.GetListWarehouseFreeShip, toBytes(bson.M{}))
if err != nil { if err != nil {
return nil, err return nil, err
} }
var r struct { var r struct {
Data *model.ResponseListWarehouseIDByBusinessType `json:"data"` Data *model.SupplierListWarehouseFreeShipResponse `json:"data"`
Error string `json:"error"` Error string `json:"error"`
} }
@ -140,7 +140,7 @@ func (s Supplier) GetWarehouseFreeship() (*model.ResponseListWarehouseIDByBusine
} }
// GetFreeShipInfo ... // 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)) msg, err := natsio.GetServer().Request(subject.Supplier.GetFreeShipInfo, toBytes(p))
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -50,5 +50,5 @@ type SupplierCashflowCreatePayload struct {
} }
type SupplierFreeShipInfoRequestPayload struct { type SupplierFreeShipInfoRequestPayload struct {
SupplierID string `json:"supplierId"` SupplierIDs []string `json:"supplierIds"`
} }

View File

@ -30,7 +30,7 @@ type SupplierAll struct {
Total int64 `json:"total"` Total int64 `json:"total"`
} }
type ResponseListWarehouseIDByBusinessType struct { type SupplierListWarehouseFreeShipResponse struct {
Warehouses []string `json:"warehouses"` Warehouses []string `json:"warehouses"`
} }
@ -41,7 +41,7 @@ type SupplierCashflowCreateResponse struct {
type FreeShip struct { type FreeShip struct {
ID string `json:"_id"` ID string `json:"_id"`
ShortName string `json:"shortName"` ShortName string `json:"shortName"`
MilestoneText []string `json:"milestoneText"` ListMilestoneText []string `json:"milestoneText"`
Order int `json:"-"` Order int `json:"-"`
} }

View File

@ -10,14 +10,14 @@ var Supplier = struct {
GetListSupplierInfo string GetListSupplierInfo string
GetSupplierContractBySupplierID string GetSupplierContractBySupplierID string
FindAll string FindAll string
GetListWarehouseFreeship string GetListWarehouseFreeShip string
CreateCashflow string CreateCashflow string
GetFreeShipInfo string GetFreeShipInfo string
}{ }{
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"),
GetListWarehouseFreeship: getSupplierValue("get_list_warehouse_freeship"), GetListWarehouseFreeShip: getSupplierValue("get_list_warehouse_free_ship"),
CreateCashflow: getSupplierValue("create_cashflow"), CreateCashflow: getSupplierValue("create_cashflow"),
GetFreeShipInfo: getSupplierValue("get_free_ship_info"), GetFreeShipInfo: getSupplierValue("get_free_ship_info"),
} }