新增: - blob_store 二进制去重存储 + blob_dedup 测试 其它: - 后端 settings/auth/media_library/upload/operations 服务与 handler 调整 - 前端品牌(BrandLockup/BrandCropModal/BrandSeoPanel)、注册、媒体库、分析详情页、Header/SiteChrome 等更新
67 lines
2.2 KiB
Go
67 lines
2.2 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
// ModuleConfig is versioned independently; secrets are encrypted by the service.
|
|
type ModuleConfig struct {
|
|
Name string `gorm:"primaryKey;size:32" json:"name"`
|
|
Version int64 `json:"version"`
|
|
Data string `gorm:"type:text" json:"-"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type SettingsAudit struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
ActorID uint `json:"actor_id"`
|
|
Module string `gorm:"size:32" json:"module"`
|
|
Action string `gorm:"size:64" json:"action"`
|
|
Fields string `gorm:"type:text" json:"fields"`
|
|
Result string `gorm:"type:text" json:"result"`
|
|
CreatedAt time.Time `gorm:"index" json:"created_at"`
|
|
}
|
|
|
|
type ActionCounter struct {
|
|
Key string `gorm:"primaryKey;size:64"`
|
|
Count int
|
|
ExpiresAt time.Time `gorm:"index"`
|
|
}
|
|
|
|
// MailTask retains no plaintext credentials, codes or links.
|
|
type MailTask struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
Dedupe string `gorm:"uniqueIndex;size:64" json:"-"`
|
|
Kind string `gorm:"size:32" json:"kind"`
|
|
Recipient string `gorm:"size:256" json:"recipient"`
|
|
Payload string `gorm:"type:text" json:"-"`
|
|
Status string `gorm:"index;size:32" json:"status"`
|
|
Attempts int `json:"attempts"`
|
|
Summary string `gorm:"size:128" json:"summary"`
|
|
NextAt time.Time `gorm:"index" json:"-"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type EmailChallenge struct {
|
|
Hash string `gorm:"primaryKey;size:64"`
|
|
Email string `gorm:"index;size:256"`
|
|
Purpose string `gorm:"size:32"`
|
|
ExpiresAt time.Time `gorm:"index"`
|
|
Used bool
|
|
}
|
|
|
|
// Every remote object pins the immutable configuration revision that wrote it.
|
|
type StoredObject struct {
|
|
ID string `gorm:"primaryKey;size:96" json:"id"`
|
|
ConfigName string `gorm:"size:64;index" json:"-"`
|
|
Key string `gorm:"size:512" json:"-"`
|
|
MIME string `gorm:"size:128" json:"-"`
|
|
Public bool `json:"-"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
type TemporaryUpload struct {
|
|
ID string `gorm:"primaryKey;size:64"`
|
|
RelativePath string `gorm:"size:512"`
|
|
CreatedAt time.Time `gorm:"index"`
|
|
}
|