dto: 新增 CardStatusCheckInterval 字段(validate min=30,description 含枚举说明) config_service.go: 创建/更新/响应映射均支持 CardStatusCheckInterval Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
87 lines
7.6 KiB
Go
87 lines
7.6 KiB
Go
package dto
|
||
|
||
// CreatePollingConfigRequest 创建轮询配置请求
|
||
type CreatePollingConfigRequest struct {
|
||
ConfigName string `json:"config_name" validate:"required,min=1,max=100" required:"true" minLength:"1" maxLength:"100" description:"配置名称"`
|
||
CardCondition string `json:"card_condition" validate:"omitempty,oneof=not_real_name real_name activated suspended" description:"卡状态条件 (not_real_name:未实名, real_name:已实名, activated:已激活, suspended:已停用)"`
|
||
CardCategory string `json:"card_category" validate:"omitempty,oneof=normal industry" description:"卡业务类型 (normal:普通卡, industry:行业卡)"`
|
||
CarrierID *uint `json:"carrier_id" validate:"omitempty" description:"运营商ID(可选,精确匹配)"`
|
||
Priority int `json:"priority" validate:"required,min=1,max=1000" required:"true" minimum:"1" maximum:"1000" description:"优先级(数字越小优先级越高)"`
|
||
RealnameCheckInterval *int `json:"realname_check_interval" validate:"omitempty,min=30" minimum:"30" description:"实名检查间隔(秒),NULL表示不检查,最小30秒"`
|
||
CarddataCheckInterval *int `json:"carddata_check_interval" validate:"omitempty,min=60" minimum:"60" description:"流量检查间隔(秒),NULL表示不检查,最小60秒"`
|
||
PackageCheckInterval *int `json:"package_check_interval" validate:"omitempty,min=60" minimum:"60" description:"套餐检查间隔(秒),NULL表示不检查,最小60秒"`
|
||
ProtectCheckInterval *int `json:"protect_check_interval" validate:"omitempty,min=30" minimum:"30" description:"保护期一致性检查间隔(秒),NULL表示不检查,最小30秒"`
|
||
CardStatusCheckInterval *int `json:"card_status_check_interval" validate:"omitempty,min=30" minimum:"30" description:"卡状态检查间隔(秒),NULL表示不检查,最小30秒"`
|
||
Description string `json:"description" validate:"omitempty,max=500" maxLength:"500" description:"配置说明"`
|
||
}
|
||
|
||
// UpdatePollingConfigRequest 更新轮询配置请求
|
||
type UpdatePollingConfigRequest struct {
|
||
ConfigName *string `json:"config_name" validate:"omitempty,min=1,max=100" minLength:"1" maxLength:"100" description:"配置名称"`
|
||
CardCondition *string `json:"card_condition" validate:"omitempty,oneof=not_real_name real_name activated suspended" description:"卡状态条件 (not_real_name:未实名, real_name:已实名, activated:已激活, suspended:已停用)"`
|
||
CardCategory *string `json:"card_category" validate:"omitempty,oneof=normal industry" description:"卡业务类型 (normal:普通卡, industry:行业卡)"`
|
||
CarrierID *uint `json:"carrier_id" validate:"omitempty" description:"运营商ID(可选,精确匹配)"`
|
||
Priority *int `json:"priority" validate:"omitempty,min=1,max=1000" minimum:"1" maximum:"1000" description:"优先级(数字越小优先级越高)"`
|
||
RealnameCheckInterval *int `json:"realname_check_interval" validate:"omitempty,min=30" minimum:"30" description:"实名检查间隔(秒),NULL表示不检查,最小30秒"`
|
||
CarddataCheckInterval *int `json:"carddata_check_interval" validate:"omitempty,min=60" minimum:"60" description:"流量检查间隔(秒),NULL表示不检查,最小60秒"`
|
||
PackageCheckInterval *int `json:"package_check_interval" validate:"omitempty,min=60" minimum:"60" description:"套餐检查间隔(秒),NULL表示不检查,最小60秒"`
|
||
ProtectCheckInterval *int `json:"protect_check_interval" validate:"omitempty,min=30" minimum:"30" description:"保护期一致性检查间隔(秒),NULL表示不检查,最小30秒"`
|
||
CardStatusCheckInterval *int `json:"card_status_check_interval" validate:"omitempty,min=30" minimum:"30" description:"卡状态检查间隔(秒),NULL表示不检查,最小30秒"`
|
||
Description *string `json:"description" validate:"omitempty,max=500" maxLength:"500" description:"配置说明"`
|
||
}
|
||
|
||
// PollingConfigListRequest 轮询配置列表请求
|
||
type PollingConfigListRequest struct {
|
||
Page int `json:"page" query:"page" validate:"omitempty,min=1" minimum:"1" description:"页码"`
|
||
PageSize int `json:"page_size" query:"page_size" validate:"omitempty,min=1,max=100" minimum:"1" maximum:"100" description:"每页数量"`
|
||
Status *int16 `json:"status" query:"status" validate:"omitempty,oneof=0 1" description:"状态 (1:启用, 0:禁用)"`
|
||
CardCondition *string `json:"card_condition" query:"card_condition" validate:"omitempty,oneof=not_real_name real_name activated suspended" description:"卡状态条件"`
|
||
CardCategory *string `json:"card_category" query:"card_category" validate:"omitempty,oneof=normal industry" description:"卡业务类型"`
|
||
CarrierID *uint `json:"carrier_id" query:"carrier_id" validate:"omitempty" description:"运营商ID"`
|
||
ConfigName *string `json:"config_name" query:"config_name" validate:"omitempty,max=100" maxLength:"100" description:"配置名称(模糊搜索)"`
|
||
}
|
||
|
||
// UpdatePollingConfigStatusRequest 更新轮询配置状态请求
|
||
type UpdatePollingConfigStatusRequest struct {
|
||
Status int16 `json:"status" validate:"required,oneof=0 1" required:"true" description:"状态 (1:启用, 0:禁用)"`
|
||
}
|
||
|
||
// PollingConfigResponse 轮询配置响应
|
||
type PollingConfigResponse struct {
|
||
ID uint `json:"id" description:"配置ID"`
|
||
ConfigName string `json:"config_name" description:"配置名称"`
|
||
CardCondition string `json:"card_condition" description:"卡状态条件 (not_real_name:未实名, real_name:已实名, activated:已激活, suspended:已停用)"`
|
||
CardCategory string `json:"card_category" description:"卡业务类型 (normal:普通卡, industry:行业卡)"`
|
||
CarrierID *uint `json:"carrier_id" description:"运营商ID"`
|
||
Priority int `json:"priority" description:"优先级(数字越小优先级越高)"`
|
||
RealnameCheckInterval *int `json:"realname_check_interval" description:"实名检查间隔(秒),NULL表示不检查"`
|
||
CarddataCheckInterval *int `json:"carddata_check_interval" description:"流量检查间隔(秒),NULL表示不检查"`
|
||
PackageCheckInterval *int `json:"package_check_interval" description:"套餐检查间隔(秒),NULL表示不检查"`
|
||
ProtectCheckInterval *int `json:"protect_check_interval" description:"保护期一致性检查间隔(秒),NULL表示不检查"`
|
||
CardStatusCheckInterval *int `json:"card_status_check_interval" description:"卡状态检查间隔(秒),NULL表示不检查"`
|
||
Status int16 `json:"status" description:"状态 (1:启用, 0:禁用)"`
|
||
Description string `json:"description" description:"配置说明"`
|
||
CreatedAt string `json:"created_at" description:"创建时间"`
|
||
UpdatedAt string `json:"updated_at" description:"更新时间"`
|
||
}
|
||
|
||
// UpdatePollingConfigParams 更新轮询配置参数
|
||
type UpdatePollingConfigParams struct {
|
||
IDReq
|
||
UpdatePollingConfigRequest
|
||
}
|
||
|
||
// UpdatePollingConfigStatusParams 更新轮询配置状态参数
|
||
type UpdatePollingConfigStatusParams struct {
|
||
IDReq
|
||
UpdatePollingConfigStatusRequest
|
||
}
|
||
|
||
// PollingConfigPageResult 轮询配置分页结果
|
||
type PollingConfigPageResult struct {
|
||
List []*PollingConfigResponse `json:"items" description:"配置列表"`
|
||
Total int64 `json:"total" description:"总数"`
|
||
Page int `json:"page" description:"当前页"`
|
||
PageSize int `json:"size" description:"每页数量"`
|
||
}
|