pdd物料推荐
This commit is contained in:
@@ -2068,12 +2068,17 @@ func GetUnionJobOrderInfo(ctx *jxcontext.Context, jobOrderID int) (getUnionJobOr
|
||||
return getUnionJobOrderInfoResult, err
|
||||
}
|
||||
|
||||
func GetVendorMatters(ctx *jxcontext.Context, vendorID int, vendorCatID, keyword string, page, pageSize, sortType int, listID string) (result *partner.MatterList, err error) {
|
||||
func GetVendorMatters(ctx *jxcontext.Context, vendorID int, vendorCatID, keyword string, offset, pageSize, sortType int, listID string) (result *partner.MatterList, err error) {
|
||||
handler := partner.GetHandler(vendorID)
|
||||
return handler.GetUnionMatterList(ctx, vendorCatID, keyword, page, pageSize, sortType, listID)
|
||||
return handler.GetUnionMatterList(ctx, vendorCatID, keyword, offset/pageSize+1, pageSize, sortType, listID)
|
||||
}
|
||||
|
||||
func GetVendorMatterDetail(ctx *jxcontext.Context, vendorID int, goodsID string) (goodsDetail *partner.GoodsDetail, err error) {
|
||||
handler := partner.GetHandler(vendorID)
|
||||
return handler.GetUnionMatterDetail(ctx, goodsID)
|
||||
}
|
||||
|
||||
func GetVendorMatterRcmmd(ctx *jxcontext.Context, vendorID int, goodsID string, rcmmdType, offset, pageSize int) (result *partner.MatterList, err error) {
|
||||
handler := partner.GetHandler(vendorID)
|
||||
return handler.GetUnionMatterListRcmmd(ctx, goodsID, rcmmdType, offset, pageSize)
|
||||
}
|
||||
|
||||
@@ -37,3 +37,7 @@ func (s *UnionHandler) GetUnionMatterList(ctx *jxcontext.Context, vendorCatID, k
|
||||
func (s *UnionHandler) GetUnionMatterDetail(ctx *jxcontext.Context, goodsID string) (result *partner.GoodsDetail, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (s *UnionHandler) GetUnionMatterListRcmmd(ctx *jxcontext.Context, goodsID string, rcmmdType, offset, pageSize int) (result *partner.MatterList, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -56,3 +56,7 @@ func (s *UnionHandler) GetUnionMatterList(ctx *jxcontext.Context, vendorCatID, k
|
||||
func (s *UnionHandler) GetUnionMatterDetail(ctx *jxcontext.Context, goodsID string) (result *partner.GoodsDetail, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (s *UnionHandler) GetUnionMatterListRcmmd(ctx *jxcontext.Context, goodsID string, rcmmdType, offset, pageSize int) (result *partner.MatterList, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ type UnionInterface interface {
|
||||
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 {
|
||||
|
||||
@@ -133,3 +133,32 @@ func (s *UnionHandler) GetUnionMatterDetail(ctx *jxcontext.Context, goodsID stri
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (s *UnionHandler) GetUnionMatterListRcmmd(ctx *jxcontext.Context, goodsID string, rcmmdType, offset, pageSize int) (list *partner.MatterList, err error) {
|
||||
var (
|
||||
goodsList []*partner.GoodsList
|
||||
)
|
||||
list = &partner.MatterList{}
|
||||
if goods, err2 := api.PddAPI.GoodsRecommendGet(goodsID, rcmmdType, offset, pageSize); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
list.ListID = goods.ListID
|
||||
list.TotalCount = goods.Total
|
||||
list.VendorID = model.VendorIDPDD
|
||||
for _, v := range goods.List {
|
||||
good := &partner.GoodsList{
|
||||
GoodsID: v.GoodsSign,
|
||||
GoodsName: v.GoodsName,
|
||||
Img: v.GoodsThumbnailURL,
|
||||
CouponDiscount: v.CouponDiscount,
|
||||
CouponRemainQuantity: v.CouponRemainQuantity,
|
||||
MinNormalPrice: v.MinNormalPrice,
|
||||
SalesCount: v.SalesTip,
|
||||
PromotionRate: v.PromotionRate,
|
||||
}
|
||||
goodsList = append(goodsList, good)
|
||||
}
|
||||
list.GoodsList = goodsList
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -54,3 +54,7 @@ func (s *UnionHandler) GetUnionMatterList(ctx *jxcontext.Context, vendorCatID, k
|
||||
func (s *UnionHandler) GetUnionMatterDetail(ctx *jxcontext.Context, goodsID string) (result *partner.GoodsDetail, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (s *UnionHandler) GetUnionMatterListRcmmd(ctx *jxcontext.Context, goodsID string, rcmmdType, offset, pageSize int) (result *partner.MatterList, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user