瀏覽代碼

更新

master
huangjiajun 1 年之前
父節點
當前提交
542b106b3e
共有 3 個文件被更改,包括 40 次插入1 次删除
  1. +38
    -0
      app/hdl/zhimeng_internal/hdl_playlet_order.go
  2. +1
    -0
      app/router/router.go
  3. +1
    -1
      go.mod

+ 38
- 0
app/hdl/zhimeng_internal/hdl_playlet_order.go 查看文件

@@ -1,10 +1,48 @@
package hdl

import (
"applet/app/db"
"applet/app/e"
"applet/app/svc"
svc2 "applet/app/task/svc"
"applet/app/utils"
"code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/tpdaren"
"github.com/gin-gonic/gin"
"github.com/tidwall/gjson"
)

func GetPlayletOrder(c *gin.Context) {
svc.GetPlayletOrder(c)
}
func GetShortLink(c *gin.Context) {
var args map[string]string
if err := c.ShouldBindJSON(&args); err != nil {
e.OutErr(c, e.ERR_INVALID_ARGS, err)
return
}
sysCfgDb := db.MasterListCfgDb{}
sysCfgDb.Set()
uid := "0"
tpdarenAppidData, _ := sysCfgDb.MasterListCfgGetOne(uid, "tpdaren_appid")
tpdarenAppsecretData, _ := sysCfgDb.MasterListCfgGetOne(uid, "tpdaren_appsecret")
if tpdarenAppidData == nil || tpdarenAppsecretData == nil {
return
}
token := svc2.GetTpdarenToken(uid)
var res = map[string]string{"word": ""}
if token == "" {
e.OutSuc(c, res, nil)
return
}
param := map[string]interface{}{
"theater_id": utils.StrToInt(args["theater_id"]),
"episode": utils.StrToInt(args["episode"]),
"message_id": args["message_id"],
}
paging, _ := tpdaren.ShortLinkCreate(token, param)
if gjson.Get(paging, "data").String() != "" {
res["word"] = gjson.Get(paging, "data").String()
}
e.OutSuc(c, res, nil)
return
}

+ 1
- 0
app/router/router.go 查看文件

@@ -49,6 +49,7 @@ func routeInternal(r *gin.RouterGroup) {
r.Use(mw.DB) // 以下接口需要用到数据库
{
r.POST("/playlet_order", internalHdl.GetPlayletOrder)
r.POST("/playlet_short_link", internalHdl.GetShortLink)
}

r.Use(mw.Checker) // 以下接口需要检查Header: platform


+ 1
- 1
go.mod 查看文件

@@ -4,7 +4,7 @@ go 1.15

require (
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20230707081910-52e70aa52998
code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git v1.1.21-0.20230703061209-fc6ac71cc155
code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git v1.1.21-0.20230805060535-47d3fd8bc8d7
github.com/360EntSecGroup-Skylar/excelize v1.4.1
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
github.com/boombuler/barcode v1.0.1


Loading…
取消
儲存