mirror of
https://github.com/tnb-labs/panel.git
synced 2026-08-28 17:44:56 +08:00
6f0593fbf8
- 切片字段加 unique 防重复配置(域名/监听/IP/白名单/网卡/磁盘设备/ NTP 服务器/应用标识/压缩路径/TLS 版本/索引/定时任务目标) - 网站统计日期范围 End 加 after_or_equal:Start(结束不早于开始) - 新增 tags_test.go:CheckRules 体检关键请求 + 全包 validate tag 编译校验,坏规则名/语法错/未注册自定义规则在测试期即报错 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
46 lines
2.4 KiB
Go
46 lines
2.4 KiB
Go
package request
|
|
|
|
type CronCreate struct {
|
|
Name string `form:"name" json:"name" validate:"required && not_exists:crons,name"`
|
|
Type string `form:"type" json:"type" validate:"required && in:shell,backup,cutoff,url,synctime"`
|
|
Time string `form:"time" json:"time" validate:"required && cron"`
|
|
Script string `form:"script" json:"script"`
|
|
SubType string `form:"sub_type" json:"sub_type" validate:"required_if:Type,backup,cutoff"`
|
|
Flock bool `form:"flock" json:"flock"`
|
|
Storage uint `form:"storage" json:"storage"`
|
|
Targets []string `form:"targets" json:"targets" validate:"required_if:Type,backup,cutoff && unique"`
|
|
Keep uint `form:"keep" json:"keep" validate:"required"`
|
|
URL string `form:"url" json:"url"`
|
|
Method string `form:"method" json:"method"`
|
|
Headers map[string]string `form:"headers" json:"headers"`
|
|
Body string `form:"body" json:"body"`
|
|
Timeout uint `form:"timeout" json:"timeout"`
|
|
Insecure bool `form:"insecure" json:"insecure"`
|
|
Retries uint `form:"retries" json:"retries"`
|
|
}
|
|
|
|
type CronUpdate struct {
|
|
ID uint `form:"id" json:"id" validate:"required && exists:crons,id"`
|
|
Name string `form:"name" json:"name" validate:"required"`
|
|
Type string `form:"type" json:"type" validate:"required && in:shell,backup,cutoff,url,synctime"`
|
|
Time string `form:"time" json:"time" validate:"required && cron"`
|
|
Script string `form:"script" json:"script"`
|
|
SubType string `form:"sub_type" json:"sub_type"`
|
|
Flock bool `form:"flock" json:"flock"`
|
|
Storage uint `form:"storage" json:"storage"`
|
|
Targets []string `form:"targets" json:"targets"`
|
|
Keep uint `form:"keep" json:"keep"`
|
|
URL string `form:"url" json:"url"`
|
|
Method string `form:"method" json:"method"`
|
|
Headers map[string]string `form:"headers" json:"headers"`
|
|
Body string `form:"body" json:"body"`
|
|
Timeout uint `form:"timeout" json:"timeout"`
|
|
Insecure bool `form:"insecure" json:"insecure"`
|
|
Retries uint `form:"retries" json:"retries"`
|
|
}
|
|
|
|
type CronStatus struct {
|
|
ID uint `form:"id" json:"id" validate:"required && exists:crons,id"`
|
|
Status bool `form:"status" json:"status"`
|
|
}
|