2025-07-15 13:21:34 +08:00
|
|
|
package commands
|
|
|
|
|
|
|
|
|
|
// CreateProductCommand 创建产品命令
|
|
|
|
|
type CreateProductCommand struct {
|
2025-07-20 20:53:26 +08:00
|
|
|
Name string `json:"name" binding:"required,min=2,max=100" comment:"产品名称"`
|
|
|
|
|
Code string `json:"code" binding:"required,product_code" comment:"产品编号"`
|
|
|
|
|
Description string `json:"description" binding:"omitempty,max=500" comment:"产品描述"`
|
|
|
|
|
Content string `json:"content" binding:"omitempty,max=5000" comment:"产品内容"`
|
|
|
|
|
CategoryID string `json:"category_id" binding:"required,uuid" comment:"产品分类ID"`
|
|
|
|
|
Price float64 `json:"price" binding:"price,min=0" comment:"产品价格"`
|
2025-07-15 13:21:34 +08:00
|
|
|
IsEnabled bool `json:"is_enabled" comment:"是否启用"`
|
|
|
|
|
IsVisible bool `json:"is_visible" comment:"是否展示"`
|
|
|
|
|
IsPackage bool `json:"is_package" comment:"是否组合包"`
|
2025-07-28 01:46:39 +08:00
|
|
|
|
2025-07-15 13:21:34 +08:00
|
|
|
// SEO信息
|
2025-07-20 20:53:26 +08:00
|
|
|
SEOTitle string `json:"seo_title" binding:"omitempty,max=100" comment:"SEO标题"`
|
|
|
|
|
SEODescription string `json:"seo_description" binding:"omitempty,max=200" comment:"SEO描述"`
|
|
|
|
|
SEOKeywords string `json:"seo_keywords" binding:"omitempty,max=200" comment:"SEO关键词"`
|
2025-07-15 13:21:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdateProductCommand 更新产品命令
|
|
|
|
|
type UpdateProductCommand struct {
|
2025-07-20 20:53:26 +08:00
|
|
|
ID string `json:"-" uri:"id" binding:"required,uuid" comment:"产品ID"`
|
|
|
|
|
Name string `json:"name" binding:"required,min=2,max=100" comment:"产品名称"`
|
|
|
|
|
Code string `json:"code" binding:"required,product_code" comment:"产品编号"`
|
|
|
|
|
Description string `json:"description" binding:"omitempty,max=500" comment:"产品描述"`
|
|
|
|
|
Content string `json:"content" binding:"omitempty,max=5000" comment:"产品内容"`
|
|
|
|
|
CategoryID string `json:"category_id" binding:"required,uuid" comment:"产品分类ID"`
|
|
|
|
|
Price float64 `json:"price" binding:"price,min=0" comment:"产品价格"`
|
|
|
|
|
IsEnabled bool `json:"is_enabled" comment:"是否启用"`
|
|
|
|
|
IsVisible bool `json:"is_visible" comment:"是否展示"`
|
|
|
|
|
IsPackage bool `json:"is_package" comment:"是否组合包"`
|
2025-07-28 01:46:39 +08:00
|
|
|
|
2025-07-15 13:21:34 +08:00
|
|
|
// SEO信息
|
2025-07-20 20:53:26 +08:00
|
|
|
SEOTitle string `json:"seo_title" binding:"omitempty,max=100" comment:"SEO标题"`
|
|
|
|
|
SEODescription string `json:"seo_description" binding:"omitempty,max=200" comment:"SEO描述"`
|
|
|
|
|
SEOKeywords string `json:"seo_keywords" binding:"omitempty,max=200" comment:"SEO关键词"`
|
2025-07-15 13:21:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeleteProductCommand 删除产品命令
|
|
|
|
|
type DeleteProductCommand struct {
|
2025-07-20 20:53:26 +08:00
|
|
|
ID string `json:"-" uri:"id" binding:"required,uuid" comment:"产品ID"`
|
2025-07-28 01:46:39 +08:00
|
|
|
}
|
2025-07-29 00:30:32 +08:00
|
|
|
|
|
|
|
|
// CreateProductApiConfigCommand 创建产品API配置命令
|
|
|
|
|
type CreateProductApiConfigCommand struct {
|
|
|
|
|
ProductID string `json:"product_id" binding:"required,uuid" comment:"产品ID"`
|
|
|
|
|
ApiEndpoint string `json:"api_endpoint" binding:"required,url" comment:"API端点"`
|
|
|
|
|
ApiKey string `json:"api_key" binding:"required" comment:"API密钥"`
|
|
|
|
|
ApiSecret string `json:"api_secret" binding:"required" comment:"API密钥"`
|
|
|
|
|
Config string `json:"config" binding:"omitempty" comment:"配置信息"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UpdateProductApiConfigCommand 更新产品API配置命令
|
|
|
|
|
type UpdateProductApiConfigCommand struct {
|
|
|
|
|
ProductID string `json:"product_id" binding:"required,uuid" comment:"产品ID"`
|
|
|
|
|
ApiEndpoint string `json:"api_endpoint" binding:"required,url" comment:"API端点"`
|
|
|
|
|
ApiKey string `json:"api_key" binding:"required" comment:"API密钥"`
|
|
|
|
|
ApiSecret string `json:"api_secret" binding:"required" comment:"API密钥"`
|
|
|
|
|
Config string `json:"config" binding:"omitempty" comment:"配置信息"`
|
|
|
|
|
}
|