Compare commits
No commits in common. "43285a4854cb1cdb9cffd1443731b7d1af07bbe0" and "6e29c480c51b6f550a3616e34362c0de65bc2c76" have entirely different histories.
43285a4854
...
6e29c480c5
|
@ -3,7 +3,6 @@ package client
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"git.selly.red/Selly-Modules/natsio"
|
"git.selly.red/Selly-Modules/natsio"
|
||||||
"git.selly.red/Selly-Modules/natsio/model"
|
"git.selly.red/Selly-Modules/natsio/model"
|
||||||
"git.selly.red/Selly-Modules/natsio/subject"
|
"git.selly.red/Selly-Modules/natsio/subject"
|
||||||
|
@ -84,21 +83,3 @@ func (w Warehouse) FindByCondition(p model.FindWithCondition) ([]*model.Warehous
|
||||||
}
|
}
|
||||||
return r.Data, nil
|
return r.Data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateWarehouseConfig ...
|
|
||||||
func (w Warehouse) UpdateWarehouseConfig(p model.UpdatePayload) error {
|
|
||||||
msg, err := natsio.GetServer().Request(subject.Warehouse.UpdateWarehouseConfig, bsonToBytes(p))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
var r struct {
|
|
||||||
Error string `json:"error"`
|
|
||||||
}
|
|
||||||
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if r.Error != "" {
|
|
||||||
return errors.New(r.Error)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
|
@ -49,9 +49,3 @@ type RequestCondition struct {
|
||||||
Page int64 `json:"page"`
|
Page int64 `json:"page"`
|
||||||
Limit int64 `json:"limit"`
|
Limit int64 `json:"limit"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdatePayload struct {
|
|
||||||
Conditions interface{} `json:"conditions"`
|
|
||||||
Payload interface{} `json:"payload"`
|
|
||||||
Opts []*options.UpdateOptions `json:"opts"`
|
|
||||||
}
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ var Warehouse = struct {
|
||||||
UpdateORDeliveryStatus string
|
UpdateORDeliveryStatus string
|
||||||
UpdateStatusWarehousePendingInactive string
|
UpdateStatusWarehousePendingInactive string
|
||||||
UpdateIsSellyMall string
|
UpdateIsSellyMall string
|
||||||
UpdateWarehouseConfig string
|
|
||||||
}{
|
}{
|
||||||
SyncWarehouseIntoServiceSupplier: getWarehouseValue("sync_warehouse_into_service_supplier"),
|
SyncWarehouseIntoServiceSupplier: getWarehouseValue("sync_warehouse_into_service_supplier"),
|
||||||
CreateWarehouseIntoServiceSupplier: getWarehouseValue("create_warehouse_into_service_supplier"),
|
CreateWarehouseIntoServiceSupplier: getWarehouseValue("create_warehouse_into_service_supplier"),
|
||||||
|
@ -57,5 +56,4 @@ var Warehouse = struct {
|
||||||
UpdateORDeliveryStatus: getWarehouseValue("update_or_delivery_status"),
|
UpdateORDeliveryStatus: getWarehouseValue("update_or_delivery_status"),
|
||||||
UpdateStatusWarehousePendingInactive: getWarehouseValue("update_pending_active_product_by_warehouse_ids"),
|
UpdateStatusWarehousePendingInactive: getWarehouseValue("update_pending_active_product_by_warehouse_ids"),
|
||||||
UpdateIsSellyMall: getWarehouseValue("update_is_selly_mall"),
|
UpdateIsSellyMall: getWarehouseValue("update_is_selly_mall"),
|
||||||
UpdateWarehouseConfig: getWarehouseValue("update_warehouse_config"),
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue