feat: 添加日志管理和敏感词过滤功能
- 新增日志管理模块:操作日志、登录日志、数据变更日志 - 新增敏感词过滤器 (sanitizer) - 新增日志异步写入管理器 - 新增日志定时清理服务 - 优化帖子相关服务和上传服务
This commit is contained in:
@@ -76,16 +76,18 @@ func (Post) TableName() string {
|
||||
|
||||
// PostImage 帖子图片
|
||||
type PostImage struct {
|
||||
ID string `json:"id" gorm:"type:varchar(36);primaryKey"`
|
||||
PostID string `json:"post_id" gorm:"type:varchar(36);index;not null"`
|
||||
URL string `json:"url" gorm:"type:text;not null"`
|
||||
ThumbnailURL string `json:"thumbnail_url" gorm:"type:text"`
|
||||
Width int `json:"width" gorm:"default:0"`
|
||||
Height int `json:"height" gorm:"default:0"`
|
||||
Size int64 `json:"size" gorm:"default:0"` // 文件大小(字节)
|
||||
MimeType string `json:"mime_type" gorm:"type:varchar(50)"`
|
||||
SortOrder int `json:"sort_order" gorm:"default:0"`
|
||||
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
|
||||
ID string `json:"id" gorm:"type:varchar(36);primaryKey"`
|
||||
PostID string `json:"post_id" gorm:"type:varchar(36);index;not null"`
|
||||
URL string `json:"url" gorm:"type:text;not null"`
|
||||
ThumbnailURL string `json:"thumbnail_url" gorm:"type:text"`
|
||||
PreviewURL string `json:"preview_url" gorm:"type:text"` // 列表/网格预览图(最大300px)
|
||||
PreviewURLLarge string `json:"preview_url_large" gorm:"type:text"` // 详情页预览图(最大800px)
|
||||
Width int `json:"width" gorm:"default:0"`
|
||||
Height int `json:"height" gorm:"default:0"`
|
||||
Size int64 `json:"size" gorm:"default:0"` // 文件大小(字节)
|
||||
MimeType string `json:"mime_type" gorm:"type:varchar(50)"`
|
||||
SortOrder int `json:"sort_order" gorm:"default:0"`
|
||||
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
|
||||
}
|
||||
|
||||
// BeforeCreate 创建前生成UUID
|
||||
|
||||
Reference in New Issue
Block a user