finance
黄伟 2 years ago
parent a2ae2d4177
commit 9c76abd491

@ -15,38 +15,59 @@ const (
type sku struct { type sku struct {
} }
type SkuSearch struct { type GoodsSearch struct {
Name string // 商品名称 Name string // 商品名称
SupplierSkuId uint64 // 京东SkuId
CategoryId uint64 // 类目id CategoryId uint64 // 类目id
BrandName string // 品牌 BrandName string // 品牌名
MinSupplyPrice decimal.Decimal // 采购价最小
MaxSupplyPrice decimal.Decimal // 采购价最大
SupplierType uint // 供应商类型 SupplierType uint // 供应商类型
} }
type ArgsSkuList struct { type ArgsGoodsList struct {
Search SkuSearch Search GoodsSearch
Page bean.Page Page bean.Page
} }
type SkuItem struct { type GoodsItem struct {
Id uint `json:"id"` Id uint `json:"id"`
Name string `json:"name"` Name string `json:"name"`
ImgUrl string `json:"imgUrl"` Img string `json:"img"`
FirstCategoryName string `json:"firstCategoryName"` GoodsNum string `json:"goodsNum"`
SecondCategoryName string `json:"secondCategoryName"` CategoryId uint `json:"categoryId"`
ThirdCategoryName string `json:"thirdCategoryName"` Category string `json:"category"`
BrandName string `json:"brandName"` BrandId uint `json:"brandId"`
Brand string `json:"brand"`
GoodsSpecs []GoodsSpecificationItem `json:"goodsSpecs"`
SkuItems []GoodsItemLists `json:"skuItems"`
StockCount uint `json:"stockCount"`
MinPrice decimal.Decimal `json:"minPrice"`
CreatedAt int64 `json:"createdAt"`
}
type GoodsItemLists struct {
Id uint `json:"id"`
Specifications []SkuSpecificationItem `json:"specifications"`
Stock uint `json:"stock"`
SupplyPrice decimal.Decimal `json:"supplyPrice"` SupplyPrice decimal.Decimal `json:"supplyPrice"`
GuidePrice decimal.Decimal `json:"guidePrice"` GoodsId uint `json:"goodsId"`
Img string `json:"img"`
}
type GoodsSpecificationItem struct {
Name string `json:"name"`
Values []string `json:"values"`
} }
type ReplySkuList struct {
Lists []SkuItem `json:"lists"` type SkuSpecificationItem struct {
Name string `json:"name"`
Value string `json:"value"`
}
type ReplyGoodsLists struct {
List []GoodsItem `json:"list"`
Total int64 `json:"total"` Total int64 `json:"total"`
} }
// Lists @Title 获取商品列表 // Lists @Title 获取商品列表
func (s *sku) Lists(ctx context.Context, args ArgsSkuList) (reply ReplySkuList, err error) { func (s *sku) Lists(ctx context.Context, args ArgsGoodsList) (reply ReplyGoodsLists, err error) {
xClient, err := client.GetClient(s) xClient, err := client.GetClient(s)
if err != nil { if err != nil {
return return

Loading…
Cancel
Save