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.
68 lines
1.3 KiB
68 lines
1.3 KiB
package batchSku
|
|
|
|
import (
|
|
"context"
|
|
"git.oa00.com/supply-chain/service/client"
|
|
)
|
|
|
|
type banner struct {
|
|
}
|
|
|
|
type BannerItem struct {
|
|
Id uint `json:"id"`
|
|
Img string `json:"img"`
|
|
SkuId uint `json:"skuId"`
|
|
}
|
|
|
|
// All @Title 全部轮播图
|
|
func (b *banner) All(ctx context.Context) (reply []BannerItem, err error) {
|
|
xClient, err := client.GetClient(b)
|
|
if err != nil {
|
|
return
|
|
}
|
|
args := 0
|
|
err = xClient.Call(ctx, "All", args, &reply)
|
|
return
|
|
}
|
|
|
|
type ArgsSkuBannerEdit struct {
|
|
Id uint
|
|
SkuId uint
|
|
Img string
|
|
}
|
|
|
|
// Edit @Title 编辑轮播图
|
|
func (b *banner) Edit(ctx context.Context, args ArgsSkuBannerEdit) (err error) {
|
|
xClient, err := client.GetClient(b)
|
|
if err != nil {
|
|
return
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "Edit", args, &reply)
|
|
}
|
|
|
|
// Del @Title 删除轮播图
|
|
func (b *banner) Del(ctx context.Context, id uint) (err error) {
|
|
xClient, err := client.GetClient(b)
|
|
if err != nil {
|
|
return
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "Del", id, &reply)
|
|
}
|
|
|
|
type ArgsSkuBannerAdd struct {
|
|
SkuId uint
|
|
Img string
|
|
}
|
|
|
|
// Add @Title 添加轮播图
|
|
func (b *banner) Add(ctx context.Context, args ArgsSkuBannerAdd) error {
|
|
xClient, err := client.GetClient(b)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "Add", args, &reply)
|
|
}
|