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/customer/batchSku/hotType.go

61 lines
1.2 KiB

package batchSku
import (
"context"
"git.oa00.com/supply-chain/service/client"
)
type skuHotType struct {
}
type ArgsSkuHotTypeEdit struct {
Id uint
Name string
}
// Edit @Title 编辑分类
func (s *skuHotType) Edit(ctx context.Context, args ArgsSkuHotTypeEdit) error {
xClient, err := client.GetClient(s)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "Edit", args, &reply)
}
// Add @Title 添加分类
func (s *skuHotType) Add(ctx context.Context, name string) error {
xClient, err := client.GetClient(s)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "Add", name, &reply)
}
// Del @Title 删除分类
func (s *skuHotType) Del(ctx context.Context, id uint) error {
xClient, err := client.GetClient(s)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "Del", id, &reply)
}
type HotTypeItem struct {
Id uint `json:"id"`
Name string `json:"name"`
}
// All @Title 全部分类
func (s *skuHotType) All(ctx context.Context) (reply []HotTypeItem, err error) {
xClient, err := client.GetClient(s)
if err != nil {
return nil, err
}
args := 0
err = xClient.Call(ctx, "All", args, &reply)
return
}