淘宝饿了么活动
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtunionapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/tbunionapi"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strconv"
|
||||
@@ -101,6 +102,9 @@ func InitServiceInfo(version string, buildTime time.Time, gitCommit string) {
|
||||
model.VendorIDMTWM: map[int]interface{}{
|
||||
mtunionapi.ActTypeQB: "券包推广",
|
||||
},
|
||||
model.VendorIDTB: map[int]interface{}{
|
||||
tbunionapi.TbElmActTypeBDH: "本地化",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1 +1,27 @@
|
||||
package taobao
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/tbunionapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/partner"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
)
|
||||
|
||||
type UnionHandler struct {
|
||||
}
|
||||
|
||||
var (
|
||||
unionHandler *UnionHandler
|
||||
)
|
||||
|
||||
func init() {
|
||||
partner.HandlerMap[model.VendorIDTB] = unionHandler
|
||||
}
|
||||
|
||||
func getAPI() (apiobj *tbunionapi.API) {
|
||||
if configs, err := dao.QueryConfigs(dao.GetDB(), "tbunionCookie", model.ConfigTypeCookie, ""); err == nil {
|
||||
api.TbUnionAPI.SetCookieWithStr(configs[0].Value)
|
||||
}
|
||||
return api.TbUnionAPI
|
||||
}
|
||||
|
||||
30
business/jxstore/partner/taobao/union.go
Normal file
30
business/jxstore/partner/taobao/union.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package taobao
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/partner"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
)
|
||||
|
||||
func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, userID string) (link string, err error) {
|
||||
return link, err
|
||||
}
|
||||
|
||||
func (s *UnionHandler) GetUnionActList(ctx *jxcontext.Context, actType int) (actList []*partner.ActivityList, err error) {
|
||||
if result, err2 := getAPI().GatewayUnionpub(); err2 == nil {
|
||||
for _, v := range result {
|
||||
act := &partner.ActivityList{
|
||||
ActID: utils.Str2Int(v.Eventid),
|
||||
ActName: v.Pagename,
|
||||
ActDes: v.Eventenname,
|
||||
Ratio: "6%",
|
||||
ActSrc: v.Pageurl,
|
||||
Img: v.Pagepicturl,
|
||||
DateBegin: utils.Str2Time(v.Pagestarttime),
|
||||
DateEnd: utils.Str2Time(v.Pageendtime),
|
||||
}
|
||||
actList = append(actList, act)
|
||||
}
|
||||
}
|
||||
return actList, err
|
||||
}
|
||||
Reference in New Issue
Block a user