aa
This commit is contained in:
@@ -22,6 +22,6 @@ func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType int) (lin
|
|||||||
return "jds", err
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import (
|
|||||||
"git.rosy.net.cn/baseapi/platformapi/mtunionapi"
|
"git.rosy.net.cn/baseapi/platformapi/mtunionapi"
|
||||||
"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/model"
|
"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 {
|
type UnionHandler struct {
|
||||||
@@ -18,6 +20,8 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getAPI() (apiobj *mtunionapi.API) {
|
func getAPI() (apiobj *mtunionapi.API) {
|
||||||
|
if configs, err := dao.QueryConfigs(dao.GetDB(), "mtunionCookie", model.ConfigTypeCookie, ""); err == nil {
|
||||||
return apiobj
|
api.MtUnionAPI.SetCookieWithStr(configs[0].Value)
|
||||||
|
}
|
||||||
|
return api.MtUnionAPI
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package mt
|
package mt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"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"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -8,6 +9,19 @@ func (s *UnionHandler) ShareUnionLink(ctx *jxcontext.Context, linkType int) (lin
|
|||||||
return "mt", err
|
return "mt", 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
|
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
|
package partner
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -14,7 +16,13 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ActivityList struct {
|
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() {
|
func init() {
|
||||||
@@ -23,7 +31,7 @@ func init() {
|
|||||||
|
|
||||||
type UnionInterface interface {
|
type UnionInterface interface {
|
||||||
ShareUnionLink(ctx *jxcontext.Context, linkType int) (link string, err error)
|
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 {
|
func GetHandler(vendorID int) UnionInterface {
|
||||||
|
|||||||
Reference in New Issue
Block a user