finance
黄伟 2 years ago
parent f2a665a091
commit 5b56959699

@ -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"`
CommodityCode string `json:"commodityCode"`
Name string `json:"name"` Name string `json:"name"`
SupplierId uint `json:"supplierId"` ImgUrl string `json:"imgUrl"`
SupplierName string `json:"supplierName"` FirstCategoryId uint `json:"firstCategoryId"`
CategoryId uint `json:"categoryId"` FirstCategoryName string `json:"firstCategoryName"`
BrandId uint `json:"brandId"` SecondCategoryId uint `json:"secondCategoryId"`
Imgs []string `json:"imgs"` SecondCategoryName string `json:"secondCategoryName"`
Content string `json:"content"` ThirdCategoryId uint `json:"thirdCategoryId"`
Attributes []GoodsAttributeItem `json:"attributes"` ThirdCategoryName string `json:"thirdCategoryName"`
Skus []SkuItem `json:"skus"` Handle uint `json:"handle"`
Status uint `json:"status"` Status uint `json:"status"`
Skus []SkuItem `json:"skus"`
Imgs []CommodityImgItem `json:"imgs"`
} }
type GoodsAttributeItem struct { type CommodityImgItem struct {
Name string `json:"name"` Id uint `json:"id"`
Value string `json:"value"` Path string `json:"path"`
GroupName string `json:"groupName"` ReplacePath string `json:"replacePath"`
}
type SkuSpecItem struct {
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"`
SpecValue string `json:"specValue"`
SupplyPrice decimal.Decimal `json:"supplyPrice"` SupplyPrice decimal.Decimal `json:"supplyPrice"`
MarketPrice decimal.Decimal `json:"marketPrice"` GuidePrice decimal.Decimal `json:"guidePrice"`
UpcCode string `json:"upcCode"` ImgUrl string `json:"imgUrl"`
UnitId uint `json:"uintId"`
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
} }

Loading…
Cancel
Save