Files
junhong_cmp_fiber/internal/model/dto/polling_cleanup_dto.go
huang 2ef8b8a705
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
fix: 修复分页字段/角色DTO/套餐详情/批量分配Bug,新增C端测试登录接口和Hurl价格验证测试
- 修复B-2:27个分页DTO字段名统一(list→items, page_size→size,删除total_pages)
- 修复B-1:角色接口统一返回DTO(id小写,消除GORM大写字段名)
- 修复C-1:套餐详情接口(GET /packages/:id)补充代理佣金字段
- 修复C-2:批量分配已存在记录由500改为静默跳过
- 修复C-3:创建系列授权响应在事务提交后构建,packages数组不再为空
- 新增C端开发测试登录接口(POST /api/c/v1/auth/dev-login,仅logging.development=true时生效)
- 新增Hurl测试:card-price-verification-flow.hurl(导入卡→分配→C端价格验证)
- 新增测试Excel数据文件和dev.env测试变量
2026-03-31 09:54:08 +08:00

103 lines
5.3 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 "time"
// CreateDataCleanupConfigReq 创建数据清理配置请求
type CreateDataCleanupConfigReq struct {
TargetTable string `json:"table_name" validate:"required,max=100" description:"表名"`
RetentionDays int `json:"retention_days" validate:"required,min=7" description:"保留天数最少7天"`
BatchSize int `json:"batch_size" validate:"omitempty,min=1000,max=100000" description:"每批删除条数默认10000"`
Description string `json:"description" validate:"omitempty,max=500" description:"配置说明"`
}
// UpdateDataCleanupConfigReq 更新数据清理配置请求Body 部分)
type UpdateDataCleanupConfigReq struct {
RetentionDays *int `json:"retention_days" validate:"omitempty,min=7" description:"保留天数"`
BatchSize *int `json:"batch_size" validate:"omitempty,min=1000,max=100000" description:"每批删除条数"`
Enabled *int `json:"enabled" validate:"omitempty,oneof=0 1" description:"是否启用0-禁用1-启用"`
Description *string `json:"description" validate:"omitempty,max=500" description:"配置说明"`
}
// UpdateDataCleanupConfigParams 更新数据清理配置参数(包含路径参数和 Body
type UpdateDataCleanupConfigParams struct {
IDReq
UpdateDataCleanupConfigReq
}
// DataCleanupConfigResp 数据清理配置响应
type DataCleanupConfigResp struct {
ID uint `json:"id" description:"配置ID"`
TargetTable string `json:"table_name" description:"表名"`
RetentionDays int `json:"retention_days" description:"保留天数"`
BatchSize int `json:"batch_size" description:"每批删除条数"`
Enabled int `json:"enabled" description:"是否启用0-禁用1-启用"`
Description string `json:"description" description:"配置说明"`
CreatedAt time.Time `json:"created_at" description:"创建时间"`
UpdatedAt time.Time `json:"updated_at" description:"更新时间"`
UpdatedBy *uint `json:"updated_by,omitempty" description:"更新人ID"`
}
// DataCleanupConfigListResp 数据清理配置列表响应
type DataCleanupConfigListResp struct {
Items []*DataCleanupConfigResp `json:"items" description:"配置列表"`
}
// DataCleanupLogResp 数据清理日志响应
type DataCleanupLogResp struct {
ID uint `json:"id" description:"日志ID"`
TargetTable string `json:"table_name" description:"表名"`
CleanupType string `json:"cleanup_type" description:"清理类型scheduled/manual"`
RetentionDays int `json:"retention_days" description:"保留天数"`
DeletedCount int64 `json:"deleted_count" description:"删除记录数"`
DurationMs int64 `json:"duration_ms" description:"执行耗时(毫秒)"`
Status string `json:"status" description:"状态success/failed/running"`
ErrorMessage string `json:"error_message,omitempty" description:"错误信息"`
StartedAt time.Time `json:"started_at" description:"开始时间"`
CompletedAt *time.Time `json:"completed_at,omitempty" description:"完成时间"`
TriggeredBy *uint `json:"triggered_by,omitempty" description:"触发人ID"`
}
// DataCleanupLogListResp 数据清理日志列表响应
type DataCleanupLogListResp struct {
Items []*DataCleanupLogResp `json:"items" description:"日志列表"`
Total int64 `json:"total" description:"总数"`
Page int `json:"page" description:"当前页"`
PageSize int `json:"size" description:"每页数量"`
}
// ListDataCleanupLogReq 查询数据清理日志请求
type ListDataCleanupLogReq struct {
TableName string `json:"table_name" query:"table_name" description:"表名筛选"`
Page int `json:"page" query:"page" validate:"omitempty,min=1" description:"页码"`
PageSize int `json:"page_size" query:"page_size" validate:"omitempty,min=1,max=100" description:"每页数量"`
}
// DataCleanupPreviewResp 数据清理预览响应
type DataCleanupPreviewResp struct {
Items []*DataCleanupPreviewItem `json:"items" description:"预览列表"`
}
// DataCleanupPreviewItem 数据清理预览项
type DataCleanupPreviewItem struct {
TableName string `json:"table_name" description:"表名"`
RetentionDays int `json:"retention_days" description:"保留天数"`
RecordCount int64 `json:"record_count" description:"待清理记录数"`
Description string `json:"description" description:"配置说明"`
}
// DataCleanupProgressResp 数据清理进度响应
type DataCleanupProgressResp struct {
IsRunning bool `json:"is_running" description:"是否正在运行"`
CurrentTable string `json:"current_table,omitempty" description:"当前清理的表"`
TotalTables int `json:"total_tables" description:"总表数"`
ProcessedTables int `json:"processed_tables" description:"已处理表数"`
TotalDeleted int64 `json:"total_deleted" description:"已删除记录数"`
StartedAt *time.Time `json:"started_at,omitempty" description:"开始时间"`
LastLog *DataCleanupLogResp `json:"last_log,omitempty" description:"最近一条清理日志"`
}
// TriggerDataCleanupReq 手动触发数据清理请求
type TriggerDataCleanupReq struct {
TableName string `json:"table_name" validate:"omitempty,max=100" description:"表名,为空则清理所有"`
}