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.
service/skycrane/category.go

66 lines
1.5 KiB

7 months ago
package skycrane
import (
"context"
"git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean"
)
type category struct {
}
type CategorySearch struct {
CategoryId int64
Mate int // 1=已匹配 2=未匹配
}
type ArgsCategoryList struct {
Search CategorySearch
Page bean.Page
}
type CategoryItem struct {
Id int64 `json:"id"`
FirstCategoryName string `json:"firstCategoryName"`
SecondCategoryName string `json:"secondCategoryName"`
ThirdCategoryName string `json:"thirdCategoryName"`
MateCategoryID int64 `json:"mateCategoryID"`
}
type ReplyCategoryList struct {
Lists []CategoryItem `json:"lists"`
Total int64 `json:"total"`
}
// List @Title 类目列表
func (c *category) List(ctx context.Context, args ArgsCategoryList) (reply ReplyCategoryList, err error) {
xClient, err := client.GetClient(c)
if err != nil {
return
}
xClient.Call(ctx, "List", args, &reply)
return
}
type ArgsCategoryMate struct {
CategoryId int64 // 类目id
SupplyCategoryId int64 // 修改匹配类目id
}
// Mate @Title 类目匹配
func (c *category) Mate(ctx context.Context, args ArgsCategoryMate) error {
reply := 0
xClient, err := client.GetClient(c)
if err != nil {
return err
}
return xClient.Call(ctx, "Mate", args, &reply)
}
// All @Title 类目
func (c *category) All(ctx context.Context, args CategorySearch) (reply []CategoryItem, err error) {
xClient, err := client.GetClient(c)
if err != nil {
return
}
xClient.Call(ctx, "All", args, &reply)
return
}