Files
jx-callback/business/jxstore/partner/partner.go
2021-04-26 11:44:59 +08:00

57 lines
1.5 KiB
Go

package partner
import (
"time"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
)
var (
HandlerMap map[int]UnionInterface
)
const (
LinkTypeWeiXinMini = 5 //微信小程序二维码
LinTypeH5 = 1 //h5链接
LinTypeDeepLink = 2 //deeplink(唤起)链接
LinTypeInto = 3 //中间页唤起链接
LinTypeWx = 4 //微信小程序唤起路径
ShareTypeOther = 1 //分享给别人
ShareTypeOwn = 2 //自己领
MtUnionJxSID = "000000001"
)
type UnionOrderInfo struct {
SID string `json:"sid"`
Profit int64 `json:"profit"` //订单实际返佣金额
VendorID int `json:"vendorID"`
}
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, sID, userID string) (link string, err error)
GetUnionActList(ctx *jxcontext.Context, actType int) (result []*ActivityList, err error)
CreateUnionPosition(ctx *jxcontext.Context, userID string) (sID string, err error)
//GetUnionCouponList(ctx *jxcontext.Context)
}
func GetHandler(vendorID int) UnionInterface {
return HandlerMap[vendorID]
}