- no platform dependency in sync.go
This commit is contained in:
@@ -32,13 +32,17 @@ type DeliveryHandler struct {
|
||||
|
||||
func init() {
|
||||
curDeliveryHandler = new(DeliveryHandler)
|
||||
scheduler.CurrentScheduler.RegisterDeliveryPlatform(model.VendorIDDada, curDeliveryHandler, true)
|
||||
scheduler.CurrentScheduler.RegisterDeliveryPlatform(curDeliveryHandler, true)
|
||||
}
|
||||
|
||||
func OnWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaapi.CallbackResponse) {
|
||||
return curDeliveryHandler.OnWaybillMsg(msg)
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetVendorID() int {
|
||||
return model.VendorIDDada
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) OnWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaapi.CallbackResponse) {
|
||||
jxutils.CallMsgHandler(func() {
|
||||
retVal = c.onWaybillMsg(msg)
|
||||
|
||||
@@ -34,7 +34,11 @@ type DeliveryHandler struct {
|
||||
|
||||
func init() {
|
||||
curDeliveryHandler = new(DeliveryHandler)
|
||||
scheduler.CurrentScheduler.RegisterDeliveryPlatform(model.VendorIDMTPS, curDeliveryHandler, true)
|
||||
scheduler.CurrentScheduler.RegisterDeliveryPlatform(curDeliveryHandler, true)
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetVendorID() int {
|
||||
return model.VendorIDMTPS
|
||||
}
|
||||
|
||||
func OnWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *mtpsapi.CallbackResponse) {
|
||||
|
||||
@@ -77,6 +77,7 @@ type IPurchasePlatformHandler interface {
|
||||
|
||||
SyncStoresSkus(db *dao.DaoDB, storeIDs []int, skuIDs []int, isSync bool, userName string) (err error)
|
||||
|
||||
GetVendorID() int
|
||||
GetFieldIDName() string
|
||||
GetFieldSyncStatusName() string
|
||||
}
|
||||
@@ -111,6 +112,8 @@ type ISingleStoreHandler interface {
|
||||
type IDeliveryPlatformHandler interface {
|
||||
CreateWaybill(order *model.GoodsOrder, policy func(deliveryFee, addFee int64) error) (bill *model.Waybill, err error)
|
||||
CancelWaybill(bill *model.Waybill, cancelReasonID int, cancelReason string) (err error)
|
||||
|
||||
GetVendorID() int
|
||||
}
|
||||
|
||||
func Init(curOrderManager IOrderManager) {
|
||||
|
||||
@@ -16,7 +16,7 @@ type PurchaseHandler struct {
|
||||
|
||||
func init() {
|
||||
curPurchaseHandler = new(PurchaseHandler)
|
||||
scheduler.CurrentScheduler.RegisterPurchasePlatform(model.VendorIDEBAI, curPurchaseHandler)
|
||||
scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler)
|
||||
}
|
||||
|
||||
func EbaiBusStatus2JxStatus(ebaiStatus int) int {
|
||||
@@ -25,3 +25,7 @@ func EbaiBusStatus2JxStatus(ebaiStatus int) int {
|
||||
}
|
||||
return model.StoreStatusOpened
|
||||
}
|
||||
|
||||
func (p *PurchaseHandler) GetVendorID() int {
|
||||
return model.VendorIDEBAI
|
||||
}
|
||||
|
||||
@@ -18,7 +18,11 @@ type PurchaseHandler struct {
|
||||
|
||||
func init() {
|
||||
curPurchaseHandler = new(PurchaseHandler)
|
||||
scheduler.CurrentScheduler.RegisterPurchasePlatform(model.VendorIDELM, curPurchaseHandler)
|
||||
scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler)
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) GetVendorID() int {
|
||||
return model.VendorIDELM
|
||||
}
|
||||
|
||||
func OnCallbackMsg(msg *elmapi.CallbackMsg) (retVal *elmapi.CallbackResponse) {
|
||||
|
||||
@@ -17,7 +17,11 @@ type PurchaseHandler struct {
|
||||
|
||||
func init() {
|
||||
curPurchaseHandler = new(PurchaseHandler)
|
||||
scheduler.CurrentScheduler.RegisterPurchasePlatform(model.VendorIDJD, curPurchaseHandler)
|
||||
scheduler.CurrentScheduler.RegisterPurchasePlatform(curPurchaseHandler)
|
||||
}
|
||||
|
||||
func (c *PurchaseHandler) GetVendorID() int {
|
||||
return model.VendorIDJD
|
||||
}
|
||||
|
||||
func OnOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
||||
|
||||
Reference in New Issue
Block a user