This commit is contained in:
2025-07-28 01:46:39 +08:00
parent b03129667a
commit 357639462a
219 changed files with 21634 additions and 8138 deletions

View File

@@ -0,0 +1,43 @@
package responses
import "time"
// ProductApiConfigResponse 产品API配置响应
type ProductApiConfigResponse struct {
ID string `json:"id" comment:"配置ID"`
ProductID string `json:"product_id" comment:"产品ID"`
RequestParams []RequestParamResponse `json:"request_params" comment:"请求参数配置"`
ResponseFields []ResponseFieldResponse `json:"response_fields" comment:"响应字段配置"`
ResponseExample map[string]interface{} `json:"response_example" comment:"响应示例"`
CreatedAt time.Time `json:"created_at" comment:"创建时间"`
UpdatedAt time.Time `json:"updated_at" comment:"更新时间"`
}
// RequestParamResponse 请求参数响应
type RequestParamResponse struct {
Name string `json:"name" comment:"参数名称"`
Field string `json:"field" comment:"参数字段名"`
Type string `json:"type" comment:"参数类型"`
Required bool `json:"required" comment:"是否必填"`
Description string `json:"description" comment:"参数描述"`
Example string `json:"example" comment:"参数示例"`
Validation string `json:"validation" comment:"验证规则"`
}
// ResponseFieldResponse 响应字段响应
type ResponseFieldResponse struct {
Name string `json:"name" comment:"字段名称"`
Path string `json:"path" comment:"字段路径"`
Type string `json:"type" comment:"字段类型"`
Description string `json:"description" comment:"字段描述"`
Required bool `json:"required" comment:"是否必填"`
Example string `json:"example" comment:"字段示例"`
}
// ProductApiConfigListResponse 产品API配置列表响应
type ProductApiConfigListResponse struct {
Total int64 `json:"total" comment:"总数"`
Page int `json:"page" comment:"页码"`
Size int `json:"size" comment:"每页数量"`
Items []ProductApiConfigResponse `json:"items" comment:"配置列表"`
}

View File

@@ -2,6 +2,16 @@ package responses
import "time"
// PackageItemResponse 组合包项目响应
type PackageItemResponse struct {
ID string `json:"id" comment:"项目ID"`
ProductID string `json:"product_id" comment:"子产品ID"`
ProductCode string `json:"product_code" comment:"子产品编号"`
ProductName string `json:"product_name" comment:"子产品名称"`
SortOrder int `json:"sort_order" comment:"排序"`
Price float64 `json:"price" comment:"子产品价格"`
}
// ProductInfoResponse 产品详情响应
type ProductInfoResponse struct {
ID string `json:"id" comment:"产品ID"`
@@ -23,6 +33,9 @@ type ProductInfoResponse struct {
// 关联信息
Category *CategoryInfoResponse `json:"category,omitempty" comment:"分类信息"`
// 组合包信息
PackageItems []*PackageItemResponse `json:"package_items,omitempty" comment:"组合包项目列表"`
CreatedAt time.Time `json:"created_at" comment:"创建时间"`
UpdatedAt time.Time `json:"updated_at" comment:"更新时间"`
}