添加供应商商品列表接口

finance
黄伟 2 years ago
parent c1e7466531
commit a2ae2d4177

@ -3,6 +3,7 @@ package service
import ( import (
"git.oa00.com/supply-chain/service/customer" "git.oa00.com/supply-chain/service/customer"
"git.oa00.com/supply-chain/service/jd" "git.oa00.com/supply-chain/service/jd"
"git.oa00.com/supply-chain/service/supplier"
"git.oa00.com/supply-chain/service/supply" "git.oa00.com/supply-chain/service/supply"
) )
@ -12,4 +13,5 @@ type rpc struct {
Supply supply.Supply Supply supply.Supply
Jd jd.Jd Jd jd.Jd
Customer customer.Customer Customer customer.Customer
Supplier supplier.Supplier
} }

@ -0,0 +1,5 @@
package goods
type Goods struct {
Sku sku
}

@ -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
}

@ -0,0 +1,7 @@
package supplier
import "git.oa00.com/supply-chain/service/supplier/goods"
type Supplier struct {
Goods goods.Goods
}
Loading…
Cancel
Save