You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.6 KiB
57 lines
1.6 KiB
2 years ago
|
package goods
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"git.oa00.com/supply-chain/service/client"
|
||
|
"git.oa00.com/supply-chain/service/lib/bean"
|
||
|
"github.com/shopspring/decimal"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
SkuStatusNone = 1 // 待处理
|
||
|
SkuStatusAdopt = 2 // 同步入库
|
||
|
SkuStatusReject = 3 // 废弃商品
|
||
|
)
|
||
|
|
||
|
type sku struct {
|
||
|
}
|
||
|
type SkuSearch struct {
|
||
|
Name string // 商品名称
|
||
|
SupplierSkuId uint64 // 京东SkuId
|
||
|
CategoryId uint64 // 类目id
|
||
|
BrandName string // 品牌
|
||
|
MinSupplyPrice decimal.Decimal // 采购价最小
|
||
|
MaxSupplyPrice decimal.Decimal // 采购价最大
|
||
|
SupplierType uint // 供应商类型
|
||
|
}
|
||
|
type ArgsSkuList struct {
|
||
|
Search SkuSearch
|
||
|
Page bean.Page
|
||
|
}
|
||
|
|
||
|
type SkuItem struct {
|
||
|
Id uint `json:"id"`
|
||
|
Name string `json:"name"`
|
||
|
ImgUrl string `json:"imgUrl"`
|
||
|
FirstCategoryName string `json:"firstCategoryName"`
|
||
|
SecondCategoryName string `json:"secondCategoryName"`
|
||
|
ThirdCategoryName string `json:"thirdCategoryName"`
|
||
|
BrandName string `json:"brandName"`
|
||
|
SupplyPrice decimal.Decimal `json:"supplyPrice"`
|
||
|
GuidePrice decimal.Decimal `json:"guidePrice"`
|
||
|
}
|
||
|
type ReplySkuList struct {
|
||
|
Lists []SkuItem `json:"lists"`
|
||
|
Total int64 `json:"total"`
|
||
|
}
|
||
|
|
||
|
// Lists @Title 获取商品列表
|
||
|
func (s *sku) Lists(ctx context.Context, args ArgsSkuList) (reply ReplySkuList, err error) {
|
||
|
xClient, err := client.GetClient(s)
|
||
|
if err != nil {
|
||
|
return
|
||
|
}
|
||
|
err = xClient.Call(ctx, "Lists", args, &reply)
|
||
|
return
|
||
|
}
|