pdd活动查询
This commit is contained in:
@@ -105,6 +105,9 @@ func InitServiceInfo(version string, buildTime time.Time, gitCommit string) {
|
|||||||
model.VendorIDTB: map[int]interface{}{
|
model.VendorIDTB: map[int]interface{}{
|
||||||
tbunionapi.TbElmActTypeBDH: "本地化",
|
tbunionapi.TbElmActTypeBDH: "本地化",
|
||||||
},
|
},
|
||||||
|
model.VendorIDPDD: map[int]interface{}{
|
||||||
|
1: "进行中的活动",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getAPI() (apiobj *pddapi.API) {
|
func getAPI() (apiobj *pddapi.API) {
|
||||||
if configs, err := dao.QueryConfigs(dao.GetDB(), "pddunionCookie", model.ConfigTypeCookie, ""); err == nil {
|
if configs, err := dao.QueryConfigs(dao.GetDB(), "pddCookie", model.ConfigTypeCookie, ""); err == nil {
|
||||||
api.PddAPI.SetCookieWithStr(configs[0].Value)
|
api.PddAPI.SetCookieWithStr(configs[0].Value)
|
||||||
}
|
}
|
||||||
return api.PddAPI
|
return api.PddAPI
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package pdd
|
package pdd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxstore/partner"
|
"git.rosy.net.cn/jx-callback/business/jxstore/partner"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
)
|
)
|
||||||
@@ -10,6 +11,21 @@ func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType, unionAct
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *UnionHandler) GetUnionActList(ctx *jxcontext.Context, actType int) (actList []*partner.ActivityList, err error) {
|
func (s *UnionHandler) GetUnionActList(ctx *jxcontext.Context, actType int) (actList []*partner.ActivityList, err error) {
|
||||||
|
if result, err2 := getAPI().ActivityOperationList(); err2 == nil {
|
||||||
|
for _, v := range result {
|
||||||
|
act := &partner.ActivityList{
|
||||||
|
ActID: v.ID,
|
||||||
|
ActName: v.Name,
|
||||||
|
ActDes: v.Description,
|
||||||
|
Ratio: "未知",
|
||||||
|
ActSrc: v.Fileurl,
|
||||||
|
Img: v.Bannerimage,
|
||||||
|
DateBegin: utils.Str2Time(v.Starttime),
|
||||||
|
DateEnd: utils.Str2Time(v.Endtime),
|
||||||
|
}
|
||||||
|
actList = append(actList, act)
|
||||||
|
}
|
||||||
|
}
|
||||||
return actList, err
|
return actList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user