80 lines
2.4 KiB
Go
80 lines
2.4 KiB
Go
package partner
|
|
|
|
import (
|
|
"time"
|
|
|
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
|
)
|
|
|
|
var (
|
|
UnionHandlerMap map[int]UnionInterface
|
|
)
|
|
|
|
const (
|
|
LinkTypeWeiXinMini = 5 //微信小程序二维码
|
|
LinTypeH5 = 1 //h5链接
|
|
LinTypeDeepLink = 2 //deeplink(唤起)链接
|
|
LinTypeInto = 3 //中间页唤起链接
|
|
LinTypeWx = 4 //微信小程序唤起路径
|
|
|
|
ShareTypeOther = 1 //分享给别人
|
|
ShareTypeOwn = 2 //自己领
|
|
|
|
MtUnionJxSID = "000000001"
|
|
|
|
//排序参数,正数升序,负数倒序
|
|
JxSortTypeYJ = 1 //佣金比
|
|
JxSortTypeXL = 2 //销量
|
|
JxSortTypeJG = 3 //价格
|
|
)
|
|
|
|
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"` //活动图
|
|
}
|
|
|
|
type GoodsList struct {
|
|
GoodsID string `json:"goodsID"`
|
|
GoodsName string `json:"goodsName"`
|
|
Img string `json:"img"`
|
|
CouponDiscount int `json:"couponDiscount"` //优惠券
|
|
CouponRemainQuantity int `json:"couponRemainQuantity"` //优惠券剩余数量
|
|
MinNormalPrice int `json:"minNormalPrice"` //最小购买价格
|
|
SalesCount string `json:"salesCount"` //销量
|
|
PromotionRate int `json:"promotionRate"` //佣金比例,千分比
|
|
}
|
|
|
|
type MatterList struct {
|
|
GoodsList []*GoodsList
|
|
VendorID int `json:"vendorID"`
|
|
ListID string `json:"listID"`
|
|
TotalCount int `json:"totalCount"`
|
|
}
|
|
|
|
func init() {
|
|
UnionHandlerMap = make(map[int]UnionInterface)
|
|
}
|
|
|
|
type UnionInterface interface {
|
|
ShareUnionLink(ctx *jxcontext.Context, linkType, unionActID int, sID, userID string, resourceType int) (link string, err error)
|
|
GetUnionActList(ctx *jxcontext.Context, actType int) (result []*ActivityList, err error)
|
|
CreateUnionPosition(ctx *jxcontext.Context, userID string) (sID string, err error)
|
|
GetUnionMatterList(ctx *jxcontext.Context, vendorCatID, keyword string, page, pageSize, sortType int, listID string) (result *MatterList, err error)
|
|
}
|
|
|
|
func GetHandler(vendorID int) UnionInterface {
|
|
return UnionHandlerMap[vendorID]
|
|
}
|