feat: PhotoWall 毕业照存储系统初始版本
后端: Go(Gin+GORM+MySQL+Redis) - 17张业务表(yz_pw_前缀), 自动迁移 - JWT认证(3小时) + 盐+MD5密码 + 图形验证码 - 班级CRUD/加入(8人姓名验证/邀请码)/审核/30天自动清理 - 系统配置(16项)/菜单管理(动态路由)/数据统计 - 文件MD5去重/数据隔离/账号封禁/敏感词DFA检测 前端: Vue3+Vite+Element Plus+Less+ECharts+FontAwesome - 动态路由(数据库菜单驱动) - 蓝白配色, H5响应式 - 登录/注册/忘记密码/个人中心 - 班级创建向导/详情/加入/列表 - 管理后台: 审核/配置/菜单/统计/用户/敏感词 数据库: MySQL 10.31.100.3:3306/photowall 管理员: hero920103 / 920103
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// MaxPhotosPerUserPerClass 每人在每个班级最多留存的当期照片数
|
||||
const MaxPhotosPerUserPerClass = 10
|
||||
|
||||
// ClassPhoto 用户在班级下的个人当期照片(每人每班级最多10张)
|
||||
type ClassPhoto struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
ClassID uint `gorm:"index;not null" json:"class_id"`
|
||||
UserID uint `gorm:"index;not null" json:"user_id"`
|
||||
PhotoURL string `gorm:"size:512;not null" json:"photo_url"`
|
||||
Caption string `gorm:"size:255" json:"caption"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// AuditAction 审核动作
|
||||
type AuditAction string
|
||||
|
||||
const (
|
||||
AuditSubmit AuditAction = "submit" // 提交审核
|
||||
AuditApprove AuditAction = "approve" // 平台审核通过
|
||||
AuditReject AuditAction = "reject" // 平台打回
|
||||
AuditAutoDelete AuditAction = "auto_delete" // 30天未补齐自动删除
|
||||
AuditManualDelete AuditAction = "manual_delete"
|
||||
)
|
||||
|
||||
// AuditLog 班级审核日志
|
||||
type AuditLog struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
ClassID uint `gorm:"index;not null" json:"class_id"`
|
||||
AuditorID uint `json:"auditor_id"` // 平台管理员ID,系统自动操作为0
|
||||
Action AuditAction `gorm:"size:24;index;not null" json:"action"`
|
||||
Reason string `gorm:"size:512" json:"reason"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
Reference in New Issue
Block a user