Merge branch 'master' of git.oa00.com:supply-chain/service

finance
黄伟 2 years ago
commit 92c08e6dca

@ -51,6 +51,16 @@ func (b *banner) Del(ctx context.Context, id uint) (err error) {
return xClient.Call(ctx, "Del", id, &reply)
}
// 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)
}
type ArgsSkuBannerAdd struct {
SkuId uint
Img string

@ -229,6 +229,9 @@ type ReplyAfterServiceDetail struct {
SendAt int64 `json:"sendAt"`
PackageSend uint `json:"packageSend"`
AfsPackageSend AfsPackageSend `json:"afsPackageSend"`
OrderSubSn uint64 `json:"orderSubSn"`
SourceId uint `json:"sourceId"`
ChannelId uint `json:"channelId"`
}
type AfsPackageSend struct {
Name string `json:"name"`

@ -11,6 +11,14 @@ import (
type sku struct {
}
const (
SkuOrderTypePrice = 1 // 价格排序
SkuOrderTypeDiscount = 2 // 价格折扣
SkuOrderSortUp = 1 // 升序
SkuOrderSortDown = 2 // 降序
)
type SkuSearch struct {
Status uint // 1=上架 2=下架
SkuName string // 商品名称
@ -85,6 +93,10 @@ type SkuEsSearch struct {
MaxGuidePrice decimal.Decimal // 市场参考价
Source uint // 所属供应商
ThirdCategoryIds []uint // 三级分类Ids
TagIds []uint // 标签Ids
OrderType uint // 排序类型
OrderSort uint // 排序顺序
}
type ArgsSkuListsEs struct {
Search SkuEsSearch

@ -2,4 +2,5 @@ package setting
type Setting struct {
Rate rate
Tag tag
}

@ -0,0 +1,113 @@
package setting
import (
"context"
"git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean"
)
type tag struct {
}
type ArgsTagList struct {
Search TagSearch
Page bean.Page
}
type TagItem struct {
Id uint `json:"id"`
Name string `json:"name"`
CreatedAt int64 `json:"createdAt"`
UpdatedAt int64 `json:"updatedAt"`
}
type ReplyTagList struct {
Lists []TagItem `json:"lists"`
Total int64 `json:"total"`
}
type TagSearch struct {
Name string // 标签名称
}
// Lists @Title 标签列表
func (b *tag) Lists(ctx context.Context, args ArgsTagList) (result ReplyTagList, err error) {
xClient, err := client.GetClient(b)
if err != nil {
return
}
err = xClient.Call(ctx, "Lists", args, &result)
return
}
// All @Title 全部标签
func (b *tag) All(ctx context.Context) (result []TagItem, err error) {
xClient, err := client.GetClient(b)
if err != nil {
return
}
err = xClient.Call(ctx, "All", 0, &result)
return
}
// FindByNameAll @Title 标签名称筛选标签
func (b *tag) FindByNameAll(ctx context.Context, name string) (result []TagItem, err error) {
xClient, err := client.GetClient(b)
if err != nil {
return
}
err = xClient.Call(ctx, "FindByNameAll", name, &result)
return
}
type ArgsTagAdd struct {
Name string // 标签名称
}
// Add @Title 添加标签
func (b *tag) Add(ctx context.Context, args ArgsTagAdd) (err error) {
reply := 0
xClient, err := client.GetClient(b)
if err != nil {
return err
}
return xClient.Call(ctx, "Add", args, &reply)
}
// Adds @Title 添加标签
func (b *tag) Adds(ctx context.Context, tagNames []string) (err error) {
reply := 0
xClient, err := client.GetClient(b)
if err != nil {
return err
}
return xClient.Call(ctx, "Adds", tagNames, &reply)
}
type ArgsTagEdit struct {
TagId uint // 标签id
Name string // 标签名称
}
// Edit @Title 编辑标签
func (b *tag) Edit(ctx context.Context, args ArgsTagEdit) (err error) {
reply := 0
xClient, err := client.GetClient(b)
if err != nil {
return err
}
return xClient.Call(ctx, "Edit", args, &reply)
}
type ArgsTagFindByIds struct {
TagIds []uint // 标签id数组
}
// FindByIds @Title 标签获取
func (b *tag) FindByIds(ctx context.Context, args ArgsTagFindByIds) (result []TagItem, err error) {
xClient, err := client.GetClient(b)
if err != nil {
return
}
err = xClient.Call(ctx, "FindByIds", args, &result)
return
}

@ -116,6 +116,7 @@ type SkuListsSearch struct {
SourceSkuId uint // 供应商skuId
BrandId uint // 品牌Id
BrandIds []uint // 品牌Ids
TagIds []uint // 商品标签Ids
FirstCategoryId uint // 一级分类Id
FirstCategoryIds []uint // 一级分类ids
SecondCategoryId uint // 二级分类Id
@ -168,6 +169,7 @@ type SkuItem struct {
Color string `json:"color"` // 颜色
Size string `json:"size"` // 尺寸
Attributes []AttributeItem `json:"attributes"` // 商品属性
TagIds []uint `json:"tagIds"` // 商品标签ids
}
type AttributeItem struct {

@ -0,0 +1,65 @@
package supply
import (
"context"
"git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean"
)
type skuTag struct {
}
type ArgsSkuTagAdds struct {
SkuIds []uint // skuIds
TagId uint // tagId
}
// Adds @Title 添加商品
func (s *skuTag) Adds(ctx context.Context, args ArgsSkuTagAdds) error {
reply := 0
xClient, err := client.GetClient(s)
if err != nil {
return err
}
return xClient.Call(ctx, "Adds", args, &reply)
}
type ArgsSkuTagDels struct {
SkuIds []uint // skuIds
TagId uint // tagId
}
// Dels @Title 删除商品
func (s *skuTag) Dels(ctx context.Context, args ArgsSkuTagDels) error {
reply := 0
xClient, err := client.GetClient(s)
if err != nil {
return err
}
return xClient.Call(ctx, "Dels", args, &reply)
}
type ArgsTagSkuLists struct {
TagId uint
Page bean.Page
}
type TagSkuItem struct {
Id uint `json:"id"`
SkuId uint `json:"skuId"`
SkuName string `json:"skuName"`
}
type ReplyTagSkuLists struct {
Total int64 `json:"total"`
Lists []TagSkuItem `json:"lists"`
}
// SkuLists @Title 标签商品列表
func (s *skuTag) SkuLists(ctx context.Context, args ArgsTagSkuLists) (reply ReplyTagSkuLists, err error) {
xClient, err := client.GetClient(s)
if err != nil {
return
}
err = xClient.Call(ctx, "SkuLists", args, &reply)
return
}

@ -15,4 +15,5 @@ type Supply struct {
Order order
Source sourceRpc
AfterService afterService
SkuTag skuTag
}

Loading…
Cancel
Save