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/sku/banner.go

78 lines
1.5 KiB

package sku
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)
}
2 years ago
2 years ago
// DelBySkuId @Title 根据skuId删除
func (b *banner) DelBySkuId(ctx context.Context, skuId uint) (err error) {
xClient, err := client.GetClient(b)
if err != nil {
return
}
reply := 0
return xClient.Call(ctx, "DelBySkuId", skuId, &reply)
}
2 years ago
type ArgsSkuBannerAdd struct {
SkuId uint
Img string
}
// Add @Title 添加轮播图
2 years ago
func (b *banner) Add(ctx context.Context, args ArgsSkuBannerAdd) error {
2 years ago
xClient, err := client.GetClient(b)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "Add", args, &reply)
}