parent
17452dfd0d
commit
ce361989e5
@ -0,0 +1,5 @@
|
||||
package customer
|
||||
|
||||
type Customer struct {
|
||||
Sku sku
|
||||
}
|
@ -0,0 +1,129 @@
|
||||
package customer
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
"git.oa00.com/supply-chain/service/lib/bean"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type sku struct {
|
||||
}
|
||||
|
||||
type SkuSearch struct {
|
||||
Status uint // 1=上架 2=下架
|
||||
SkuName string // 商品名称
|
||||
}
|
||||
type ArgsSkuList struct {
|
||||
CustomerId uint // 客户id
|
||||
Search SkuSearch
|
||||
Page bean.Page
|
||||
}
|
||||
|
||||
type SkuItem struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
BrandId uint `json:"brandId"`
|
||||
BrandName string `json:"brandName"`
|
||||
FirstCategoryId uint `json:"firstCategoryId"`
|
||||
FirstCategoryName string `json:"firstCategoryName"`
|
||||
SecondCategoryId uint `json:"secondCategoryId"`
|
||||
SecondCategoryName string `json:"secondCategoryName"`
|
||||
ThirdCategoryId uint `json:"thirdCategoryId"`
|
||||
ThirdCategoryName string `json:"thirdCategoryName"`
|
||||
Price decimal.Decimal `json:"price"`
|
||||
GuidePrice decimal.Decimal `json:"guidePrice"`
|
||||
ImgUrl string `json:"imgUrl"`
|
||||
Profit decimal.Decimal `json:"profit"`
|
||||
Size string `json:"size"`
|
||||
Color string `json:"color"`
|
||||
Tax string `json:"tax"`
|
||||
Unit string `json:"unit"`
|
||||
UpcCode string `json:"upcCode"`
|
||||
Status uint `json:"status"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
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) {
|
||||
err = client.GetClient(s).Call(ctx, "Lists", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsSkuDetails struct {
|
||||
CustomerId uint // 客户id
|
||||
SkuIds []uint // sku数组
|
||||
}
|
||||
|
||||
type SkuDetailItem struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
BrandId uint `json:"brandId"`
|
||||
BrandName string `json:"brandName"`
|
||||
FirstCategoryId uint `json:"firstCategoryId"`
|
||||
FirstCategoryName string `json:"firstCategoryName"`
|
||||
SecondCategoryId uint `json:"secondCategoryId"`
|
||||
SecondCategoryName string `json:"secondCategoryName"`
|
||||
ThirdCategoryId uint `json:"thirdCategoryId"`
|
||||
ThirdCategoryName string `json:"thirdCategoryName"`
|
||||
Price decimal.Decimal `json:"price"`
|
||||
GuidePrice decimal.Decimal `json:"guidePrice"`
|
||||
ImgUrl string `json:"imgUrl"`
|
||||
Profit decimal.Decimal `json:"profit"`
|
||||
Size string `json:"size"`
|
||||
Color string `json:"color"`
|
||||
Tax string `json:"tax"`
|
||||
Unit string `json:"unit"`
|
||||
UpcCode string `json:"upcCode"`
|
||||
Status uint `json:"status"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
Content string `json:"content"`
|
||||
Imgs []SkuImg `json:"imgs"`
|
||||
Specifications []SkuSpecification `json:"specifications"`
|
||||
}
|
||||
type SkuImg struct {
|
||||
Path string `json:"path"`
|
||||
}
|
||||
|
||||
type SkuSpecification struct {
|
||||
Name string `json:"name"`
|
||||
Attributes []SkuAttribute `json:"attributes"`
|
||||
}
|
||||
|
||||
type SkuAttribute struct {
|
||||
Name string `json:"name"`
|
||||
Value []string `json:"value"`
|
||||
}
|
||||
|
||||
// Details @Title 获取sku详情
|
||||
func (s *sku) Details(ctx context.Context, args ArgsSkuDetails) (reply []SkuDetailItem, err error) {
|
||||
err = client.GetClient(s).Call(ctx, "Details", args, &reply)
|
||||
return
|
||||
}
|
||||
|
||||
type ArgsSkuStock struct {
|
||||
Address string // 地址
|
||||
Skus []SkuStockItem // sku信息
|
||||
}
|
||||
|
||||
type SkuStockItem struct {
|
||||
SkuId uint // skuId
|
||||
Quantity uint // 数量
|
||||
}
|
||||
|
||||
type ReplySkuStock struct {
|
||||
SkuId uint `json:"skuId"` // skuId
|
||||
State uint `json:"state"` // 库存状态
|
||||
}
|
||||
|
||||
// Stock @Title 库存查询
|
||||
func (s *sku) Stock(ctx context.Context, args ArgsSkuStock) (reply []ReplySkuStock, err error) {
|
||||
err = client.GetClient(s).Call(ctx, "Stock", args, &reply)
|
||||
return
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package setting
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.oa00.com/supply-chain/service/client"
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type rate struct {
|
||||
}
|
||||
|
||||
type RateItem struct {
|
||||
Id uint `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Rate decimal.Decimal `json:"rate"`
|
||||
}
|
||||
|
||||
// All @Title 全部利率
|
||||
func (r *rate) All(ctx context.Context) (result []RateItem, err error) {
|
||||
err = client.GetClient(r).Call(ctx, "All", 0, &result)
|
||||
return
|
||||
}
|
@ -1,8 +1,11 @@
|
||||
package supply
|
||||
|
||||
import "git.oa00.com/supply-chain/service/supply/customer"
|
||||
|
||||
type Supply struct {
|
||||
Brand brand
|
||||
Category category
|
||||
Sku sku
|
||||
SkuAudit skuAudit
|
||||
Customer customer.Customer
|
||||
}
|
||||
|
Loading…
Reference in new issue