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.
|
|
|
package wholesale
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"git.oa00.com/supply-chain/service/client"
|
|
|
|
"git.oa00.com/supply-chain/service/supply"
|
|
|
|
)
|
|
|
|
|
|
|
|
type category struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
// All @Title 获取分类
|
|
|
|
func (c *category) All(ctx context.Context) (result []supply.CategoryItem, err error) {
|
|
|
|
xClient, err := client.GetClient(c)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
err = xClient.Call(ctx, "All", 0, &result)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add @Title 添加分类
|
|
|
|
func (c *category) Add(ctx context.Context, args supply.ArgsCategoryAdd) (err error) {
|
|
|
|
reply := 0
|
|
|
|
xClient, err := client.GetClient(c)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
return xClient.Call(ctx, "Add", args, &reply)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Edit @Title 编辑分类
|
|
|
|
func (c *category) Edit(ctx context.Context, args supply.ArgsCategoryEdit) (err error) {
|
|
|
|
reply := 0
|
|
|
|
xClient, err := client.GetClient(c)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
return xClient.Call(ctx, "Edit", args, &reply)
|
|
|
|
}
|
|
|
|
|
|
|
|
// FindByIds @Title 三级分类获取
|
|
|
|
func (c *category) FindByIds(ctx context.Context, args supply.ArgsCategoryFindByIds) (result []supply.ThirdCategoryItem, err error) {
|
|
|
|
xClient, err := client.GetClient(c)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
err = xClient.Call(ctx, "FindByIds", args, &result)
|
|
|
|
return
|
|
|
|
}
|