183 lines
8.5 KiB
Go
183 lines
8.5 KiB
Go
package request
|
|
|
|
// ProductRequest 创建商品请求
|
|
type ProductRequest struct {
|
|
ID int64 `form:"id"` // 商品ID
|
|
CategoryID int64 `form:"category_id"` // 分类ID
|
|
StandardProductID int64 `form:"standard_product_id"` // 标准商品ID
|
|
Name string `form:"name" binding:"required"` // 商品名称
|
|
Appearance int64 `form:"appearance" binding:"required"` // 商品外观
|
|
Barcode string `form:"barcode" binding:"required"` // 商品条码
|
|
Price int64 `form:"price"` // 商品价格
|
|
LiveImage []string `form:"live_image[]"` // 商品图片
|
|
IsBatchManaged int8 `form:"is_batch_managed"` // 批次管理
|
|
IsShelfLifeManaged int8 `form:"is_shelf_life_managed"` // 保质期管理
|
|
Status int8 `form:"status"` // 商品状态
|
|
}
|
|
|
|
// GetProductListRequest 获取商品列表请求
|
|
type GetProductListRequest struct {
|
|
Page int `form:"page"`
|
|
PageSize int `form:"page_size"`
|
|
Keyword string `form:"keyword"`
|
|
Name string `form:"name"`
|
|
Barcode string `form:"barcode"`
|
|
Status string `form:"status"`
|
|
IDs []int64 `form:"ids[]"`
|
|
StartCreatedAt int64 `form:"start_created_at"`
|
|
EndCreatedAt int64 `form:"end_created_at"`
|
|
MinSalePrice int64 `form:"min_sale_price"`
|
|
MaxSalePrice int64 `form:"max_sale_price"`
|
|
MinStock int64 `form:"min_stock"`
|
|
MaxStock int64 `form:"max_stock"`
|
|
WarehouseID int64 `form:"warehouse_id"`
|
|
LocationID int64 `form:"location_id"`
|
|
}
|
|
|
|
// GetDistributionProductListRequest 获取分销商品列表请求
|
|
type GetDistributionProductListRequest struct {
|
|
UserID int64 `form:"user_id" binding:"required"`
|
|
Page int `form:"page"`
|
|
PageSize int `form:"page_size"`
|
|
Keyword string `form:"keyword"`
|
|
Name string `form:"name"`
|
|
Barcode string `form:"barcode"`
|
|
StartCreatedAt int64 `form:"start_created_at"`
|
|
EndCreatedAt int64 `form:"end_created_at"`
|
|
MinSalePrice int64 `form:"min_sale_price"`
|
|
MaxSalePrice int64 `form:"max_sale_price"`
|
|
MinStock int64 `form:"min_stock"`
|
|
MaxStock int64 `form:"max_stock"`
|
|
StockOperator string `form:"stock_operator"` // 库存运算符: ">", "<", "=", ">=", "<="
|
|
StockValue int64 `form:"stock_value"` // 库存数值
|
|
SalePriceOperator string `form:"saleprice_operator"` // 售价运算符: ">", "<", "=", ">=", "<="
|
|
SalePriceValue int64 `form:"saleprice_value"` // 售价数值
|
|
WarehouseID int64 `form:"warehouse_id"`
|
|
LocationID int64 `form:"location_id"`
|
|
Appearance int64 `form:"appearance"`
|
|
StartStockAt int64 `form:"start_stock_at"`
|
|
EndStockAt int64 `form:"end_stock_at"`
|
|
}
|
|
|
|
// UpdatePriceRequest 修改售价请求
|
|
type UpdatePriceRequest struct {
|
|
ProductID int64 `form:"product_id" binding:"required"` // 商品ID
|
|
UserID int64 `form:"user_id" binding:"required"` // 关联ID
|
|
SalePrice int64 `form:"sale_price" binding:"required"` // 售价
|
|
Cost int64 `form:"cost"` // 运费
|
|
}
|
|
|
|
// RetryOutTaskRequest 重试外部任务请求
|
|
type RetryOutTaskRequest struct {
|
|
ShopID int64 `form:"shop_id" binding:"required"` // 店铺ID
|
|
ShopType int8 `form:"shop_type" binding:"required"` // 店铺类型
|
|
ProductID int64 `form:"product_id" binding:"required"` // 商品ID
|
|
}
|
|
|
|
// BatchPushProductRequest 批量推送商品到店铺请求
|
|
type BatchPushProductRequest struct {
|
|
UserID int64 `form:"user_id" json:"user_id" binding:"required"` // 用户ID(租户)
|
|
ShopIDs []int64 `form:"shop_ids" json:"shop_ids" binding:"required"` // 商家ID数组
|
|
ShopTypes []int8 `form:"shop_types" json:"shop_types" binding:"required"` // 商家类型数组(与shop_ids一一对应)
|
|
ProductIDs []int64 `form:"product_ids" json:"product_ids" binding:"required"` // 商品ID数组
|
|
}
|
|
|
|
// ExportProductRequest 导出商品请求
|
|
type ExportProductRequest struct {
|
|
StartCreatedAt int64 `form:"start_created_at"` // 创建时间开始
|
|
EndCreatedAt int64 `form:"end_created_at"` // 创建时间结束
|
|
MinSalePrice int64 `form:"min_sale_price"` // 售价最小值
|
|
MaxSalePrice int64 `form:"max_sale_price"` // 售价最大值
|
|
MinStock int64 `form:"min_stock"` // 库存最小值
|
|
MaxStock int64 `form:"max_stock"` // 库存最大值
|
|
WarehouseID int64 `form:"warehouse_id"` // 仓库ID
|
|
Type int8 `form:"type" binding:"oneof=0 1"` // 0: 仓库商品, 1: 标准商品
|
|
}
|
|
|
|
// DeleteProductRequest 删除商品请求
|
|
type DeleteProductRequest struct {
|
|
ID int64 `form:"id" binding:"required"` // 商品ID
|
|
}
|
|
|
|
type ProductLogRequest struct {
|
|
ID int64 `form:"id"`
|
|
Barcode string `form:"barcode"`
|
|
OldName string `form:"old_name"`
|
|
NewName string `form:"new_name"`
|
|
OldPublisher string `form:"old_publisher"`
|
|
NewPublisher string `form:"new_publisher"`
|
|
OldAuthor string `form:"old_author"`
|
|
NewAuthor string `form:"new_author"`
|
|
OldPublicationTime int64 `form:"old_publication_time"`
|
|
NewPublicationTime int64 `form:"new_publication_time"`
|
|
OldPrice int64 `form:"old_price"`
|
|
NewPrice int64 `form:"new_price"`
|
|
OldBindingLayout string `form:"old_binding_layout"`
|
|
NewBindingLayout string `form:"new_binding_layout"`
|
|
OldPageCount int64 `form:"old_page_count"`
|
|
NewPageCount int64 `form:"new_page_count"`
|
|
OldWordCount int64 `form:"old_word_count"`
|
|
NewWordCount int64 `form:"new_word_count"`
|
|
OldLiveImage []string `form:"old_live_image[]"`
|
|
NewLiveImage []string `form:"new_live_image[]"`
|
|
OldIsSuit int8 `form:"old_is_suit"`
|
|
NewIsSuit int8 `form:"new_is_suit"`
|
|
}
|
|
|
|
type GetProductLogListRequest struct {
|
|
Page int `form:"page"`
|
|
PageSize int `form:"page_size"`
|
|
Barcode string `form:"barcode"`
|
|
Status *int8 `form:"status"`
|
|
}
|
|
|
|
type AuditProductLogRequest struct {
|
|
ID int64 `form:"id" binding:"required"`
|
|
Status int8 `form:"status" binding:"required,oneof=1 2"`
|
|
NewName string `form:"new_name"`
|
|
NewPublisher string `form:"new_publisher"`
|
|
NewAuthor string `form:"new_author"`
|
|
NewPublicationTime int64 `form:"new_publication_time"`
|
|
NewPrice int64 `form:"new_price"`
|
|
NewBindingLayout string `form:"new_binding_layout"`
|
|
NewPageCount int64 `form:"new_page_count"`
|
|
NewWordCount int64 `form:"new_word_count"`
|
|
NewLiveImage []string `form:"new_live_image[]"`
|
|
NewIsSuit int8 `form:"new_is_suit"`
|
|
}
|
|
|
|
type DeleteProductLogRequest struct {
|
|
ID int64 `form:"id" binding:"required"`
|
|
}
|
|
|
|
// GetProductInventoryRequest 获取商品库存请求
|
|
type GetProductInventoryRequest struct {
|
|
UserID int64 `form:"user_id" binding:"required"` // 用户ID
|
|
ProductID int64 `form:"product_id" binding:"required"` // 商品ID
|
|
Type int8 `form:"type"` // 类型: 0=原始数据, 1=按商品名称+ISBN+仓库聚合
|
|
}
|
|
|
|
type GetShopProductDetailRequest struct {
|
|
ShopID int64 `form:"shop_id" binding:"required"`
|
|
Status int8 `form:"status"`
|
|
Page int `form:"page"`
|
|
PageSize int `form:"page_size"`
|
|
}
|
|
|
|
type GetProductDetailRequest struct {
|
|
ID int64 `form:"id" binding:"required"`
|
|
}
|
|
|
|
// PushProductToShopRequest 上架到商铺请求
|
|
type PushProductToShopRequest struct {
|
|
UserID int64 `form:"user_id" json:"user_id" binding:"required"` // 用户ID(租户)
|
|
WarehouseID int64 `form:"warehouse_id" json:"warehouse_id" binding:"required"` // 仓库ID
|
|
LocationID int64 `form:"location_id" json:"location_id" binding:"required"` // 货位ID
|
|
ISBN string `form:"isbn" json:"isbn" binding:"required"` // ISBN
|
|
ProductName string `form:"product_name" json:"product_name"` // 图书名称
|
|
Price int64 `form:"price" json:"price" binding:"required"` // 价格(分)
|
|
Stock int64 `form:"stock" json:"stock" binding:"required"` // 存量
|
|
Photos []string `form:"photos" json:"photos"` // 照片数组
|
|
Appearance int64 `form:"appearance" json:"appearance" binding:"required"` // 品相
|
|
}
|