pdd 物料详情
This commit is contained in:
@@ -2072,3 +2072,8 @@ func GetVendorMatters(ctx *jxcontext.Context, vendorID int, vendorCatID, keyword
|
||||
handler := partner.GetHandler(vendorID)
|
||||
return handler.GetUnionMatterList(ctx, vendorCatID, keyword, page, 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)
|
||||
}
|
||||
|
||||
@@ -33,3 +33,7 @@ func (s *UnionHandler) CreateUnionPosition(ctx *jxcontext.Context, userID string
|
||||
func (s *UnionHandler) GetUnionMatterList(ctx *jxcontext.Context, vendorCatID, keyword string, page, pageSize, sortType int, listID string) (list *partner.MatterList, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (s *UnionHandler) GetUnionMatterDetail(ctx *jxcontext.Context, goodsID string) (result *partner.GoodsDetail, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -52,3 +52,7 @@ func (s *UnionHandler) CreateUnionPosition(ctx *jxcontext.Context, userID string
|
||||
func (s *UnionHandler) GetUnionMatterList(ctx *jxcontext.Context, vendorCatID, keyword string, page, pageSize, sortType int, listID string) (list *partner.MatterList, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (s *UnionHandler) GetUnionMatterDetail(ctx *jxcontext.Context, goodsID string) (result *partner.GoodsDetail, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -45,6 +45,17 @@ type ActivityList struct {
|
||||
Img string `json:"img"` //活动图
|
||||
}
|
||||
|
||||
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 GoodsList struct {
|
||||
GoodsID string `json:"goodsID"`
|
||||
GoodsName string `json:"goodsName"`
|
||||
@@ -72,6 +83,7 @@ type UnionInterface interface {
|
||||
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)
|
||||
}
|
||||
|
||||
func GetHandler(vendorID int) UnionInterface {
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -107,3 +108,25 @@ func (s *UnionHandler) GetUnionMatterList(ctx *jxcontext.Context, vendorCatID, k
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (s *UnionHandler) GetUnionMatterDetail(ctx *jxcontext.Context, goodsID string) (result *partner.GoodsDetail, err error) {
|
||||
result = &partner.GoodsDetail{}
|
||||
if goods, err2 := api.PddAPI.GoodsDetail(goodsID); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
result.GoodsID = goods.GoodsSign
|
||||
result.GoodsName = goods.GoodsName
|
||||
result.Img = goods.GoodsThumbnailURL
|
||||
result.CouponDiscount = goods.CouponDiscount
|
||||
result.MinNormalPrice = goods.MinNormalPrice
|
||||
result.SalesCount = goods.SalesTip
|
||||
result.Imgs = strings.Join(goods.GoodsGalleryUrls, ",")
|
||||
result.MainImg = goods.GoodsImageURL
|
||||
result.StoreImg = goods.MallImgURL
|
||||
result.StoreName = goods.MallName
|
||||
result.LgstTxt = goods.LgstTxt
|
||||
result.DescTxt = goods.DescTxt
|
||||
result.ServTxt = goods.ServTxt
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
|
||||
@@ -50,3 +50,7 @@ func (s *UnionHandler) CreateUnionPosition(ctx *jxcontext.Context, userID string
|
||||
func (s *UnionHandler) GetUnionMatterList(ctx *jxcontext.Context, vendorCatID, keyword string, page, pageSize, sortType int, listID string) (list *partner.MatterList, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (s *UnionHandler) GetUnionMatterDetail(ctx *jxcontext.Context, goodsID string) (result *partner.GoodsDetail, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -630,3 +630,18 @@ func (c *JobController) GetVendorMatters() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 查询平台物料详情
|
||||
// @Description 查询平台物料详情
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorID query int true "平台ID"
|
||||
// @Param goodsID query string true "平台商品ID"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetVendorMatterDetail [get]
|
||||
func (c *JobController) GetVendorMatterDetail() {
|
||||
c.callGetVendorMatterDetail(func(params *tJobGetVendorMatterDetailParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = cms.GetVendorMatterDetail(params.Ctx, params.VendorID, params.GoodsID)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -637,6 +637,15 @@ func init() {
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"],
|
||||
beego.ControllerComments{
|
||||
Method: "GetVendorMatterDetail",
|
||||
Router: "/GetVendorMatterDetail",
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:JobController"],
|
||||
beego.ControllerComments{
|
||||
Method: "SubmitJob",
|
||||
|
||||
Reference in New Issue
Block a user