diff --git a/rpc.go b/rpc.go index e0e791e..f53982f 100644 --- a/rpc.go +++ b/rpc.go @@ -3,6 +3,7 @@ package service import ( "git.oa00.com/supply-chain/service/customer" "git.oa00.com/supply-chain/service/jd" + "git.oa00.com/supply-chain/service/supplier" "git.oa00.com/supply-chain/service/supply" ) @@ -12,4 +13,5 @@ type rpc struct { Supply supply.Supply Jd jd.Jd Customer customer.Customer + Supplier supplier.Supplier } diff --git a/supplier/goods/goods.go b/supplier/goods/goods.go new file mode 100644 index 0000000..6e36c8b --- /dev/null +++ b/supplier/goods/goods.go @@ -0,0 +1,5 @@ +package goods + +type Goods struct { + Sku sku +} diff --git a/supplier/goods/sku.go b/supplier/goods/sku.go new file mode 100644 index 0000000..05a800c --- /dev/null +++ b/supplier/goods/sku.go @@ -0,0 +1,56 @@ +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 +} diff --git a/supplier/supplier.go b/supplier/supplier.go new file mode 100644 index 0000000..668ec73 --- /dev/null +++ b/supplier/supplier.go @@ -0,0 +1,7 @@ +package supplier + +import "git.oa00.com/supply-chain/service/supplier/goods" + +type Supplier struct { + Goods goods.Goods +}