1
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/tiktok_store"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
)
|
||||
@@ -10,13 +12,35 @@ type TiktokController struct {
|
||||
web.Controller
|
||||
}
|
||||
|
||||
// CallbackTiktok 抖店用户下单订单推送 (tiktokStore)
|
||||
func (t *TiktokController) CallbackTiktok() {
|
||||
data, resp := api.TiktokStore.CreateOrderCallback(t.Ctx.Request)
|
||||
if resp.Code == 200 {
|
||||
// 业务处理
|
||||
tiktok_store.OnCallbackMsg(data)
|
||||
// CallbackTiktokOrderMsg 抖店用户下单订单推送 (tiktokStore)
|
||||
func (t *TiktokController) CallbackTiktokOrderMsg() {
|
||||
// 1.防伪校验
|
||||
resp := api.TiktokStore.EventSignChange(t.Ctx.Request)
|
||||
if resp.Code != 0 {
|
||||
t.Data["json"] = resp
|
||||
t.ServeJSON()
|
||||
return
|
||||
}
|
||||
t.Data["json"] = resp
|
||||
|
||||
// 2.参数解析
|
||||
orderStatus, resp := api.TiktokStore.CreateOrderCallback(t.Ctx.Request)
|
||||
globals.SugarLogger.Debug("美团订单回调数据打印测试===========", orderStatus)
|
||||
if resp.Code != 0 {
|
||||
t.Data["json"] = resp
|
||||
t.ServeJSON()
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range orderStatus {
|
||||
resp2 := tiktok_store.OnOrderMsg(v)
|
||||
if resp2.Code != 0 {
|
||||
t.Data["json"] = resp2
|
||||
t.ServeJSON()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
t.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackSuccessCode, Msg: tiktok_api.CallbackSuccess}
|
||||
t.ServeJSON()
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user