Merge branch 'admin-push-notification-supplier' into develop
This commit is contained in:
commit
1f31cbdf76
|
@ -123,6 +123,27 @@ func (s Supplier) GetBankInfoByID(supplierID model.SupplierRequestPayload) (*mod
|
||||||
return r.Data, nil
|
return r.Data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s Supplier) Count(req model.SupplierCountReq) (*model.SupplierCountRes, error) {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Supplier.Count, toBytes(req))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var r struct {
|
||||||
|
Data *model.SupplierCountRes `json:"data"`
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if r.Error != "" {
|
||||||
|
return nil, errors.New(r.Error)
|
||||||
|
}
|
||||||
|
|
||||||
|
return r.Data, nil
|
||||||
|
}
|
||||||
|
|
||||||
// SyncWarehouseIntoServiceSupplier ...
|
// SyncWarehouseIntoServiceSupplier ...
|
||||||
func (s Supplier) SyncWarehouseIntoServiceSupplier(p model.SyncSupplierWarehousePayload) error {
|
func (s Supplier) SyncWarehouseIntoServiceSupplier(p model.SyncSupplierWarehousePayload) error {
|
||||||
msg, err := natsio.GetServer().Request(subject.Warehouse.SyncWarehouseIntoServiceSupplier, toBytes(p))
|
msg, err := natsio.GetServer().Request(subject.Warehouse.SyncWarehouseIntoServiceSupplier, toBytes(p))
|
||||||
|
|
|
@ -55,3 +55,8 @@ type SupplierFindAllReq struct {
|
||||||
Segment string `json:"segment"`
|
Segment string `json:"segment"`
|
||||||
IDs []string `json:"ids"`
|
IDs []string `json:"ids"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SupplierCountReq struct {
|
||||||
|
Segment string `json:"segment"`
|
||||||
|
IDs []string `json:"ids"`
|
||||||
|
}
|
||||||
|
|
|
@ -80,3 +80,7 @@ type SyncSupplierWarehousePayload struct {
|
||||||
DistrictCode int `json:"districtCode"`
|
DistrictCode int `json:"districtCode"`
|
||||||
WardCode int `json:"wardCode"`
|
WardCode int `json:"wardCode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SupplierCountRes struct {
|
||||||
|
Total int64 `json:"total"`
|
||||||
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ var Supplier = struct {
|
||||||
GetCurrentBalance string
|
GetCurrentBalance string
|
||||||
GetFreeShipInfo string
|
GetFreeShipInfo string
|
||||||
FindAllOld string
|
FindAllOld string
|
||||||
|
Count 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"),
|
||||||
|
@ -28,4 +29,5 @@ var Supplier = struct {
|
||||||
GetCurrentBalance: getSupplierValue("get_current_balance"),
|
GetCurrentBalance: getSupplierValue("get_current_balance"),
|
||||||
GetFreeShipInfo: getSupplierValue("get_free_ship_info"),
|
GetFreeShipInfo: getSupplierValue("get_free_ship_info"),
|
||||||
FindAllOld: getSupplierValue("find_all_old"),
|
FindAllOld: getSupplierValue("find_all_old"),
|
||||||
|
Count: getSupplierValue("count"),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue