- 京东门店相关的操作改用新API(非map)
This commit is contained in:
@@ -2,7 +2,6 @@ package jd
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
@@ -19,10 +18,8 @@ var (
|
||||
|
||||
func init() {
|
||||
globals.SugarLogger.Debug("init jd")
|
||||
if getAPI("") != nil {
|
||||
CurPurchaseHandler = new(PurchaseHandler)
|
||||
partner.RegisterPurchasePlatform(CurPurchaseHandler)
|
||||
}
|
||||
CurPurchaseHandler = new(PurchaseHandler)
|
||||
partner.RegisterPurchasePlatform(CurPurchaseHandler)
|
||||
}
|
||||
|
||||
func getAPI(appOrgCode string) (apiObj *jdapi.API) {
|
||||
@@ -33,8 +30,8 @@ func (c *PurchaseHandler) GetVendorID() int {
|
||||
return model.VendorIDJD
|
||||
}
|
||||
|
||||
func JdOperationTime2JxOperationTime(value1 interface{}) int16 {
|
||||
value := int16(utils.Interface2Int64WithDefault(value1, 0))
|
||||
func JdOperationTime2JxOperationTime(value1 int) int16 {
|
||||
value := int16(value1)
|
||||
return (value/2)*100 + (value%2)*30
|
||||
}
|
||||
|
||||
@@ -42,12 +39,10 @@ func JxOperationTime2JdOperationTime(value int16) int16 {
|
||||
return (value/100)*2 + (value%100)/30
|
||||
}
|
||||
|
||||
func JdStoreStatus2JxStatus(yn, closeStatus interface{}) int {
|
||||
yn2 := utils.Interface2Int64WithDefault(yn, 0)
|
||||
closeStatus2 := utils.Interface2Int64WithDefault(closeStatus, 0)
|
||||
if yn2 == 1 {
|
||||
func JdStoreStatus2JxStatus(yn, closeStatus int) int {
|
||||
if yn == 1 {
|
||||
return model.StoreStatusDisabled
|
||||
} else if closeStatus2 == 1 {
|
||||
} else if closeStatus == 1 {
|
||||
return model.StoreStatusClosed
|
||||
}
|
||||
return model.StoreStatusOpened
|
||||
|
||||
Reference in New Issue
Block a user