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.
63 lines
1.5 KiB
63 lines
1.5 KiB
2 years ago
|
package otosaas
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"git.oa00.com/supply-chain/service/client"
|
||
|
"git.oa00.com/supply-chain/service/lib/bean"
|
||
|
)
|
||
|
|
||
|
type category struct {
|
||
|
}
|
||
|
type ArgsCategoryList struct {
|
||
|
ThirdCategoryId uint
|
||
|
Page bean.Page
|
||
|
}
|
||
|
|
||
|
type CategoryItem struct {
|
||
|
Id uint `json:"id"`
|
||
|
FirstCategoryName string `json:"firstCategoryName"`
|
||
|
SecondCategoryName string `json:"secondCategoryName"`
|
||
|
ThirdCategoryName string `json:"thirdCategoryName"`
|
||
|
SupplyCategoryId uint `json:"supplyCategoryId"`
|
||
|
}
|
||
|
type ReplyCategoryList struct {
|
||
|
Lists []CategoryItem `json:"lists"`
|
||
|
Total int64 `json:"total"`
|
||
|
}
|
||
|
|
||
|
// Lists @Title 获取品牌匹配列表
|
||
|
func (c *category) Lists(ctx context.Context, args ArgsCategoryList) (reply ReplyCategoryList, err error) {
|
||
|
xClient, err := client.GetClient(c)
|
||
|
if err != nil {
|
||
|
return
|
||
|
}
|
||
|
err = xClient.Call(ctx, "Lists", args, &reply)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
type ArgsCategoryEdit struct {
|
||
|
CategoryId uint // 分类id
|
||
|
SupplyCategoryId uint // 匹配分类id
|
||
|
}
|
||
|
|
||
|
// Edit @Title 编辑品牌匹配
|
||
|
func (c *category) Edit(ctx context.Context, args ArgsCategoryEdit) error {
|
||
|
reply := 0
|
||
|
xClient, err := client.GetClient(c)
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
return xClient.Call(ctx, "Edit", args, &reply)
|
||
|
}
|
||
|
|
||
|
// Select @Title 类目筛选
|
||
|
func (c *category) Select(ctx context.Context) (reply []CategoryItem, err error) {
|
||
|
args := 0
|
||
|
xClient, err := client.GetClient(c)
|
||
|
if err != nil {
|
||
|
return
|
||
|
}
|
||
|
err = xClient.Call(ctx, "Select", args, &reply)
|
||
|
return
|
||
|
}
|