feat: 多班级版班级管理系统 v2.0
技术栈:Go (Gin + GORM) + PHP + MySQL 5.7 + Redis 主要功能: - 多班级完全隔离(class_id 贯穿全系统) - 后端 Go Gin(端口 56789),Nginx 反代 - 超级管理员独立登录(env 配置,默认账密 admin/Admin123) - bcrypt 密码加密(无 PASSWORD_SALT) - 科任老师/课代表新角色 - 课代表作业管理页面 - 排行榜分项排行(操行分/考勤/作业) - 角色加减分上下限由班主任配置 - 家长改密功能(可开关) - 班级角色按需开关 - 宿舍号格式:南0-000 - 周度/月度重置功能 - MySQL 5.7 兼容 - 43 轮代码审查 + 全部修复 开发者: Canglan 版权归属: Sea Network Technology Studio 许可证: Apache License 2.0
This commit is contained in:
50
backend-go/internal/model/log.go
Normal file
50
backend-go/internal/model/log.go
Normal file
@@ -0,0 +1,50 @@
|
||||
// ===========================================
|
||||
// 多班级版班级管理系统 - Go 后端
|
||||
//
|
||||
// 开发者: Canglan
|
||||
// 联系方式: admin@sea-studio.top
|
||||
// 版权归属: Sea Network Technology Studio
|
||||
// 许可证: Apache License 2.0
|
||||
//
|
||||
// 版权所有 © Sea Network Technology Studio
|
||||
// ===========================================
|
||||
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// OperationLog 操作日志模型,对应 operation_logs 表
|
||||
type OperationLog struct {
|
||||
LogID int64 `gorm:"column:log_id;primaryKey;autoIncrement" json:"log_id"`
|
||||
OperatorID int `gorm:"column:operator_id;not null;index:idx_operator_created" json:"operator_id"`
|
||||
OperatorName *string `gorm:"column:operator_name;type:varchar(50)" json:"operator_name"`
|
||||
OperatorRole *string `gorm:"column:operator_role;type:varchar(50)" json:"operator_role"`
|
||||
ClassID *int `gorm:"column:class_id;index:idx_operation_class" json:"class_id"`
|
||||
OperationType string `gorm:"column:operation_type;type:varchar(50);not null" json:"operation_type"`
|
||||
TargetType *string `gorm:"column:target_type;type:varchar(50)" json:"target_type"`
|
||||
TargetID *int `gorm:"column:target_id" json:"target_id"`
|
||||
Details *string `gorm:"column:details;type:text" json:"details"`
|
||||
IPAddress *string `gorm:"column:ip_address;type:varchar(45)" json:"ip_address"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime;index:idx_operator_created" json:"created_at"`
|
||||
}
|
||||
|
||||
// TableName 指定表名
|
||||
func (OperationLog) TableName() string {
|
||||
return "operation_logs"
|
||||
}
|
||||
|
||||
// LoginLog 登录日志模型,对应 login_logs 表
|
||||
type LoginLog struct {
|
||||
LogID int64 `gorm:"column:log_id;primaryKey;autoIncrement" json:"log_id"`
|
||||
Username string `gorm:"column:username;type:varchar(50);not null;index:idx_username_created" json:"username"`
|
||||
LoginResult int8 `gorm:"column:login_result;not null" json:"login_result"`
|
||||
FailReason *string `gorm:"column:fail_reason;type:varchar(100)" json:"fail_reason"`
|
||||
IPAddress *string `gorm:"column:ip_address;type:varchar(45)" json:"ip_address"`
|
||||
UserAgent *string `gorm:"column:user_agent;type:varchar(255)" json:"user_agent"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime;index:idx_username_created" json:"created_at"`
|
||||
}
|
||||
|
||||
// TableName 指定表名
|
||||
func (LoginLog) TableName() string {
|
||||
return "login_logs"
|
||||
}
|
||||
Reference in New Issue
Block a user