Files
jx-callback/business/jxstore/partner/partner.go
suyl 1331f22052 aa
2021-08-03 17:51:48 +08:00

108 lines
4.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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"` //活动图
ActRule string `json:"actRule"`
}
type GoodsDetail struct {
GoodsList
MainImg string `json:"mainImg"`
Imgs string `json:"imgs"`
StoreImg string `json:"storeImg"` //店铺图片
StoreName string `json:"storeName"` //店铺名
LgstTxt string `json:"lgstTxt"` //物流分
DescTxt string `json:"descTxt"` //描述分
ServTxt string `json:"servTxt"` //服务分
}
type GoodsDetail2 struct {
MainImg string `json:"mainImg"`
Imgs string `json:"imgs"`
StoreImg string `json:"storeImg"` //店铺图片
StoreName string `json:"storeName"` //店铺名
Tpwd string `json:"tpwd"` //淘口令 非苹果ios14以上版本的设备即其他ios版本、Android系统等可以用此淘口令正常在复制到手淘打开
//针对苹果ios14及以上版本的苹果设备手淘将按照示例值信息格式读取淘口令(需包含:数字+羊角符+url
//识别规则可能根据ios情况变更)。如需更改淘口令内文案、url等内容请务必先验证更改后的淘口令在手淘可被识别打开
TpwdIOS14 string `json:"tpwdIOS14"`
UrlL string `json:"urlL"` //推广地址长链
UrlS string `json:"urlS"` //推广地址短链
}
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"` //佣金比例,千分比
GoodsDetail *GoodsDetail2 `json:"goodsDetail"` //淘宝用
}
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, goodsID 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)
GetUnionMatterList(ctx *jxcontext.Context, vendorCatID, keyword string, page, pageSize, sortType int, listID string) (result *MatterList, err error)
GetUnionMatterDetail(ctx *jxcontext.Context, goodsID string) (result *GoodsDetail, err error)
GetUnionMatterListRcmmd(ctx *jxcontext.Context, goodsID string, rcmmdType, offset, pageSize int) (result *MatterList, err error)
}
func GetHandler(vendorID int) UnionInterface {
return UnionHandlerMap[vendorID]
}