Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop
This commit is contained in:
@@ -1133,13 +1133,13 @@ func (s *DefScheduler) resetTimer(savedOrderInfo *WatchOrderInfo, bill *model.Wa
|
|||||||
if timeout == 0 {
|
if timeout == 0 {
|
||||||
config.CallTimeoutAction(savedOrderInfo, bill)
|
config.CallTimeoutAction(savedOrderInfo, bill)
|
||||||
} else {
|
} else {
|
||||||
timerName := ""
|
//timerName := ""
|
||||||
if statusType == model.OrderTypeOrder {
|
//if statusType == model.OrderTypeOrder {
|
||||||
timerName = model.OrderStatusName[status]
|
// timerName = model.OrderStatusName[status]
|
||||||
} else if statusType == model.OrderTypeWaybill {
|
//} else if statusType == model.OrderTypeWaybill {
|
||||||
timerName = model.WaybillStatusName[status]
|
// timerName = model.WaybillStatusName[status]
|
||||||
}
|
//}
|
||||||
globals.SugarLogger.Debugf("timerName %s", timerName)
|
//globals.SugarLogger.Debugf("timerName %s", timerName)
|
||||||
timerInfo := &tTimerInfo{
|
timerInfo := &tTimerInfo{
|
||||||
statusType: statusType,
|
statusType: statusType,
|
||||||
vendorID: vendorID,
|
vendorID: vendorID,
|
||||||
|
|||||||
@@ -4322,7 +4322,6 @@ func CreateVendorStore(ctx *jxcontext.Context, storeID, vendorID int, payload ma
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
fmt.Println("======", payload["pricePercentage"])
|
|
||||||
if vendorStoreID != "" && vendorStoreID != "0" {
|
if vendorStoreID != "" && vendorStoreID != "0" {
|
||||||
//AddStoreVendorMap 太复杂了并不满足,还是手动加吧
|
//AddStoreVendorMap 太复杂了并不满足,还是手动加吧
|
||||||
storeMap := &model.StoreMap{
|
storeMap := &model.StoreMap{
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ package controllers
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
|
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
|
||||||
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxstore/common"
|
"git.rosy.net.cn/jx-callback/business/jxstore/common"
|
||||||
"git.rosy.net.cn/jx-callback/business/model"
|
"git.rosy.net.cn/jx-callback/business/model"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
"git.rosy.net.cn/jx-callback/globals/api"
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
"github.com/astaxie/beego/server/web"
|
"github.com/astaxie/beego/server/web"
|
||||||
"time"
|
"time"
|
||||||
@@ -16,41 +18,60 @@ type TiktokShopController struct {
|
|||||||
|
|
||||||
// TokenMsg 抖音用户授权
|
// TokenMsg 抖音用户授权
|
||||||
func (c *TiktokShopController) TokenMsg() {
|
func (c *TiktokShopController) TokenMsg() {
|
||||||
code := c.Ctx.Request.URL.Query().Get("code")
|
codeList := c.Ctx.Request.URL.Query().Get("code")
|
||||||
result, err := api.TiktokStore.CreateToken(code)
|
globals.SugarLogger.Debugf("codeList=====%s", utils.Format4Output(codeList, false))
|
||||||
if err != nil {
|
var code []string
|
||||||
|
if err := json.Unmarshal([]byte(codeList), &code); err != nil {
|
||||||
|
globals.SugarLogger.Debugf("codeList=====err%s", utils.Format4Output(err, false))
|
||||||
c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail}
|
c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail}
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
result.ExpiresIn += time.Now().Unix()
|
globals.SugarLogger.Debugf("codeList=====%s", utils.Format4Output(codeList, false))
|
||||||
data, err := json.Marshal(result)
|
globals.SugarLogger.Debugf("code=====%s", utils.Format4Output(code, false))
|
||||||
if err != nil {
|
if len(code) == 0 {
|
||||||
c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail}
|
c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail}
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
param := &model.VendorOrgCode{
|
for _, v := range code {
|
||||||
VendorID: model.VendorIDDD,
|
result, err := api.TiktokStore.CreateToken(v)
|
||||||
VendorOrgCode: result.ShopId,
|
if err != nil {
|
||||||
Comment: "抖音授权",
|
c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail}
|
||||||
VendorType: "platform",
|
c.ServeJSON()
|
||||||
IsJxCat: 1,
|
return
|
||||||
IsOpen: 1,
|
}
|
||||||
EmpowerURL: "",
|
globals.SugarLogger.Debugf("result=====%s", utils.Format4Output(result, false))
|
||||||
StoreBrandName: result.ShopName,
|
|
||||||
Token: string(data),
|
result.ExpiresIn += time.Now().Unix()
|
||||||
AppKey: "", // web.AppConfig.DefaultString("tiktokShopAppId", "7136048270014416392"),
|
data, err := json.Marshal(result)
|
||||||
AppSecret: "", // web.AppConfig.DefaultString("tiktokShopAppSecret", "c397aa9f-3927-47c4-8cfe-4d84e02602e0")
|
if err != nil {
|
||||||
}
|
c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail}
|
||||||
if err := common.AddVendorOrgCode(nil, param); err != nil {
|
c.ServeJSON()
|
||||||
c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail}
|
return
|
||||||
c.ServeJSON()
|
}
|
||||||
return
|
|
||||||
|
param := &model.VendorOrgCode{
|
||||||
|
VendorID: model.VendorIDDD,
|
||||||
|
VendorOrgCode: utils.Int64ToStr(result.ShopId),
|
||||||
|
Comment: "抖音授权",
|
||||||
|
VendorType: "platform",
|
||||||
|
IsJxCat: 1,
|
||||||
|
IsOpen: 1,
|
||||||
|
EmpowerURL: "",
|
||||||
|
StoreBrandName: result.ShopName,
|
||||||
|
Token: string(data),
|
||||||
|
AppKey: "", // web.AppConfig.DefaultString("tiktokShopAppId", "7136048270014416392"),
|
||||||
|
AppSecret: "", // web.AppConfig.DefaultString("tiktokShopAppSecret", "c397aa9f-3927-47c4-8cfe-4d84e02602e0")
|
||||||
|
}
|
||||||
|
if err := common.AddVendorOrgCode(nil, param); err != nil {
|
||||||
|
c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail}
|
||||||
|
c.ServeJSON()
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackSuccessCode, Msg: tiktok_api.CallbackSuccess}
|
c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackSuccessCode, Msg: tiktok_api.CallbackSuccess}
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user