package skycrane import ( "context" "git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/lib/bean" ) type brand struct { } type BrandSearch struct { Name string // 商品名称 } type ArgsBrandList struct { Search BrandSearch Page bean.Page } type BrandItem struct { Id int64 `json:"id"` Name string `json:"name"` MateBrandID int64 `json:"mateBrandID"` } type ReplyBrandList struct { Lists []BrandItem `json:"lists"` Total int64 `json:"total"` } // List @Title 品牌列表 func (b *brand) List(ctx context.Context, args ArgsBrandList) (reply ReplyBrandList, err error) { xClient, err := client.GetClient(b) if err != nil { return } xClient.Call(ctx, "List", args, &reply) return } type ArgsBrandMate struct { BrandId int64 // 品牌id SupplyBrandId int64 // 修改匹配品牌id } // Mate @Title 品牌匹配 func (b *brand) Mate(ctx context.Context, args ArgsBrandMate) error { reply := 0 xClient, err := client.GetClient(b) if err != nil { return err } return xClient.Call(ctx, "Mate", args, &reply) } // All @Title 品牌 func (b *brand) All(ctx context.Context, args BrandSearch) (reply []BrandItem, err error) { xClient, err := client.GetClient(b) if err != nil { return } xClient.Call(ctx, "All", args, &reply) return }