+ RegisterPurchaseOrderHandler(为了适应加入的京西自营商城)
This commit is contained in:
@@ -80,6 +80,7 @@ var (
|
||||
CurStoreManager IStoreManager
|
||||
|
||||
PurchasePlatformHandlers map[int]IPurchasePlatformHandler
|
||||
PurchaseOrderHandlers map[int]IPurchasePlatformOrderHandler
|
||||
)
|
||||
|
||||
type IOrderManager interface {
|
||||
@@ -221,10 +222,22 @@ func RegisterPurchasePlatform(handler IPurchasePlatformHandler) {
|
||||
PurchasePlatformHandlers[vendorID] = handler
|
||||
}
|
||||
|
||||
func RegisterPurchaseOrderHandler(vendorID int, handler IPurchasePlatformOrderHandler) {
|
||||
PurchaseOrderHandlers[vendorID] = handler
|
||||
}
|
||||
|
||||
func GetPurchasePlatformFromVendorID(vendorID int) IPurchasePlatformHandler {
|
||||
return PurchasePlatformHandlers[vendorID]
|
||||
}
|
||||
|
||||
func GetPurchaseOrderHandlerFromVendorID(vendorID int) (handler IPurchasePlatformOrderHandler) {
|
||||
handler = PurchasePlatformHandlers[vendorID]
|
||||
if handler == nil {
|
||||
handler = PurchaseOrderHandlers[vendorID]
|
||||
}
|
||||
return handler
|
||||
}
|
||||
|
||||
func GetPurchasePlatformVendorIDs() (vendorIDs []int) {
|
||||
for k := range PurchasePlatformHandlers {
|
||||
vendorIDs = append(vendorIDs, k)
|
||||
|
||||
@@ -21,6 +21,7 @@ func init() {
|
||||
CurPurchaseHandler = new(PurchaseHandler)
|
||||
// 不能注册京西
|
||||
// partner.RegisterPurchasePlatform(CurPurchaseHandler)
|
||||
partner.RegisterPurchaseOrderHandler(CurPurchaseHandler.GetVendorID(), CurPurchaseHandler)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user