From 89417e6f6de4ae56c81e3a80241e311a3aaa860e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 19 Apr 2021 14:16:26 +0800 Subject: [PATCH] aa --- business/jxstore/cms/cms.go | 6 ++++++ business/jxstore/cms/job.go | 2 +- business/jxstore/partner/mt/union.go | 7 +++++++ business/jxstore/partner/partner.go | 1 + controllers/job_controller.go | 4 ++-- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/business/jxstore/cms/cms.go b/business/jxstore/cms/cms.go index 0765b9b2e..d8b1744d2 100644 --- a/business/jxstore/cms/cms.go +++ b/business/jxstore/cms/cms.go @@ -3,6 +3,7 @@ package cms import ( "encoding/json" "fmt" + "git.rosy.net.cn/baseapi/platformapi/mtunionapi" "reflect" "regexp" "strconv" @@ -96,6 +97,11 @@ func InitServiceInfo(version string, buildTime time.Time, gitCommit string) { "cashbackName": model.CashbackName, "consumeName": model.ConsumeName, "txWaybillNames": model.TxWaybillNames, + "unionActTypeNames": map[int]map[int]interface{}{ + model.VendorIDMTWM: map[int]interface{}{ + mtunionapi.ActTypeQB: "券包推广", + }, + }, }, } } diff --git a/business/jxstore/cms/job.go b/business/jxstore/cms/job.go index 782e32980..79dfb9d0f 100644 --- a/business/jxstore/cms/job.go +++ b/business/jxstore/cms/job.go @@ -1922,7 +1922,7 @@ func TempJob() (err error) { return err } -func GetUnionActList(ctx *jxcontext.Context, vendorID, actType int) (link interface{}, err error) { +func GetUnionActList(ctx *jxcontext.Context, vendorID, actType int) (actList []*partner.ActivityList, err error) { return partner.GetHandler(vendorID).GetUnionActList(ctx, actType) } diff --git a/business/jxstore/partner/mt/union.go b/business/jxstore/partner/mt/union.go index 9d841fff8..6bfeb9839 100644 --- a/business/jxstore/partner/mt/union.go +++ b/business/jxstore/partner/mt/union.go @@ -1,8 +1,10 @@ package mt 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" + "strings" ) func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType int) (link string, err error) { @@ -18,6 +20,11 @@ func (s *UnionHandler) GetUnionActList(ctx *jxcontext.Context, actType int) (act ActDes: v.ActDes, Ratio: v.Ratio, ActSrc: v.ActSrc, + Img: v.URL, + } + if v.DateBound != "" { + act.DateBegin = utils.Str2Time(v.DateBound[:strings.LastIndex(v.DateBound, "至")-1]) + act.DateEnd = utils.Str2Time(v.DateBound[strings.LastIndex(v.DateBound, "至")+4:]) } actList = append(actList, act) } diff --git a/business/jxstore/partner/partner.go b/business/jxstore/partner/partner.go index cb934e21e..2c1410a53 100644 --- a/business/jxstore/partner/partner.go +++ b/business/jxstore/partner/partner.go @@ -23,6 +23,7 @@ type ActivityList struct { DateBegin time.Time `json:"dateBegin"` DateEnd time.Time `json:"dateEnd"` ActSrc string `json:"actSrc"` //物料? + Img string `json:"img"` //活动图 } func init() { diff --git a/controllers/job_controller.go b/controllers/job_controller.go index e020e3033..c4fcf4cad 100644 --- a/controllers/job_controller.go +++ b/controllers/job_controller.go @@ -551,8 +551,8 @@ func (c *JobController) TempJob() { }) } -// @Title 查询联盟任务 -// @Description 查询联盟任务 +// @Title 查询联盟活动 +// @Description 查询联盟活动 // @Param token header string true "认证token" // @Param vendorID query int true "平台ID" // @Param actType query int true "活动类型ID"