Dockerfile
This commit is contained in:
149
model/dto/asset/asset_dto.go
Normal file
149
model/dto/asset/asset_dto.go
Normal file
@@ -0,0 +1,149 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
consts "assets/consts/asset"
|
||||
"assets/consts/stock"
|
||||
"assets/model/config"
|
||||
enumDto "assets/model/dto/enum"
|
||||
entity "assets/model/entity/asset"
|
||||
"time"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// CreateAssetReq 创建资产请求
|
||||
type CreateAssetReq struct {
|
||||
g.Meta `path:"/createAsset" method:"post" tags:"资产管理" summary:"创建资产" dc:"创建新的资产"`
|
||||
// 基础信息
|
||||
Name string `json:"name" v:"required" dc:"资产名称"`
|
||||
Description string `json:"description" dc:"资产描述"`
|
||||
Type consts.AssetType `json:"type" v:"required" dc:"资产类型:physical实物/virtual虚拟/service服务"`
|
||||
CategoryId uint64 `json:"categoryId" v:"required" dc:"分类ID"`
|
||||
CategoryPath string `json:"categoryPath" dc:"分类路径"`
|
||||
ImageURL string `json:"imageUrl" dc:"主图URL"`
|
||||
Images []string `json:"images" dc:"图片列表"`
|
||||
Status *consts.AssetStatus `json:"status" dc:"状态:1/0" d:"1"`
|
||||
UnlimitedStock bool `json:"unlimitedStock" dc:"是否无库存限制"`
|
||||
StockMode stock.StockMode `json:"stockMode" dc:"库存管理模式:1-明细模式 2-批次模式" d:"2"`
|
||||
// 上线和下线时间配置(由定时任务处理资产状态)
|
||||
OnlineTime *time.Time `json:"onlineTime,omitempty" dc:"上线时间(格式:2006-01-02 15:04:05)"`
|
||||
OfflineTime *time.Time `json:"offlineTime,omitempty" dc:"下线时间(格式:2006-01-02 15:04:05)"`
|
||||
// 类型专用配置 - 实物资产配置
|
||||
PhysicalAssetConfig *config.PhysicalAssetConfig `json:"physicalAssetConfig"`
|
||||
// 类型专用配置 - 服务资产配置
|
||||
ServiceAssetConfig *config.ServiceAssetConfig `json:"serviceAssetConfig"`
|
||||
// 类型专用配置 - 虚拟资产配置
|
||||
VirtualAssetConfig *config.VirtualAssetConfig `json:"virtualAssetConfig"`
|
||||
// 扩展字段
|
||||
Metadata []map[string]interface{} `json:"metadata" dc:"动态元数据"`
|
||||
|
||||
TenantModuleType beans.TenantModuleType `json:"tenantModuleType" dc:"租户模块类型"`
|
||||
}
|
||||
|
||||
// CreateAssetRes 创建资产响应
|
||||
type CreateAssetRes struct {
|
||||
Id uint64 `json:"id" dc:"资产ID"`
|
||||
}
|
||||
|
||||
// ListAssetReq 获取资产列表请求
|
||||
type ListAssetReq struct {
|
||||
g.Meta `path:"/listAssets" method:"get" tags:"资产管理" summary:"获取资产列表" dc:"分页查询资产列表,支持多条件筛选"`
|
||||
*beans.Page
|
||||
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序规则"`
|
||||
Name string `json:"name" dc:"资产名称"`
|
||||
Type consts.AssetType `json:"type" dc:"资产类型"`
|
||||
CategoryId string `json:"categoryId" dc:"分类ID"`
|
||||
CategoryPath string `json:"categoryPath" dc:"分类路径"`
|
||||
Status *consts.AssetStatus `json:"status" dc:"状态"`
|
||||
Keyword string `json:"keyword" dc:"关键词搜索"`
|
||||
}
|
||||
|
||||
// ListAssetRes 获取资产列表响应
|
||||
type ListAssetRes struct {
|
||||
List []AssetListItem `json:"list" dc:"资产列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type AssetListItem struct {
|
||||
// 基础信息
|
||||
Id uint64 `json:"id"` // 资产ID
|
||||
Name string `json:"name"` // 资产名称
|
||||
Type consts.AssetType `json:"type"` // 资产类型:physical实物/virtual虚拟/service服务
|
||||
TypeName string `json:"typeName"` // 资产类型:physical实物/virtual虚拟/service服务
|
||||
CategoryId uint64 `json:"categoryId"` // 分类ID
|
||||
UnlimitedStock bool `json:"unlimitedStock"` // 是否无库存限制
|
||||
Status *consts.AssetStatus `json:"status"` // 资产状态:active启用/inactive停用
|
||||
BasePrice int `json:"basePrice"` // 基础价格(分为单位)
|
||||
OnlineTime *gtime.Time `json:"onlineTime,omitempty"` // 上线时间
|
||||
OfflineTime *gtime.Time `json:"offlineTime,omitempty"` // 下线时间
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
|
||||
// GetAssetReq 获取资产详情请求
|
||||
type GetAssetReq struct {
|
||||
g.Meta `path:"/getAsset" method:"get" tags:"资产管理" summary:"获取资产详情" dc:"获取资产详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"资产ID"`
|
||||
}
|
||||
|
||||
// GetAssetRes 获取资产详情响应
|
||||
type GetAssetRes struct {
|
||||
*entity.Asset
|
||||
CategoryName string `json:"categoryName" dc:"分类名称"`
|
||||
ImgAddressPrefix string `json:"imgAddressPrefix"`
|
||||
}
|
||||
|
||||
// GetAssetAndSkuReq 获取资产和Sku详情请求
|
||||
type GetAssetAndSkuReq struct {
|
||||
g.Meta `path:"/getAssetAndSku" method:"get" tags:"资产管理" summary:"获取资产和SKU详情" dc:"获取资产和SKU详情"`
|
||||
AssetId *bson.ObjectID `json:"assetId" v:"required" dc:"资产ID"`
|
||||
}
|
||||
|
||||
// GetAssetAndSkuRes 获取资产详情响应
|
||||
type GetAssetAndSkuRes struct {
|
||||
*entity.Asset
|
||||
Skus []entity.AssetSku `json:"skus" dc:"SKU列表"`
|
||||
TenantModuleType []enumDto.KeyValue `json:"tenantModuleType" dc:"租户模块类型"`
|
||||
ImgAddressPrefix string `json:"imgAddressPrefix"`
|
||||
}
|
||||
|
||||
// UpdateAssetReq 更新资产请求
|
||||
type UpdateAssetReq struct {
|
||||
g.Meta `path:"/updateAsset" method:"put" tags:"资产管理" summary:"更新资产" dc:"更新资产信息"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"资产ID"`
|
||||
// 基础信息
|
||||
Name string `json:"name" dc:"资产名称"`
|
||||
Description string `json:"description" dc:"资产描述"`
|
||||
Type consts.AssetType `json:"type" dc:"资产类型:physical实物/virtual虚拟/service服务"`
|
||||
CategoryId *bson.ObjectID `json:"categoryId" dc:"分类ID"`
|
||||
ImageURL string `json:"imageUrl" dc:"主图URL"`
|
||||
Images []string `json:"images" dc:"图片列表"`
|
||||
Status *consts.AssetStatus `json:"status,omitempty" dc:"状态:1/0"`
|
||||
// 上线和下线时间配置(由定时任务处理资产状态)
|
||||
OnlineTime *time.Time `json:"onlineTime,omitempty" dc:"上线时间(格式:2006-01-02 15:04:05)"`
|
||||
OfflineTime *time.Time `json:"offlineTime,omitempty" dc:"下线时间(格式:2006-01-02 15:04:05)"`
|
||||
// 类型专用配置 - 实物资产配置
|
||||
PhysicalAssetConfig *config.PhysicalAssetConfig `json:"physicalAssetConfig"`
|
||||
// 类型专用配置 - 服务资产配置
|
||||
ServiceAssetConfig *config.ServiceAssetConfig `json:"serviceAssetConfig"`
|
||||
// 类型专用配置 - 虚拟资产配置
|
||||
VirtualAssetConfig *config.VirtualAssetConfig `json:"virtualAssetConfig"`
|
||||
// 扩展字段
|
||||
Metadata []map[string]interface{} `json:"metadata" dc:"动态元数据"`
|
||||
}
|
||||
|
||||
// UpdateAssetStatusReq 更新资产状态请求
|
||||
type UpdateAssetStatusReq struct {
|
||||
g.Meta `path:"/updateAssetStatus" method:"put" tags:"资产管理" summary:"更新资产状态" dc:"更新资产状态"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"资产ID"`
|
||||
Status *consts.AssetStatus `json:"status" v:"required|in:1,0" dc:"状态:1启用/0停用"`
|
||||
}
|
||||
|
||||
// DeleteAssetReq 删除资产请求
|
||||
type DeleteAssetReq struct {
|
||||
g.Meta `path:"/deleteAsset" method:"delete" tags:"资产管理" summary:"删除资产" dc:"删除资产"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"资产ID"`
|
||||
}
|
||||
122
model/dto/asset/asset_sku_dto.go
Normal file
122
model/dto/asset/asset_sku_dto.go
Normal file
@@ -0,0 +1,122 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
consts "assets/consts/asset"
|
||||
"assets/consts/stock"
|
||||
entity "assets/model/entity/asset"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// CreateAssetSkuReq 创建SKU请求
|
||||
type CreateAssetSkuReq struct {
|
||||
g.Meta `path:"/createAssetSku" method:"post" tags:"SKU管理" summary:"创建SKU" dc:"创建新的资产SKU"`
|
||||
|
||||
AssetId *bson.ObjectID `json:"assetId" v:"required" dc:"关联资产ID"`
|
||||
AssetName string `json:"assetName" v:"required" dc:"关联资产名称"`
|
||||
SkuName string `json:"skuName" v:"required" dc:"SKU名称"`
|
||||
SpecsCount int `json:"specsCount" v:"required|min:1" dc:"规格数量"`
|
||||
SpecsUnit *entity.SpecsUnitKeyValue `json:"specsUnit" v:"required" dc:"规格单位"`
|
||||
SpecValues []map[string]interface{} `json:"specValues" dc:"规格值"`
|
||||
ImageURL string `json:"imageUrl" v:"required" dc:"SKU主图"`
|
||||
Price int `json:"price" v:"required|min:0" dc:"价格(分为单位)"`
|
||||
Sort int `json:"sort" v:"required|min:0" dc:"排序"`
|
||||
Status *consts.AssetSkuStatus `json:"status" v:"required|in:1,0" dc:"状态"`
|
||||
UnlimitedStock bool `json:"unlimitedStock" v:"required" dc:"是否无库存限制"`
|
||||
StockMode stock.StockMode `json:"stockMode" dc:"库存管理模式:1-明细模式 2-批次模式"`
|
||||
CategoryId *bson.ObjectID `json:"categoryId" dc:"分类ID"`
|
||||
CategoryPath string `json:"categoryPath" dc:"分类路径"`
|
||||
TenantModuleType beans.TenantModuleType `json:"tenantModuleType" dc:"租户模块类型"`
|
||||
}
|
||||
|
||||
// CreateAssetSkuRes 创建SKU响应
|
||||
type CreateAssetSkuRes struct {
|
||||
Id *bson.ObjectID `json:"id" dc:"SKU ID"`
|
||||
}
|
||||
|
||||
// UpdateAssetSkuReq 更新SKU请求
|
||||
type UpdateAssetSkuReq struct {
|
||||
g.Meta `path:"/updateAssetSku" method:"put" tags:"SKU管理" summary:"更新SKU" dc:"更新SKU信息"`
|
||||
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
SkuName string `json:"skuName" dc:"SKU名称"`
|
||||
SpecsCount int `json:"specsCount" dc:"规格数量"`
|
||||
SpecsUnit *entity.SpecsUnitKeyValue `json:"specsUnit" dc:"规格单位"`
|
||||
SpecValues []map[string]interface{} `json:"specValues" dc:"规格值"`
|
||||
ImageURL string `json:"imageUrl" dc:"SKU主图"`
|
||||
Price int `json:"price" dc:"价格(分为单位)"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Stock int `json:"stock" dc:"库存数量"`
|
||||
Status *consts.AssetSkuStatus `json:"status" dc:"状态"`
|
||||
}
|
||||
|
||||
// DeleteAssetSkuReq 删除SKU请求
|
||||
type DeleteAssetSkuReq struct {
|
||||
g.Meta `path:"/deleteAssetSku" method:"delete" tags:"SKU管理" summary:"删除SKU" dc:"删除SKU"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
}
|
||||
|
||||
// GetAssetSkuModuleReq 获取SKU详情请求
|
||||
type GetAssetSkuModuleReq struct {
|
||||
g.Meta `path:"/getAssetSkuModule" method:"get" tags:"SKU管理" summary:"获取SKU模块详情" dc:"获取SKU模块详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
}
|
||||
|
||||
// GetAssetSkuModuleRes 获取SKU详情响应
|
||||
type GetAssetSkuModuleRes struct {
|
||||
AssetId *bson.ObjectID `json:"assetId"`
|
||||
ExpireAt *gtime.Time `json:"expireAt"`
|
||||
}
|
||||
|
||||
// GetAssetSkuReq 获取SKU详情请求
|
||||
type GetAssetSkuReq struct {
|
||||
g.Meta `path:"/getAssetSku" method:"get" tags:"SKU管理" summary:"获取SKU详情" dc:"获取SKU详情"`
|
||||
Id *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
}
|
||||
|
||||
// GetAssetSkuRes 获取SKU详情响应
|
||||
type GetAssetSkuRes struct {
|
||||
*entity.AssetSku
|
||||
ImgAddressPrefix string `json:"imgAddressPrefix"`
|
||||
}
|
||||
|
||||
// ListAssetSkuReq 获取SKU列表请求
|
||||
type ListAssetSkuReq struct {
|
||||
g.Meta `path:"/listAssetSkus" method:"get" tags:"SKU管理" summary:"获取SKU列表" dc:"分页查询SKU列表,支持多条件筛选"`
|
||||
*beans.Page
|
||||
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序规则"`
|
||||
Id *bson.ObjectID `json:"id" dc:"SKU ID"`
|
||||
AssetId *bson.ObjectID `json:"assetId" v:"required" dc:"资产ID"`
|
||||
Status *consts.AssetSkuStatus `json:"status" dc:"状态"`
|
||||
Keyword string `json:"keyword" dc:"关键词搜索"`
|
||||
MinPrice int `json:"minPrice" dc:"最低价格"`
|
||||
MaxPrice int `json:"maxPrice" dc:"最高价格"`
|
||||
CategoryPath string `json:"categoryPath" dc:"分类路径"`
|
||||
}
|
||||
|
||||
// ListAssetSkuRes 获取SKU列表响应
|
||||
type ListAssetSkuRes struct {
|
||||
List []*AssetSkuListResItem `json:"list" dc:"SKU列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type AssetSkuListResItem struct {
|
||||
Id *bson.ObjectID `json:"id"` // SKU ID
|
||||
AssetId *bson.ObjectID `json:"assetId"`
|
||||
AssetName string `json:"assetName"` // 资产名称
|
||||
SkuName string `json:"skuName"` // SKU名称
|
||||
SpecsCount int `json:"specsCount"` // 规格数量
|
||||
SpecsUnit *entity.SpecsUnitKeyValue `json:"specsUnit"` // 规格单位
|
||||
SpecValues []map[string]interface{} `json:"specValues"` // 规格值:{"颜色":"红色","尺寸":"L","时长":"1个月","平台":"抖音"}
|
||||
Price int `json:"price"` // 价格(分为单位)
|
||||
UnlimitedStock bool `json:"unlimitedStock"` // 是否无库存限制
|
||||
Stock int `json:"stock"` // 库存数量
|
||||
Sort int `json:"sort"` // 排序
|
||||
Status *consts.AssetSkuStatus `json:"status"` // 状态:active/inactive/disabled
|
||||
StockMode stock.StockMode `json:"stockMode"` // 库存管理模式:1-明细模式 2-批次模式
|
||||
CreatedAt *gtime.Time `json:"createdAt"` // 创建时间
|
||||
UpdatedAt *gtime.Time `json:"updatedAt"` // 更新时间
|
||||
}
|
||||
124
model/dto/asset/category_dto.go
Normal file
124
model/dto/asset/category_dto.go
Normal file
@@ -0,0 +1,124 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
consts "assets/consts/category"
|
||||
entity "assets/model/entity/asset"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// CreateCategoryReq 创建分类请求
|
||||
type CreateCategoryReq struct {
|
||||
g.Meta `path:"/createCategory" method:"post" tags:"分类管理" summary:"创建分类" dc:"创建新的分类"`
|
||||
Name string `json:"name" v:"required" dc:"分类名称"`
|
||||
ParentId string `json:"parentId" dc:"父分类ID"`
|
||||
Image string `json:"image" dc:"分类图片"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Path string `json:"path" dc:"分类路径"`
|
||||
Level int `json:"level" dc:"分类层级"`
|
||||
Status consts.CategoryStatusType `json:"status" v:"in:1,0" default:"1" dc:"状态:1启用0禁用"`
|
||||
Attrs []entity.CategoryAttr `json:"attrs" dc:"分类属性"`
|
||||
}
|
||||
|
||||
// CreateCategoryRes 创建分类响应
|
||||
type CreateCategoryRes struct {
|
||||
Bid string `json:"bid" dc:"分类ID"`
|
||||
}
|
||||
|
||||
// UpdateCategoryReq 更新分类请求
|
||||
type UpdateCategoryReq struct {
|
||||
g.Meta `path:"/updateCategory" method:"put" tags:"分类管理" summary:"更新分类" dc:"更新分类信息"`
|
||||
Id uint64 `json:"id" v:"required-without:Bid|integer#Id不能为空|Id必须是整数" dc:"分类ID"`
|
||||
Bid string `json:"bid" v:"required-without:Id|string#Bid不能为空|Bid必须是字符串" dc:"分类ID"`
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
ParentId string `json:"parentId" dc:"父分类ID"`
|
||||
Image string `json:"image" dc:"分类图片"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
IsLeafNode bool `json:"isLeafNode" dc:"是否叶子节点"`
|
||||
Attrs []entity.CategoryAttr `json:"attrs" dc:"分类属性"`
|
||||
Status consts.CategoryStatusType `json:"status" dc:"状态:1启用0禁用"`
|
||||
}
|
||||
|
||||
// UpdateCategoryStatusReq 更新分类状态请求
|
||||
type UpdateCategoryStatusReq struct {
|
||||
g.Meta `path:"/updateCategoryStatus" method:"put" tags:"分类管理" summary:"更新分类状态" dc:"更新分类状态"`
|
||||
Id string `json:"id" v:"required" dc:"分类ID"`
|
||||
Status consts.CategoryStatusType `json:"status" v:"in:1,0" dc:"状态:1启用0禁用"`
|
||||
}
|
||||
|
||||
// DeleteCategoryReq 删除分类请求
|
||||
type DeleteCategoryReq struct {
|
||||
g.Meta `path:"/deleteCategory" method:"delete" tags:"分类管理" summary:"删除分类" dc:"删除分类"`
|
||||
Bid string `json:"bid" v:"required" dc:"分类ID"`
|
||||
}
|
||||
|
||||
// GetCategoryTreeReq 获取分类树请求
|
||||
type GetCategoryTreeReq struct {
|
||||
g.Meta `path:"/getCategoryTree" method:"get" tags:"分类管理" summary:"获取分类树" dc:"获取分类树"`
|
||||
Name string `json:"name" dc:"名称"`
|
||||
}
|
||||
|
||||
// GetCategoryTreeRes 获取分类树响应
|
||||
type GetCategoryTreeRes struct {
|
||||
Tree []*CategoryTreeNode `json:"tree" dc:"分类树"`
|
||||
}
|
||||
|
||||
// CategoryTreeNode 分类树节点
|
||||
type CategoryTreeNode struct {
|
||||
Id uint64 `json:"id" dc:"分类ID"`
|
||||
Bid string `json:"bid" dc:"分类ID"`
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
Level int `json:"level" dc:"分类层级"`
|
||||
Type string `json:"type" dc:"分类类型"`
|
||||
Path string `json:"path" dc:"分类路径"`
|
||||
IsLeafNode bool `json:"isLeafNode" dc:"是否叶子节点"`
|
||||
Status consts.CategoryStatusType `json:"status" dc:"状态"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
Children []*CategoryTreeNode `json:"children" dc:"子分类"`
|
||||
}
|
||||
|
||||
// ListCategoryReq 获取分类列表请求
|
||||
type ListCategoryReq struct {
|
||||
g.Meta `path:"/listCategories" method:"get" tags:"分类管理" summary:"获取分类列表" dc:"获取分类列表"`
|
||||
*beans.Page
|
||||
OrderBy []beans.OrderBy `json:"orderBy" dc:"排序规则"`
|
||||
ParentId string `json:"parentId" dc:"父分类ID"`
|
||||
Status consts.CategoryStatusType `json:"status" dc:"状态:1启用0禁用"`
|
||||
Keyword string `json:"keyword" dc:"关键词搜索"`
|
||||
}
|
||||
|
||||
// ListCategoryRes 获取分类列表响应
|
||||
type ListCategoryRes struct {
|
||||
List []GetCategoryRes `json:"list" dc:"分类列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// GetCategoryReq 获取分类详情请求
|
||||
type GetCategoryReq struct {
|
||||
g.Meta `path:"/getCategory" method:"get" tags:"分类管理" summary:"获取分类详情" dc:"获取分类详情"`
|
||||
Id uint64 `json:"id" v:"required-without:Bid|integer#Id不能为空|Id必须是整数" dc:"分类ID"`
|
||||
Bid string `json:"bid" v:"required-without:Id|string#Bid不能为空|Bid必须是字符串" dc:"分类ID"`
|
||||
}
|
||||
|
||||
// GetCategoryRes 获取分类详情响应
|
||||
type GetCategoryRes struct {
|
||||
Id uint64 `json:"id" dc:"分类ID"`
|
||||
Bid string `json:"bid" dc:"分类ID"`
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
ParentId string `json:"parentId" dc:"父分类ID"`
|
||||
Path string `json:"path" dc:"分类路径"`
|
||||
Level int `json:"level" dc:"分类层级"`
|
||||
IsLeafNode bool `json:"isLeafNode" dc:"是否叶子节点"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Image string `json:"image" dc:"分类图片"`
|
||||
Attrs []entity.CategoryAttr `json:"attrs" dc:"分类属性"`
|
||||
Status consts.CategoryStatusType `json:"status" dc:"状态:1启用0禁用"`
|
||||
Creator string `json:"creator" dc:"创建人"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
Updater string `json:"updater" dc:"更新人"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
137
model/dto/asset/private_category_dto.go
Normal file
137
model/dto/asset/private_category_dto.go
Normal file
@@ -0,0 +1,137 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// GeneratePrivateCategoryTestDataReq 生成私域分类测试数据请求
|
||||
type GeneratePrivateCategoryTestDataReq struct {
|
||||
g.Meta `path:"/generateTestData" method:"post" tags:"私域分类管理" summary:"生成测试数据" dc:"生成私域分类测试数据"`
|
||||
}
|
||||
|
||||
// CreatePrivateCategoryReq 创建私域分类请求
|
||||
type CreatePrivateCategoryReq struct {
|
||||
g.Meta `path:"/createPrivateCategory" method:"post" tags:"私域分类管理" summary:"创建私域分类" dc:"创建新的私域分类"`
|
||||
|
||||
Name string `json:"name" v:"required" dc:"分类名称"`
|
||||
ParentID *bson.ObjectID `json:"parentId" dc:"父分类ID,为空表示根分类"`
|
||||
Path string `json:"path" dc:"分类路径,如:/root/parent"`
|
||||
Level int `json:"level" dc:"分类层级"`
|
||||
IsLeafNode bool `json:"isLeafNode" dc:"是否叶子节点"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Image string `json:"image" dc:"分类图片"`
|
||||
}
|
||||
|
||||
// CreatePrivateCategoryRes 创建私域分类响应
|
||||
type CreatePrivateCategoryRes struct {
|
||||
ID *bson.ObjectID `json:"id"` // 分类ID
|
||||
}
|
||||
|
||||
// BatchCreatePrivateCategoryReq 批量创建私域分类请求
|
||||
type BatchCreatePrivateCategoryReq struct {
|
||||
g.Meta `path:"/batchCreatePrivateCategory" method:"post" tags:"私域分类管理" summary:"批量创建私域分类" dc:"批量创建私域分类"`
|
||||
|
||||
Categories []CreatePrivateCategoryReq `json:"categories" v:"required" dc:"分类列表"`
|
||||
}
|
||||
|
||||
// BatchCreatePrivateCategoryRes 批量创建私域分类响应
|
||||
type BatchCreatePrivateCategoryRes struct {
|
||||
IDs []*bson.ObjectID `json:"ids"` // 创建的ID列表
|
||||
}
|
||||
|
||||
// UpdatePrivateCategoryReq 更新私域分类请求
|
||||
type UpdatePrivateCategoryReq struct {
|
||||
g.Meta `path:"/updatePrivateCategory" method:"put" tags:"私域分类管理" summary:"更新私域分类" dc:"更新私域分类信息"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"分类ID"`
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
ParentID string `json:"parentId" dc:"父分类ID"`
|
||||
Path string `json:"path" dc:"分类路径"`
|
||||
Level int `json:"level" dc:"分类层级"`
|
||||
IsLeafNode *bool `json:"isLeafNode" dc:"是否叶子节点"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Image string `json:"image" dc:"分类图片"`
|
||||
}
|
||||
|
||||
// DeletePrivateCategoryReq 删除私域分类请求
|
||||
type DeletePrivateCategoryReq struct {
|
||||
g.Meta `path:"/deletePrivateCategory" method:"delete" tags:"私域分类管理" summary:"删除私域分类" dc:"删除私域分类"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"分类ID"`
|
||||
}
|
||||
|
||||
// GetPrivateCategoryReq 获取私域分类详情请求
|
||||
type GetPrivateCategoryReq struct {
|
||||
g.Meta `path:"/getPrivateCategory" method:"get" tags:"私域分类管理" summary:"获取私域分类详情" dc:"获取私域分类详情"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"分类ID"`
|
||||
}
|
||||
|
||||
// GetPrivateCategoryRes 获取私域分类详情响应
|
||||
type GetPrivateCategoryRes struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ParentID string `json:"parentId"`
|
||||
Path string `json:"path"`
|
||||
Level int `json:"level"`
|
||||
IsLeafNode bool `json:"isLeafNode"`
|
||||
Sort int `json:"sort"`
|
||||
Image string `json:"image"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// ListPrivateCategoryReq 获取私域分类列表请求
|
||||
type ListPrivateCategoryReq struct {
|
||||
g.Meta `path:"/listPrivateCategory" method:"get" tags:"私域分类管理" summary:"获取私域分类列表" dc:"分页查询私域分类列表"`
|
||||
|
||||
Name string `json:"name" dc:"分类名称(模糊查询)"`
|
||||
ParentID string `json:"parentId" dc:"父分类ID"`
|
||||
Level int `json:"level" dc:"分类层级"`
|
||||
IsLeafNode *bool `json:"isLeafNode" dc:"是否叶子节点"`
|
||||
PageNum int `json:"pageNum" dc:"页码"`
|
||||
PageSize int `json:"pageSize" dc:"每页大小"`
|
||||
}
|
||||
|
||||
// ListPrivateCategoryRes 获取私域分类列表响应
|
||||
type ListPrivateCategoryRes struct {
|
||||
List []*PrivateCategoryListItem `json:"list" dc:"分类列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// PrivateCategoryListItem 私域分类列表项
|
||||
type PrivateCategoryListItem struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ParentID string `json:"parentId"`
|
||||
Path string `json:"path"`
|
||||
Level int `json:"level"`
|
||||
IsLeafNode bool `json:"isLeafNode"`
|
||||
Sort int `json:"sort"`
|
||||
Image string `json:"image"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetPrivateCategoryTreeReq 获取私域分类树请求
|
||||
type GetPrivateCategoryTreeReq struct {
|
||||
g.Meta `path:"/getPrivateCategoryTree" method:"get" tags:"私域分类管理" summary:"获取私域分类树" dc:"获取私域分类树"`
|
||||
}
|
||||
|
||||
// GetPrivateCategoryTreeRes 获取私域分类树响应
|
||||
type GetPrivateCategoryTreeRes struct {
|
||||
Tree []*PrivateCategoryTreeItem `json:"tree" dc:"分类树"`
|
||||
}
|
||||
|
||||
// PrivateCategoryTreeItem 私域分类树项
|
||||
type PrivateCategoryTreeItem struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ParentID string `json:"parentId"`
|
||||
Path string `json:"path"`
|
||||
Level int `json:"level"`
|
||||
IsLeafNode bool `json:"isLeafNode"`
|
||||
Sort int `json:"sort"`
|
||||
Image string `json:"image"`
|
||||
}
|
||||
124
model/dto/asset/private_sku_dto.go
Normal file
124
model/dto/asset/private_sku_dto.go
Normal file
@@ -0,0 +1,124 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"assets/consts/stock"
|
||||
"assets/model/config"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// GeneratePrivateSkuTestDataReq 生成私域SKU测试数据请求
|
||||
type GeneratePrivateSkuTestDataReq struct {
|
||||
g.Meta `path:"/generateTestData" method:"post" tags:"私域SKU管理" summary:"生成测试数据" dc:"生成私域SKU测试数据"`
|
||||
}
|
||||
|
||||
// CreatePrivateSkuReq 创建私域SKU请求
|
||||
type CreatePrivateSkuReq struct {
|
||||
g.Meta `path:"/createPrivateSku" method:"post" tags:"私域SKU管理" summary:"创建私域SKU" dc:"创建新的私域SKU"`
|
||||
|
||||
SkuName string `json:"skuName" v:"required" dc:"SKU名称"`
|
||||
ImageURL string `json:"imageUrl" dc:"SKU主图"`
|
||||
Price int `json:"price" v:"required|min:0" dc:"价格(分为单位)"`
|
||||
Stock int `json:"stock" v:"min:0" dc:"库存数量"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
CapacityUnitType stock.CapacityUnitType `json:"capacityUnitType" v:"required" dc:"容量单位类型"`
|
||||
Capacity config.Capacity `json:"capacity" v:"required" dc:"容量信息"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath" dc:"私域分类路径"`
|
||||
}
|
||||
|
||||
// CreatePrivateSkuRes 创建私域SKU响应
|
||||
type CreatePrivateSkuRes struct {
|
||||
ID *bson.ObjectID `json:"id"` // SKU ID
|
||||
}
|
||||
|
||||
// BatchCreatePrivateSkuReq 批量创建私域SKU请求
|
||||
type BatchCreatePrivateSkuReq struct {
|
||||
g.Meta `path:"/batchCreatePrivateSku" method:"post" tags:"私域SKU管理" summary:"批量创建私域SKU" dc:"批量创建私域SKU"`
|
||||
|
||||
Skus []CreatePrivateSkuReq `json:"skus" v:"required" dc:"SKU列表"`
|
||||
}
|
||||
|
||||
// BatchCreatePrivateSkuRes 批量创建私域SKU响应
|
||||
type BatchCreatePrivateSkuRes struct {
|
||||
IDs []*bson.ObjectID `json:"ids"` // 创建的ID列表
|
||||
}
|
||||
|
||||
// UpdatePrivateSkuReq 更新私域SKU请求
|
||||
type UpdatePrivateSkuReq struct {
|
||||
g.Meta `path:"/updatePrivateSku" method:"put" tags:"私域SKU管理" summary:"更新私域SKU" dc:"更新私域SKU信息"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
SkuName string `json:"skuName" dc:"SKU名称"`
|
||||
ImageURL string `json:"imageUrl" dc:"SKU主图"`
|
||||
Price int `json:"price" v:"min:0" dc:"价格(分为单位)"`
|
||||
Stock int `json:"stock" v:"min:0" dc:"库存数量"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath" dc:"私域分类路径"`
|
||||
}
|
||||
|
||||
// DeletePrivateSkuReq 删除私域SKU请求
|
||||
type DeletePrivateSkuReq struct {
|
||||
g.Meta `path:"/deletePrivateSku" method:"delete" tags:"私域SKU管理" summary:"删除私域SKU" dc:"删除私域SKU"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
}
|
||||
|
||||
// GetPrivateSkuReq 获取私域SKU详情请求
|
||||
type GetPrivateSkuReq struct {
|
||||
g.Meta `path:"/getPrivateSku" method:"get" tags:"私域SKU管理" summary:"获取私域SKU详情" dc:"获取私域SKU详情"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
}
|
||||
|
||||
// GetPrivateSkuRes 获取私域SKU详情响应
|
||||
type GetPrivateSkuRes struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
SkuName string `json:"skuName"`
|
||||
ImageURL string `json:"imageUrl"`
|
||||
Price int `json:"price"`
|
||||
Stock int `json:"stock"`
|
||||
Sort int `json:"sort"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// ListPrivateSkuReq 获取私域SKU列表请求
|
||||
type ListPrivateSkuReq struct {
|
||||
g.Meta `path:"/listPrivateSku" method:"get" tags:"私域SKU管理" summary:"获取私域SKU列表" dc:"分页查询私域SKU列表"`
|
||||
|
||||
SkuName string `json:"skuName" dc:"SKU名称(模糊查询)"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath" dc:"分类路径"`
|
||||
MinPrice int `json:"minPrice" dc:"最低价格"`
|
||||
MaxPrice int `json:"maxPrice" dc:"最高价格"`
|
||||
PageNum int `json:"pageNum" dc:"页码"`
|
||||
PageSize int `json:"pageSize" dc:"每页大小"`
|
||||
}
|
||||
|
||||
// ListPrivateSkuRes 获取私域SKU列表响应
|
||||
type ListPrivateSkuRes struct {
|
||||
List []*PrivateSkuListItem `json:"list" dc:"SKU列表"`
|
||||
Total int64 `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
// PrivateSkuListItem 私域SKU列表项
|
||||
type PrivateSkuListItem struct {
|
||||
ID *bson.ObjectID `json:"id"`
|
||||
SkuName string `json:"skuName"`
|
||||
ImageURL string `json:"imageUrl"`
|
||||
Price int `json:"price"`
|
||||
Stock int `json:"stock"`
|
||||
Sort int `json:"sort"`
|
||||
PrivateCategoryPath string `json:"privateCategoryPath"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// UpdatePrivateSkuStockReq 更新私域SKU库存请求
|
||||
type UpdatePrivateSkuStockReq struct {
|
||||
g.Meta `path:"/updatePrivateSkuStock" method:"put" tags:"私域SKU管理" summary:"更新私域SKU库存" dc:"更新私域SKU库存"`
|
||||
|
||||
ID *bson.ObjectID `json:"id" v:"required" dc:"SKU ID"`
|
||||
StockChange int `json:"stockChange" v:"required" dc:"库存变化量(正数增加,负数减少)"`
|
||||
}
|
||||
Reference in New Issue
Block a user