41 lines
959 B
Go
41 lines
959 B
Go
package partner
|
|
|
|
import (
|
|
"time"
|
|
|
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
|
)
|
|
|
|
var (
|
|
HandlerMap map[int]UnionInterface
|
|
)
|
|
|
|
const (
|
|
LinkTypeWeiXinMini = 1 //微信小程序
|
|
LinkTypeH5 = 2 //H5
|
|
)
|
|
|
|
type ActivityList struct {
|
|
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"` //物料?
|
|
Img string `json:"img"` //活动图
|
|
}
|
|
|
|
func init() {
|
|
HandlerMap = make(map[int]UnionInterface)
|
|
}
|
|
|
|
type UnionInterface interface {
|
|
ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, userID string) (link string, err error)
|
|
GetUnionActList(ctx *jxcontext.Context, actType int) (result []*ActivityList, err error)
|
|
}
|
|
|
|
func GetHandler(vendorID int) UnionInterface {
|
|
return HandlerMap[vendorID]
|
|
}
|