Files
assets/model/dto/asset/private_sku_dto.go
2026-03-18 10:18:03 +08:00

125 lines
5.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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:"库存变化量(正数增加,负数减少)"`
}