添加淘鲜达

This commit is contained in:
邹宗楠
2023-06-28 10:04:08 +08:00
parent 64e4339aeb
commit c0a97b4fad
51 changed files with 2109 additions and 2007 deletions

View File

@@ -1,4 +1,4 @@
package mtwm
package tao_vegetable
import (
"fmt"
@@ -6,8 +6,6 @@ import (
"strings"
"sync"
"git.rosy.net.cn/jx-callback/business/model/dao"
"git.rosy.net.cn/baseapi/platformapi/mtwmapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxutils"
@@ -32,7 +30,7 @@ type PurchaseHandler struct {
}
func init() {
if api.MtwmAPI != nil || api.Mtwm2API != nil {
if api.TaoVegetableApi != nil {
CurPurchaseHandler = New()
partner.RegisterPurchasePlatform(CurPurchaseHandler)
}
@@ -148,11 +146,11 @@ func bizStatusJX2Mtwm(status int) (openLevel, online int) {
return mtwmapi.PoiOpenLevelNormal, mtwmapi.PoiStatusOnline
}
func skuStatusJX2Mtwm(status int) int {
func skuStatusJX2Tao(status int) int64 {
if status == model.SkuStatusNormal {
return mtwmapi.SellStatusOnline
return tao_vegetable.CreateOnlineSaleFlag
}
return mtwmapi.SellStatusOffline
return tao_vegetable.CreateOfflineSaleFlag
}
func (p *PurchaseHandler) UploadImg(ctx *jxcontext.Context, vendorOrgCode, imgURL string, imgData []byte, imgName string, imgType int) (imgHint string, err error) {
@@ -215,23 +213,15 @@ func getAPI(appOrgCode string, storeID int, vendorStoreID string) (apiObj *tao_v
if appOrgCode == "" {
globals.SugarLogger.Debugf("getAPI appOrgCode is empty")
}
apiObj = partner.CurAPIManager.GetAPI(model.VendorIDTaoVegetable, appOrgCode).(*tao_vegetable.API)
var storeDetail *dao.StoreDetail
if storeID != model.NO {
storeDetail, _ = dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDTaoVegetable, appOrgCode)
} else if vendorStoreID != "" {
storeDetail, _ = dao.GetStoreDetailByVendorStoreID(dao.GetDB(), vendorStoreID, model.VendorIDTaoVegetable, appOrgCode)
}
if storeDetail != nil {
apiObj.SetToken(storeDetail.MtwmToken)
}
//apiObj = partner.CurAPIManager.GetAPI(model.VendorIDTaoVegetable, appOrgCode).(*tao_vegetable.API)
//var storeDetail *dao.StoreDetail
//if storeID != model.NO {
// storeDetail, _ = dao.GetStoreDetail(dao.GetDB(), storeID, model.VendorIDTaoVegetable, appOrgCode)
//} else if vendorStoreID != "" {
// storeDetail, _ = dao.GetStoreDetailByVendorStoreID(dao.GetDB(), vendorStoreID, model.VendorIDTaoVegetable, appOrgCode)
//}
//if storeDetail != nil {
// apiObj.SetToken(storeDetail.MtwmToken)
//}
return apiObj
}
//
//func getAPIWithoutToken(appOrgCode string) (apiObj *mtwmapi.API) {
// if appOrgCode == "" {
// globals.SugarLogger.Warnf("getAPI appOrgCode is empty")
// }
// return partner.CurAPIManager.GetAPI(model.VendorIDTaoVegetable, appOrgCode).(*mtwmapi.API)
//}