feat: 多班级版班级管理系统 v2.0
技术栈:Go (Gin + GORM) + PHP + MySQL 5.7 + Redis 主要功能: - 多班级完全隔离(class_id 贯穿全系统) - 后端从 Python FastAPI 重写为 Go Gin(端口 56789) - 超级管理员独立登录(env 配置路径,默认账密 admin/Admin123) - 科任老师/课代表新角色 - 课代表作业管理页面 - 排行榜分项排行(操行分/考勤/作业) - 角色加减分上下限由班主任配置 - 家长改密功能(可开关) - 班级角色按需开关 - 宿舍号格式:南0-000 - 周度/月度重置功能 - MySQL 5.7 兼容 - Nginx 反向代理部署 开发者: Canglan 版权归属: Sea Network Technology Studio 许可证: Apache License 2.0
This commit is contained in:
33
backend-go/internal/schema/admin.go
Normal file
33
backend-go/internal/schema/admin.go
Normal file
@@ -0,0 +1,33 @@
|
||||
// ===========================================
|
||||
// 多班级版班级管理系统 - Go 后端
|
||||
//
|
||||
// 开发者: Canglan
|
||||
// 联系方式: admin@sea-studio.top
|
||||
// 版权归属: Sea Network Technology Studio
|
||||
// 许可证: Apache License 2.0
|
||||
//
|
||||
// 版权所有 © Sea Network Technology Studio
|
||||
// ===========================================
|
||||
|
||||
package schema
|
||||
|
||||
// AdminCreateRequest 添加管理员请求
|
||||
type AdminCreateRequest struct {
|
||||
Username string `json:"username" binding:"required"`
|
||||
RealName string `json:"real_name" binding:"required"`
|
||||
Password string `json:"password"`
|
||||
RoleType string `json:"role_type" binding:"required"`
|
||||
SubjectID *int `json:"subject_id"`
|
||||
}
|
||||
|
||||
// AdminUpdateRequest 更新管理员请求
|
||||
type AdminUpdateRequest struct {
|
||||
RealName string `json:"real_name" binding:"required"`
|
||||
RoleType string `json:"role_type" binding:"required"`
|
||||
SubjectID *int `json:"subject_id"`
|
||||
}
|
||||
|
||||
// UnlockUserRequest 解锁用户请求
|
||||
type UnlockUserRequest struct {
|
||||
Username string `json:"username" binding:"required"`
|
||||
}
|
||||
30
backend-go/internal/schema/attendance.go
Normal file
30
backend-go/internal/schema/attendance.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// ===========================================
|
||||
// 多班级版班级管理系统 - Go 后端
|
||||
//
|
||||
// 开发者: Canglan
|
||||
// 联系方式: admin@sea-studio.top
|
||||
// 版权归属: Sea Network Technology Studio
|
||||
// 许可证: Apache License 2.0
|
||||
//
|
||||
// 版权所有 © Sea Network Technology Studio
|
||||
// ===========================================
|
||||
|
||||
package schema
|
||||
|
||||
// AttendanceCreateRequest 创建考勤记录请求
|
||||
type AttendanceCreateRequest struct {
|
||||
StudentID int `json:"student_id" binding:"required"`
|
||||
Date string `json:"date" binding:"required"`
|
||||
Slot string `json:"slot" binding:"required,oneof=morning afternoon evening"`
|
||||
Status string `json:"status" binding:"required,oneof=present absent late leave"`
|
||||
Reason string `json:"reason"`
|
||||
ApplyDeduction bool `json:"apply_deduction"`
|
||||
CustomDeduction *int `json:"custom_deduction"`
|
||||
}
|
||||
|
||||
// AttendanceQuery 考勤查询参数
|
||||
type AttendanceQuery struct {
|
||||
Date string `form:"date"`
|
||||
StudentID *int `form:"student_id"`
|
||||
Slot string `form:"slot"`
|
||||
}
|
||||
26
backend-go/internal/schema/auth.go
Normal file
26
backend-go/internal/schema/auth.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// ===========================================
|
||||
// 多班级版班级管理系统 - Go 后端
|
||||
//
|
||||
// 开发者: Canglan
|
||||
// 联系方式: admin@sea-studio.top
|
||||
// 版权归属: Sea Network Technology Studio
|
||||
// 许可证: Apache License 2.0
|
||||
//
|
||||
// 版权所有 © Sea Network Technology Studio
|
||||
// ===========================================
|
||||
|
||||
package schema
|
||||
|
||||
// LoginRequest 登录请求
|
||||
type LoginRequest struct {
|
||||
Username string `json:"username" binding:"required"`
|
||||
Password string `json:"password" binding:"required"`
|
||||
}
|
||||
|
||||
// ChangePasswordRequest 修改密码请求
|
||||
type ChangePasswordRequest struct {
|
||||
OldPassword string `json:"old_password" binding:"required"`
|
||||
NewPassword string `json:"new_password" binding:"required"`
|
||||
Force bool `json:"force"`
|
||||
}
|
||||
|
||||
44
backend-go/internal/schema/class.go
Normal file
44
backend-go/internal/schema/class.go
Normal file
@@ -0,0 +1,44 @@
|
||||
// ===========================================
|
||||
// 多班级版班级管理系统 - Go 后端
|
||||
//
|
||||
// 开发者: Canglan
|
||||
// 联系方式: admin@sea-studio.top
|
||||
// 版权归属: Sea Network Technology Studio
|
||||
// 许可证: Apache License 2.0
|
||||
//
|
||||
// 版权所有 © Sea Network Technology Studio
|
||||
// ===========================================
|
||||
|
||||
package schema
|
||||
|
||||
// ClassCreateRequest 创建班级请求
|
||||
type ClassCreateRequest struct {
|
||||
ClassName string `json:"class_name" binding:"required"`
|
||||
Grade *string `json:"grade"`
|
||||
Description *string `json:"description"`
|
||||
}
|
||||
|
||||
// ClassUpdateRequest 更新班级请求
|
||||
type ClassUpdateRequest struct {
|
||||
ClassName *string `json:"class_name"`
|
||||
Grade *string `json:"grade"`
|
||||
Description *string `json:"description"`
|
||||
Status *int8 `json:"status"`
|
||||
}
|
||||
|
||||
// SwitchClassRequest 切换班级上下文请求
|
||||
type SwitchClassRequest struct {
|
||||
ClassID int `json:"class_id" binding:"required"`
|
||||
}
|
||||
|
||||
// SettingRequest 保存班级设置请求
|
||||
type SettingRequest struct {
|
||||
SettingKey string `json:"setting_key" binding:"required"`
|
||||
SettingValue string `json:"setting_value" binding:"required"`
|
||||
}
|
||||
|
||||
// FeatureToggleRequest 功能开关请求
|
||||
type FeatureToggleRequest struct {
|
||||
FeatureKey string `json:"feature_key" binding:"required"`
|
||||
Enabled int8 `json:"enabled" binding:"oneof=0 1"`
|
||||
}
|
||||
43
backend-go/internal/schema/conduct.go
Normal file
43
backend-go/internal/schema/conduct.go
Normal file
@@ -0,0 +1,43 @@
|
||||
// ===========================================
|
||||
// 多班级版班级管理系统 - Go 后端
|
||||
//
|
||||
// 开发者: Canglan
|
||||
// 联系方式: admin@sea-studio.top
|
||||
// 版权归属: Sea Network Technology Studio
|
||||
// 许可证: Apache License 2.0
|
||||
//
|
||||
// 版权所有 © Sea Network Technology Studio
|
||||
// ===========================================
|
||||
|
||||
package schema
|
||||
|
||||
// ConductAddRequest 批量加减分请求
|
||||
type ConductAddRequest struct {
|
||||
StudentIDs []int `json:"student_ids" binding:"required,min=1"`
|
||||
PointsChange int `json:"points_change" binding:"required,ne=0"`
|
||||
Reason string `json:"reason" binding:"required"`
|
||||
RelatedType string `json:"related_type"`
|
||||
}
|
||||
|
||||
// RevokeRequest 撤销/反撤销请求
|
||||
type RevokeRequest struct {
|
||||
RecordID int64 `json:"record_id" binding:"required"`
|
||||
}
|
||||
|
||||
// BatchRevokeRequest 批量撤销/反撤销请求
|
||||
type BatchRevokeRequest struct {
|
||||
RecordIDs []int64 `json:"record_ids" binding:"required,min=1,max=100"`
|
||||
}
|
||||
|
||||
// ConductHistoryQuery 操行分历史查询参数
|
||||
type ConductHistoryQuery struct {
|
||||
StudentID *int `form:"student_id"`
|
||||
Page int `form:"page,default=1" binding:"min=1"`
|
||||
PageSize int `form:"page_size,default=20" binding:"min=1,max=1000"`
|
||||
StartDate string `form:"start_date"`
|
||||
EndDate string `form:"end_date"`
|
||||
RelatedType string `form:"related_type"`
|
||||
ReasonPrefix string `form:"reason_prefix"`
|
||||
IsRevoked *int `form:"is_revoked"`
|
||||
ReasonSearch string `form:"reason_search"`
|
||||
}
|
||||
50
backend-go/internal/schema/ranking.go
Normal file
50
backend-go/internal/schema/ranking.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 schema
|
||||
|
||||
// RankingQuery 排行榜查询参数
|
||||
type RankingQuery struct {
|
||||
Type string `form:"type" binding:"omitempty,oneof=attendance homework conduct all"`
|
||||
Limit int `form:"limit,default=50" binding:"min=1,max=1000"`
|
||||
}
|
||||
|
||||
// ParentHistoryQuery 家长历史记录查询参数
|
||||
type ParentHistoryQuery struct {
|
||||
Page int `form:"page,default=1" binding:"min=1"`
|
||||
PageSize int `form:"page_size,default=20" binding:"min=1,max=100"`
|
||||
}
|
||||
|
||||
// StudentConductQuery 学生操行分查询参数
|
||||
type StudentConductQuery struct {
|
||||
Limit int `form:"limit,default=50" binding:"min=1"`
|
||||
Offset int `form:"offset,default=0" binding:"min=0"`
|
||||
}
|
||||
|
||||
// StudentAttendanceQuery 学生考勤查询参数
|
||||
type StudentAttendanceQuery struct {
|
||||
Month string `form:"month"`
|
||||
}
|
||||
|
||||
// CadreHomeworkQuery 课代表作业查询参数
|
||||
type CadreHomeworkQuery struct {
|
||||
SubjectID *int `form:"subject_id"`
|
||||
Page int `form:"page,default=1" binding:"min=1"`
|
||||
PageSize int `form:"page_size,default=20" binding:"min=1,max=100"`
|
||||
}
|
||||
|
||||
// CadreHomeworkSubmitRequest 课代表发布作业请求
|
||||
// SubjectID 由后端从管理员角色中自动获取,无需前端传递
|
||||
type CadreHomeworkSubmitRequest struct {
|
||||
Title string `json:"title" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
Deadline string `json:"deadline" binding:"required"`
|
||||
}
|
||||
38
backend-go/internal/schema/semester.go
Normal file
38
backend-go/internal/schema/semester.go
Normal file
@@ -0,0 +1,38 @@
|
||||
// ===========================================
|
||||
// 多班级版班级管理系统 - Go 后端
|
||||
//
|
||||
// 开发者: Canglan
|
||||
// 联系方式: admin@sea-studio.top
|
||||
// 版权归属: Sea Network Technology Studio
|
||||
// 许可证: Apache License 2.0
|
||||
//
|
||||
// 版权所有 © Sea Network Technology Studio
|
||||
// ===========================================
|
||||
|
||||
package schema
|
||||
|
||||
// SemesterCreateRequest 创建学期请求
|
||||
type SemesterCreateRequest struct {
|
||||
SemesterName string `json:"semester_name" binding:"required"`
|
||||
StartDate *string `json:"start_date"`
|
||||
EndDate *string `json:"end_date"`
|
||||
}
|
||||
|
||||
// SemesterUpdateRequest 更新学期请求
|
||||
type SemesterUpdateRequest struct {
|
||||
SemesterName *string `json:"semester_name"`
|
||||
StartDate *string `json:"start_date"`
|
||||
EndDate *string `json:"end_date"`
|
||||
}
|
||||
|
||||
// PeriodResetRequest 周期重置请求
|
||||
type PeriodResetRequest struct {
|
||||
Period string `json:"period" binding:"required,oneof=weekly monthly"`
|
||||
}
|
||||
|
||||
// PeriodArchiveQuery 周期归档查询参数
|
||||
type PeriodArchiveQuery struct {
|
||||
Period string `form:"period" binding:"required,oneof=weekly monthly"`
|
||||
Page int `form:"page,default=1"`
|
||||
PageSize int `form:"page_size,default=20"`
|
||||
}
|
||||
54
backend-go/internal/schema/student.go
Normal file
54
backend-go/internal/schema/student.go
Normal file
@@ -0,0 +1,54 @@
|
||||
// ===========================================
|
||||
// 多班级版班级管理系统 - Go 后端
|
||||
//
|
||||
// 开发者: Canglan
|
||||
// 联系方式: admin@sea-studio.top
|
||||
// 版权归属: Sea Network Technology Studio
|
||||
// 许可证: Apache License 2.0
|
||||
//
|
||||
// 版权所有 © Sea Network Technology Studio
|
||||
// ===========================================
|
||||
|
||||
package schema
|
||||
|
||||
// StudentCreateRequest 新增学生请求
|
||||
type StudentCreateRequest struct {
|
||||
StudentNo string `json:"student_no" binding:"required"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
ParentAccount *string `json:"parent_account"`
|
||||
DormitoryNumber *string `json:"dormitory_number"`
|
||||
}
|
||||
|
||||
// StudentImportSingle 导入的单个学生数据
|
||||
type StudentImportSingle struct {
|
||||
StudentNo string `json:"student_no"`
|
||||
Name string `json:"name"`
|
||||
ParentAccount string `json:"parent_account"`
|
||||
DormitoryNumber string `json:"dormitory_number"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
// StudentImportRequest 批量导入学生请求
|
||||
type StudentImportRequest struct {
|
||||
Students []StudentImportSingle `json:"students" binding:"required"`
|
||||
}
|
||||
|
||||
// StudentUpdateRequest 编辑学生请求
|
||||
type StudentUpdateRequest struct {
|
||||
Name *string `json:"name"`
|
||||
ParentAccount *string `json:"parent_account"`
|
||||
DormitoryNumber *string `json:"dormitory_number"`
|
||||
}
|
||||
|
||||
// StudentListQuery 学生列表查询参数
|
||||
type StudentListQuery struct {
|
||||
Page int `form:"page,default=1" binding:"min=1"`
|
||||
PageSize int `form:"page_size,default=20" binding:"min=1,max=1000"`
|
||||
Search string `form:"search"`
|
||||
DormitoryNumber string `form:"dormitory_number"`
|
||||
}
|
||||
|
||||
// ResetPasswordRequest 重置密码请求
|
||||
type ResetPasswordRequest struct {
|
||||
NewPassword string `json:"new_password" binding:"required"`
|
||||
}
|
||||
27
backend-go/internal/schema/subject.go
Normal file
27
backend-go/internal/schema/subject.go
Normal file
@@ -0,0 +1,27 @@
|
||||
// ===========================================
|
||||
// 多班级版班级管理系统 - Go 后端
|
||||
//
|
||||
// 开发者: Canglan
|
||||
// 联系方式: admin@sea-studio.top
|
||||
// 版权归属: Sea Network Technology Studio
|
||||
// 许可证: Apache License 2.0
|
||||
//
|
||||
// 版权所有 © Sea Network Technology Studio
|
||||
// ===========================================
|
||||
|
||||
package schema
|
||||
|
||||
// SubjectCreateRequest 创建科目请求
|
||||
type SubjectCreateRequest struct {
|
||||
SubjectName string `json:"subject_name" binding:"required"`
|
||||
SubjectCode *string `json:"subject_code"`
|
||||
SortOrder int `json:"sort_order"`
|
||||
}
|
||||
|
||||
// SubjectUpdateRequest 更新科目请求
|
||||
type SubjectUpdateRequest struct {
|
||||
SubjectName *string `json:"subject_name"`
|
||||
SubjectCode *string `json:"subject_code"`
|
||||
IsActive *int8 `json:"is_active"`
|
||||
SortOrder *int `json:"sort_order"`
|
||||
}
|
||||
Reference in New Issue
Block a user