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

finance
黄伟 2 years ago
commit 60e9dafbe3

@ -37,3 +37,18 @@ func (t *task) RefreshToken(ctx context.Context) error {
} }
return xClient.Call(ctx, "RefreshToken", 0, &a) return xClient.Call(ctx, "RefreshToken", 0, &a)
} }
type ReplySkuAddStatus struct {
Total uint
Count uint
}
// GetSkuAddStatus @Title 获取同步状态
func (t *task) GetSkuAddStatus(ctx context.Context) (reply ReplySkuAddStatus, err error) {
xClient, err := client.GetClient(t)
if err != nil {
return
}
err = xClient.Call(ctx, "GetSkuAddStatus", 0, &reply)
return
}

@ -3,34 +3,14 @@ package wholesale
import ( import (
"context" "context"
"git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/lib/bean" "git.oa00.com/supply-chain/service/supply"
) )
type brand struct { type brand struct {
} }
type ArgsBrandList struct {
Search BrandSearch
Page bean.Page
}
type BrandItem struct {
Id uint `json:"id"`
Name string `json:"name"`
CreatedAt int64 `json:"createdAt"`
UpdatedAt int64 `json:"updatedAt"`
}
type ReplyBrandList struct {
Lists []BrandItem `json:"lists"`
Total int64 `json:"total"`
}
type BrandSearch struct {
Name string // 品牌名称
}
// Lists @Title 品牌列表 // Lists @Title 品牌列表
func (b *brand) Lists(ctx context.Context, args ArgsBrandList) (result ReplyBrandList, err error) { func (b *brand) Lists(ctx context.Context, args supply.ArgsBrandList) (result supply.ReplyBrandList, err error) {
xClient, err := client.GetClient(b) xClient, err := client.GetClient(b)
if err != nil { if err != nil {
return return
@ -40,7 +20,7 @@ func (b *brand) Lists(ctx context.Context, args ArgsBrandList) (result ReplyBran
} }
// All @Title 全部品牌 // All @Title 全部品牌
func (b *brand) All(ctx context.Context) (result []BrandItem, err error) { func (b *brand) All(ctx context.Context) (result []supply.BrandItem, err error) {
xClient, err := client.GetClient(b) xClient, err := client.GetClient(b)
if err != nil { if err != nil {
return return
@ -50,7 +30,7 @@ func (b *brand) All(ctx context.Context) (result []BrandItem, err error) {
} }
// FindByNameAll @Title 品牌名称筛选品牌 // FindByNameAll @Title 品牌名称筛选品牌
func (b *brand) FindByNameAll(ctx context.Context, name string) (result []BrandItem, err error) { func (b *brand) FindByNameAll(ctx context.Context, name string) (result []supply.BrandItem, err error) {
xClient, err := client.GetClient(b) xClient, err := client.GetClient(b)
if err != nil { if err != nil {
return return
@ -59,12 +39,8 @@ func (b *brand) FindByNameAll(ctx context.Context, name string) (result []BrandI
return return
} }
type ArgsBrandAdd struct {
Name string // 品牌名称
}
// Add @Title 添加品牌 // Add @Title 添加品牌
func (b *brand) Add(ctx context.Context, args ArgsBrandAdd) (err error) { func (b *brand) Add(ctx context.Context, args supply.ArgsBrandAdd) (err error) {
reply := 0 reply := 0
xClient, err := client.GetClient(b) xClient, err := client.GetClient(b)
if err != nil { if err != nil {
@ -73,13 +49,8 @@ func (b *brand) Add(ctx context.Context, args ArgsBrandAdd) (err error) {
return xClient.Call(ctx, "Add", args, &reply) return xClient.Call(ctx, "Add", args, &reply)
} }
type ArgsBrandEdit struct {
BrandId uint // 品牌id
Name string // 品牌名称
}
// Edit @Title 编辑品牌 // Edit @Title 编辑品牌
func (b *brand) Edit(ctx context.Context, args ArgsBrandEdit) (err error) { func (b *brand) Edit(ctx context.Context, args supply.ArgsBrandEdit) (err error) {
reply := 0 reply := 0
xClient, err := client.GetClient(b) xClient, err := client.GetClient(b)
if err != nil { if err != nil {
@ -88,12 +59,8 @@ func (b *brand) Edit(ctx context.Context, args ArgsBrandEdit) (err error) {
return xClient.Call(ctx, "Edit", args, &reply) return xClient.Call(ctx, "Edit", args, &reply)
} }
type ArgsBrandFindByIds struct {
BrandIds []uint // 品牌id数组
}
// FindByIds @Title 品牌获取 // FindByIds @Title 品牌获取
func (b *brand) FindByIds(ctx context.Context, args ArgsBrandFindByIds) (result []BrandItem, err error) { func (b *brand) FindByIds(ctx context.Context, args supply.ArgsBrandFindByIds) (result []supply.BrandItem, err error) {
xClient, err := client.GetClient(b) xClient, err := client.GetClient(b)
if err != nil { if err != nil {
return return

@ -3,20 +3,14 @@ package wholesale
import ( import (
"context" "context"
"git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/client"
"git.oa00.com/supply-chain/service/supply"
) )
type category struct { type category struct {
} }
type CategoryItem struct {
Id uint `json:"id"`
Name string `json:"name"`
ParentId uint `json:"parentId"`
Children []CategoryItem `json:"children"`
}
// All @Title 获取分类 // All @Title 获取分类
func (c *category) All(ctx context.Context) (result []CategoryItem, err error) { func (c *category) All(ctx context.Context) (result []supply.CategoryItem, err error) {
xClient, err := client.GetClient(c) xClient, err := client.GetClient(c)
if err != nil { if err != nil {
return return
@ -25,13 +19,8 @@ func (c *category) All(ctx context.Context) (result []CategoryItem, err error) {
return return
} }
type ArgsCategoryAdd struct {
Name string // 分类名称
ParentId uint // 上级id
}
// Add @Title 添加分类 // Add @Title 添加分类
func (c *category) Add(ctx context.Context, args ArgsCategoryAdd) (err error) { func (c *category) Add(ctx context.Context, args supply.ArgsCategoryAdd) (err error) {
reply := 0 reply := 0
xClient, err := client.GetClient(c) xClient, err := client.GetClient(c)
if err != nil { if err != nil {
@ -40,14 +29,8 @@ func (c *category) Add(ctx context.Context, args ArgsCategoryAdd) (err error) {
return xClient.Call(ctx, "Add", args, &reply) return xClient.Call(ctx, "Add", args, &reply)
} }
type ArgsCategoryEdit struct {
CategoryId uint // 分类id
Name string // 分类名称
ParentId uint // 上级id
}
// Edit @Title 编辑分类 // Edit @Title 编辑分类
func (c *category) Edit(ctx context.Context, args ArgsCategoryEdit) (err error) { func (c *category) Edit(ctx context.Context, args supply.ArgsCategoryEdit) (err error) {
reply := 0 reply := 0
xClient, err := client.GetClient(c) xClient, err := client.GetClient(c)
if err != nil { if err != nil {
@ -56,18 +39,8 @@ func (c *category) Edit(ctx context.Context, args ArgsCategoryEdit) (err error)
return xClient.Call(ctx, "Edit", args, &reply) return xClient.Call(ctx, "Edit", args, &reply)
} }
type ArgsCategoryFindByIds struct {
ThirdCategoryIds []uint // 三级分类id数组
}
type ThirdCategoryItem struct {
Id uint `json:"id"`
Name string `json:"name"`
ParentId uint `json:"parentId"`
Parent *ThirdCategoryItem `json:"parent"`
}
// FindByIds @Title 三级分类获取 // FindByIds @Title 三级分类获取
func (c *category) FindByIds(ctx context.Context, args ArgsCategoryFindByIds) (result []ThirdCategoryItem, err error) { func (c *category) FindByIds(ctx context.Context, args supply.ArgsCategoryFindByIds) (result []supply.ThirdCategoryItem, err error) {
xClient, err := client.GetClient(c) xClient, err := client.GetClient(c)
if err != nil { if err != nil {
return return

Loading…
Cancel
Save