get supplier freeship info
This commit is contained in:
parent
d395f8944f
commit
73e2a8a7c8
|
@ -119,7 +119,7 @@ func (s Supplier) UpdateWarehouseIntoServiceSupplier(p model.UpdateSupplierWareh
|
|||
|
||||
// GetWarehouseFreeship ...
|
||||
func (s Supplier) GetWarehouseFreeship() (*model.ResponseListWarehouseIDByBusinessType, error) {
|
||||
msg, err := natsio.GetServer().Request(subject.Selly.GetListWarehouseFreeship, toBytes(bson.M{}))
|
||||
msg, err := natsio.GetServer().Request(subject.Supplier.GetListWarehouseFreeship, toBytes(bson.M{}))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -139,14 +139,14 @@ func (s Supplier) GetWarehouseFreeship() (*model.ResponseListWarehouseIDByBusine
|
|||
return r.Data, nil
|
||||
}
|
||||
|
||||
// GetFreeshipsBySupplierIDs ...
|
||||
func (s Supplier) GetFreeshipsBySupplierIDs(p model.GetFreeshipsBySupplierIds) (*model.ResponseListFreeshipsBySupplierIds, error) {
|
||||
msg, err := natsio.GetServer().Request(subject.Selly.GetFreeshipsBySupplierIds, toBytes(p))
|
||||
// GetFreeShipInfo ...
|
||||
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
|
||||
}
|
||||
var r struct {
|
||||
Data *model.ResponseListFreeshipsBySupplierIds `json:"data"`
|
||||
Data []*model.SupplierFreeShipInfoResponse `json:"data"`
|
||||
Error string `json:"error"`
|
||||
}
|
||||
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||
|
|
|
@ -49,6 +49,6 @@ type SupplierCashflowCreatePayload struct {
|
|||
ClickAction *ClickAction `json:"clickAction"`
|
||||
}
|
||||
|
||||
type GetFreeshipsBySupplierIds struct {
|
||||
SupplierIDs []string `json:"supplierIds"`
|
||||
type SupplierFreeShipInfoRequestPayload struct {
|
||||
SupplierID string `json:"supplierId"`
|
||||
}
|
||||
|
|
|
@ -38,13 +38,14 @@ type SupplierCashflowCreateResponse struct {
|
|||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
type Freeship struct {
|
||||
type FreeShip struct {
|
||||
ID string `json:"_id"`
|
||||
ShortName string `json:"shortName"`
|
||||
MilestoneText []string `json:"milestoneText"`
|
||||
Order int `json:"-"`
|
||||
}
|
||||
|
||||
type ResponseListFreeshipsBySupplierIds struct {
|
||||
type SupplierFreeShipInfoResponse struct {
|
||||
SupplierID string `json:"supplierId"`
|
||||
Freeships []Freeship `json:"freeships"`
|
||||
FreeShip FreeShip `json:"freeShip"`
|
||||
}
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
package subject
|
||||
|
||||
import "fmt"
|
||||
|
||||
func getSellyValue(val string) string {
|
||||
return fmt.Sprintf("%s.%s", prefixes.Selly, val)
|
||||
}
|
||||
|
||||
var Selly = struct {
|
||||
GetFreeshipsBySupplierIds string
|
||||
GetListWarehouseFreeship string
|
||||
}{
|
||||
GetFreeshipsBySupplierIds: getSellyValue("get_freeships_by_supplier_ids"),
|
||||
GetListWarehouseFreeship: getSupplierValue("get_list_warehouse_freeship"),
|
||||
}
|
|
@ -12,10 +12,12 @@ var Supplier = struct {
|
|||
FindAll 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"),
|
||||
CreateCashflow: getSupplierValue("create_cashflow"),
|
||||
GetFreeShipInfo: getSupplierValue("get_free_ship_info"),
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue