aa
This commit is contained in:
@@ -22,6 +22,6 @@ func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType int) (lin
|
||||
return "jds", err
|
||||
}
|
||||
|
||||
func (s *UnionHandler) GetUnionActList(ctx *jxcontext.Context, actType int) (link interface{}, err error) {
|
||||
func (s *UnionHandler) GetUnionActList(ctx *jxcontext.Context, actType int) (actList []*partner.ActivityList, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtunionapi"
|
||||
"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 {
|
||||
@@ -18,6 +20,8 @@ func init() {
|
||||
}
|
||||
|
||||
func getAPI() (apiobj *mtunionapi.API) {
|
||||
|
||||
return apiobj
|
||||
if configs, err := dao.QueryConfigs(dao.GetDB(), "mtunionCookie", model.ConfigTypeCookie, ""); err == nil {
|
||||
api.MtUnionAPI.SetCookieWithStr(configs[0].Value)
|
||||
}
|
||||
return api.MtUnionAPI
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package mt
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/partner"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
)
|
||||
|
||||
@@ -8,6 +9,19 @@ func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType int) (lin
|
||||
return "mt", err
|
||||
}
|
||||
|
||||
func (s *UnionHandler) GetUnionActList(ctx *jxcontext.Context, actType int) (link interface{}, err error) {
|
||||
return
|
||||
func (s *UnionHandler) GetUnionActList(ctx *jxcontext.Context, actType int) (actList []*partner.ActivityList, err error) {
|
||||
if result, err := getAPI().ActivityList(actType, 20, 0); err == nil {
|
||||
for _, v := range result {
|
||||
act := &partner.ActivityList{
|
||||
ActID: v.ID,
|
||||
ActName: v.ActName,
|
||||
ActDes: v.ActDes,
|
||||
Ratio: v.Ratio,
|
||||
ActSrc: v.ActSrc,
|
||||
}
|
||||
|
||||
actList = append(actList, act)
|
||||
}
|
||||
}
|
||||
return actList, err
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package partner
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
)
|
||||
|
||||
@@ -14,7 +16,13 @@ const (
|
||||
)
|
||||
|
||||
type ActivityList struct {
|
||||
ActID int `json:"actID"`
|
||||
ActID int `json:"actID"`
|
||||
ActName string `json:"actName"`
|
||||
ActDes string `json:"actDes"`
|
||||
Ratio string `json:"ratio"` //返现比?
|
||||
DateBegin time.Time `json:"dateBegin"`
|
||||
DateEnd time.Time `json:"dateEnd"`
|
||||
ActSrc string `json:"actSrc"` //物料?
|
||||
}
|
||||
|
||||
func init() {
|
||||
@@ -23,7 +31,7 @@ func init() {
|
||||
|
||||
type UnionInterface interface {
|
||||
ShareUnionLink(ctx *jxcontext.Context, linkType int) (link string, err error)
|
||||
GetUnionActList(ctx *jxcontext.Context, actType int) (result interface{}, err error)
|
||||
GetUnionActList(ctx *jxcontext.Context, actType int) (result []*ActivityList, err error)
|
||||
}
|
||||
|
||||
func GetHandler(vendorID int) UnionInterface {
|
||||
|
||||
Reference in New Issue
Block a user