Merge remote-tracking branch 'origin/mark' into don
This commit is contained in:
@@ -80,6 +80,7 @@ var (
|
||||
CurStoreManager IStoreManager
|
||||
|
||||
PurchasePlatformHandlers map[int]IPurchasePlatformHandler
|
||||
PurchaseOrderHandlers map[int]IPurchasePlatformOrderHandler
|
||||
)
|
||||
|
||||
type IOrderManager interface {
|
||||
@@ -194,6 +195,7 @@ func (p *BasePurchasePlatform) GetStatusActionTimeout(order *model.GoodsOrder, s
|
||||
|
||||
func init() {
|
||||
PurchasePlatformHandlers = make(map[int]IPurchasePlatformHandler)
|
||||
PurchaseOrderHandlers = make(map[int]IPurchasePlatformOrderHandler)
|
||||
DeliveryPlatformHandlers = make(map[int]*DeliveryPlatformHandlerInfo)
|
||||
}
|
||||
|
||||
@@ -221,10 +223,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)
|
||||
|
||||
Reference in New Issue
Block a user