活动主题配置

finance
黄伟 2 years ago
parent d0e21725a8
commit 33e428566e

@ -0,0 +1,96 @@
package sku
import (
"context"
"git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean"
)
type hotItem struct {
}
type ReplySkuHotItemHandle struct {
SkuId uint `json:"skuId"`
Error string `json:"error"`
}
type ArgsSkuHotItemAdd struct {
SkuTypeId uint
SkuIds []uint
}
// Add @Title 添加商品
func (i *hotItem) Add(ctx context.Context, args ArgsSkuHotItemAdd) (reply []ReplySkuHotItemHandle, err error) {
xClient, err := client.GetClient(i)
if err != nil {
return nil, err
}
err = xClient.Call(ctx, "Add", args, &reply)
return
}
type ArgsSkuHotItemDel struct {
SkuTypeId uint
SkuIds []uint
}
// Del @Title 删除商品
func (i *hotItem) Del(ctx context.Context, args ArgsSkuHotItemDel) error {
xClient, err := client.GetClient(i)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "Del", args, &reply)
}
type ArgsSkuHotItemLists struct {
SkuTypeId uint
SkuId uint
Page bean.Page
}
type ReplySkuHotItemLists struct {
Total int64 `json:"total"`
Lists []SkuHotItem `json:"lists"`
}
type SkuHotItem struct {
Id uint `json:"id"`
SkuId uint `json:"skuId"`
}
// Lists @Title 商品列表
func (i *hotItem) Lists(ctx context.Context, args ArgsSkuHotItemLists) (reply ReplySkuHotItemLists, err error) {
xClient, err := client.GetClient(i)
if err != nil {
return ReplySkuHotItemLists{}, err
}
err = xClient.Call(ctx, "Lists", args, &reply)
return
}
// DelAll @Title 删除全部商品
func (i *hotItem) DelAll(ctx context.Context, skuTypeId uint) error {
xClient, err := client.GetClient(i)
if err != nil {
return err
}
reply := 0
return xClient.Call(ctx, "DelAll", skuTypeId, &reply)
}
type ArgsBySkuHotIds struct {
SkuIds []uint
SkuTypeId uint
}
// FindBySkuIds @Title 根据SkuId查询数据
func (i *hotItem) FindBySkuIds(ctx context.Context, args ArgsBySkuHotIds) (reply []SkuHotItem, err error) {
xClient, err := client.GetClient(i)
if err != nil {
return nil, err
}
err = xClient.Call(ctx, "FindBySkuIds", args, &reply)
return
}

@ -0,0 +1,60 @@
package sku
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
}

@ -5,4 +5,6 @@ type Sku struct {
Type skuType Type skuType
Sale sale Sale sale
Item item Item item
HotType skuHotType
HotItem SkuHotItem
} }

Loading…
Cancel
Save