|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- 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
- }
|