仓库自包含化:Docker/CI/文档/规范入库,路由分组拆分
CI / test (push) Successful in 15s

This commit is contained in:
Wang Defa
2026-07-09 19:18:04 +08:00
parent b9a3e97e84
commit 3e0389c1e9
83 changed files with 20241 additions and 248 deletions
+17 -14
View File
@@ -20,7 +20,7 @@ const (
// Setting 是系统级键值配置;敏感值(如 telegram_bot_token)以 AES-GCM 密文存储。
type Setting struct {
Key string `gorm:"primaryKey;size:64" json:"key"`
Value string `json:"value"`
Value string `gorm:"type:text" json:"value"`
UpdatedAt time.Time `json:"updatedAt"`
}
@@ -106,10 +106,10 @@ type Task struct {
Name string `gorm:"size:128" json:"name"`
Type string `gorm:"size:32;index" json:"type"`
CronExpr string `gorm:"size:64" json:"cronExpr"`
Payload string `json:"payload"`
Payload string `gorm:"type:text" json:"payload"`
Status string `gorm:"size:16;index" json:"status"`
LastRunAt *time.Time `json:"lastRunAt"`
LastError string `json:"lastError"`
LastError string `gorm:"type:text" json:"lastError"`
RunCount int `json:"runCount"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
@@ -120,7 +120,7 @@ type TaskLog struct {
ID uint `gorm:"primaryKey" json:"id"`
TaskID uint `gorm:"index" json:"taskId"`
Success bool `json:"success"`
Message string `json:"message"`
Message string `gorm:"type:text" json:"message"`
DurationMs int64 `json:"durationMs"`
CreatedAt time.Time `json:"createdAt"`
}
@@ -162,8 +162,9 @@ type OciConfig struct {
Fingerprint string `json:"fingerprint"`
Region string `json:"region"`
PrivateKeyEnc string `json:"-"`
PassphraseEnc string `json:"-"`
// 私钥 PEM 密文约 4KB,必须 text;passphrase 密文同档处理
PrivateKeyEnc string `gorm:"type:text" json:"-"`
PassphraseEnc string `gorm:"type:text" json:"-"`
TenancyName string `json:"tenancyName"`
HomeRegionKey string `json:"homeRegionKey"`
@@ -177,7 +178,7 @@ type OciConfig struct {
PromotionExpires *time.Time `json:"promotionExpires"`
AliveStatus string `json:"aliveStatus"`
LastError string `json:"lastError"`
LastError string `gorm:"type:text" json:"lastError"`
LastVerifiedAt *time.Time `json:"lastVerifiedAt"`
// 多区域 / 多区间支持:开启后订阅区域与 compartment 列表入库缓存,
@@ -199,10 +200,11 @@ type LogEvent struct {
Source string `gorm:"size:64" json:"source"`
SourceIP string `gorm:"size:64" json:"sourceIp"` // 异步解析回填,Audit 事件的发起方 IP
EventTime *time.Time `gorm:"index" json:"eventTime"`
Payload string `json:"payload"`
Truncated bool `json:"truncated"`
Processed bool `gorm:"index" json:"processed"`
ReceivedAt time.Time `json:"receivedAt"`
// 防御上限 256KB 超 MySQL TEXT(64KB),size 上探一档 → MEDIUMTEXT;PG/SQLite 仍为 text
Payload string `gorm:"size:16777216" json:"payload"`
Truncated bool `json:"truncated"`
Processed bool `gorm:"index" json:"processed"`
ReceivedAt time.Time `json:"receivedAt"`
}
// RegionCache 是开启多区域支持的配置缓存的订阅区域(每配置多行,整组覆盖)。
@@ -316,8 +318,9 @@ type AiContentLog struct {
Endpoint string `gorm:"size:16" json:"endpoint"`
Model string `gorm:"size:96" json:"model"`
Stream bool `json:"stream"`
// RequestBody / ResponseBody 是截断后的正文 JSON
RequestBody string `json:"requestBody"`
ResponseBody string `json:"responseBody"`
// RequestBody / ResponseBody 是截断后的正文 JSON;
// 64KB 截断恰在 MySQL TEXT 上限(65535B)边界,size 上探一档 → MEDIUMTEXT
RequestBody string `gorm:"size:16777216" json:"requestBody"`
ResponseBody string `gorm:"size:16777216" json:"responseBody"`
CreatedAt time.Time `gorm:"index" json:"createdAt"`
}