|
|
@ -76,49 +76,41 @@ type ArgsGoodsInfo struct {
|
|
|
|
SkuId uint
|
|
|
|
SkuId uint
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type ReplyGoodsInfo struct {
|
|
|
|
type ReplyCommodityInfo struct {
|
|
|
|
Id uint `json:"id"`
|
|
|
|
Id uint `json:"id"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
CommodityCode string `json:"commodityCode"`
|
|
|
|
SupplierId uint `json:"supplierId"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
SupplierName string `json:"supplierName"`
|
|
|
|
ImgUrl string `json:"imgUrl"`
|
|
|
|
CategoryId uint `json:"categoryId"`
|
|
|
|
FirstCategoryId uint `json:"firstCategoryId"`
|
|
|
|
BrandId uint `json:"brandId"`
|
|
|
|
FirstCategoryName string `json:"firstCategoryName"`
|
|
|
|
Imgs []string `json:"imgs"`
|
|
|
|
SecondCategoryId uint `json:"secondCategoryId"`
|
|
|
|
Content string `json:"content"`
|
|
|
|
SecondCategoryName string `json:"secondCategoryName"`
|
|
|
|
Attributes []GoodsAttributeItem `json:"attributes"`
|
|
|
|
ThirdCategoryId uint `json:"thirdCategoryId"`
|
|
|
|
Skus []SkuItem `json:"skus"`
|
|
|
|
ThirdCategoryName string `json:"thirdCategoryName"`
|
|
|
|
Status uint `json:"status"`
|
|
|
|
Handle uint `json:"handle"`
|
|
|
|
}
|
|
|
|
Status uint `json:"status"`
|
|
|
|
|
|
|
|
Skus []SkuItem `json:"skus"`
|
|
|
|
type GoodsAttributeItem struct {
|
|
|
|
Imgs []CommodityImgItem `json:"imgs"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
}
|
|
|
|
Value string `json:"value"`
|
|
|
|
|
|
|
|
GroupName string `json:"groupName"`
|
|
|
|
type CommodityImgItem struct {
|
|
|
|
}
|
|
|
|
Id uint `json:"id"`
|
|
|
|
|
|
|
|
Path string `json:"path"`
|
|
|
|
type SkuSpecItem struct {
|
|
|
|
ReplacePath string `json:"replacePath"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
|
|
|
Value string `json:"value"`
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type SkuItem struct {
|
|
|
|
type SkuItem struct {
|
|
|
|
SkuId uint `json:"skuId"`
|
|
|
|
Id uint `json:"id"`
|
|
|
|
Color string `json:"color"`
|
|
|
|
SkuCode string `json:"skuCode"`
|
|
|
|
Size string `json:"size"`
|
|
|
|
SpecName string `json:"specName"`
|
|
|
|
SupplyPrice decimal.Decimal `json:"supplyPrice"`
|
|
|
|
SpecValue string `json:"specValue"`
|
|
|
|
MarketPrice decimal.Decimal `json:"marketPrice"`
|
|
|
|
SupplyPrice decimal.Decimal `json:"supplyPrice"`
|
|
|
|
UpcCode string `json:"upcCode"`
|
|
|
|
GuidePrice decimal.Decimal `json:"guidePrice"`
|
|
|
|
UnitId uint `json:"uintId"`
|
|
|
|
ImgUrl string `json:"imgUrl"`
|
|
|
|
TaxCategoryId uint `json:"taxCategoryId"`
|
|
|
|
|
|
|
|
TaxName string `json:"taxName"`
|
|
|
|
|
|
|
|
TaxCode string `json:"taxCode"`
|
|
|
|
|
|
|
|
Unit string `json:"uint"`
|
|
|
|
|
|
|
|
Tax decimal.Decimal `json:"tax"`
|
|
|
|
|
|
|
|
Img string `json:"img"`
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Info @Title 商品详情
|
|
|
|
// Info @Title 商品详情
|
|
|
|
func (g *commodity) Info(ctx context.Context, goodsId uint) (reply ReplyGoodsInfo, err error) {
|
|
|
|
func (g *commodity) Info(ctx context.Context, goodsId uint) (reply ReplyCommodityInfo, err error) {
|
|
|
|
xClient, err := client.GetClient(g)
|
|
|
|
xClient, err := client.GetClient(g)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -127,13 +119,18 @@ func (g *commodity) Info(ctx context.Context, goodsId uint) (reply ReplyGoodsInf
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type ReplyImgs struct {
|
|
|
|
|
|
|
|
GoodsId uint `json:"goodsId"`
|
|
|
|
|
|
|
|
Imgs []string `json:"imgs"`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetImgs @Title 获取商品主图
|
|
|
|
// GetImgs @Title 获取商品主图
|
|
|
|
func (g *commodity) GetImgs(ctx context.Context, goodsId uint) (reply []string, err error) {
|
|
|
|
func (g *commodity) GetImgs(ctx context.Context, goodsIds []uint) (reply []ReplyImgs, err error) {
|
|
|
|
xClient, err := client.GetClient(g)
|
|
|
|
xClient, err := client.GetClient(g)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
err = xClient.Call(ctx, "GetImgs", goodsId, &reply)
|
|
|
|
err = xClient.Call(ctx, "GetImgs", goodsIds, &reply)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|