Documentation ¶
Index ¶
- func New(db *apputils.ServerUtils) routes.Routes
- type Admin
- func (t *Admin) AddClass(c *gin.Context)
- func (t *Admin) AddStudentToClass(c *gin.Context)
- func (t *Admin) AddTeacherToClass(c *gin.Context)
- func (a *Admin) Close() error
- func (t *Admin) DeleteAdmin(c *gin.Context)
- func (t *Admin) DeleteStudent(c *gin.Context)
- func (t *Admin) DeleteTeacher(c *gin.Context)
- func (t *Admin) GetStudent(c *gin.Context)
- func (t *Admin) GetStudents(c *gin.Context)
- func (t *Admin) GetTeacher(c *gin.Context)
- func (t *Admin) GetTeachers(c *gin.Context)
- func (a *Admin) InitCMDRoute(cmd *gin.Engine)
- func (a *Admin) InitRoute(g *gin.RouterGroup)
- func (t *Admin) ListClassStudent(c *gin.Context)
- func (t *Admin) ListClassTeacher(c *gin.Context)
- func (t *Admin) ListClasses(c *gin.Context)
- func (t *Admin) ListTeacherStudent(c *gin.Context)
- func (t *Admin) ModifyAdmin(c *gin.Context)
- func (t *Admin) ModifyAdminPassword(c *gin.Context)
- func (t *Admin) ModifyStudent(c *gin.Context)
- func (t *Admin) ModifyStudentClass(c *gin.Context)
- func (t *Admin) ModifyStudentPassword(c *gin.Context)
- func (t *Admin) ModifyTeacher(c *gin.Context)
- func (t *Admin) ModifyTeacherPassword(c *gin.Context)
- func (t *Admin) RegisterAdmin(c *gin.Context)
- func (t *Admin) RegisterStudent(c *gin.Context)
- func (t *Admin) RegisterTeacher(c *gin.Context)
- func (t *Admin) RemoveClass(c *gin.Context)
- func (t *Admin) RemoveStudentFromClass(c *gin.Context)
- func (t *Admin) RemoveTeacherFromClass(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Admin ¶
type Admin struct {
*apputils.ServerUtils
}
func (*Admin) AddClass ¶
管理员添加班级 godoc @Summary 管理员添加班级 @Schemes @Description 管理员添加班级 @Tags classAdmin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param classname query string true "新班级名称" @Success 200 {object} model.CommonResponse[model.AddClassResponse] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/class/new [post]
func (*Admin) AddStudentToClass ¶
管理员添加学生到指定班级 godoc @Summary 管理员添加学生到指定班级 @Schemes @Description 管理员添加学生到指定班级 @Tags classAdmin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param studentid query int true "学生用户ID" @Param classname query string true "新班级名称" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/student/class/new [post]
func (*Admin) AddTeacherToClass ¶
管理员添加老师到班级 godoc @Summary 管理员添加老师到班级 @Schemes @Description 管理员添加老师到班级 @Tags classAdmin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param teacherid query int true "教师ID" @Param classname query string true "班级名称" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/teacher/class/new [post]
func (*Admin) DeleteAdmin ¶
删除指定管理员 godoc @Summary 删除指定管理员 @Schemes @Description 删除指定管理员 @Tags admin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param id query string false "需要查询ID" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/admin [delete]
func (*Admin) DeleteStudent ¶
删除指定学生 godoc @Summary 删除指定学生 @Schemes @Description 删除指定学生 @Tags admin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param id query string false "需要查询ID" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/student [delete]
func (*Admin) DeleteTeacher ¶
删除指定教师 godoc @Summary 删除指定教师 @Schemes @Description 删除指定教师 @Tags admin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param id query string false "需要删除ID" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/teacher [delete]
func (*Admin) GetStudent ¶
获得指定学生信息 godoc @Summary 获取指定学生信息 @Schemes @Description 获取指定学生信息 @Tags admin @Accept json @Produce json @Param action path string false "查询过滤器,如果没有默认查询所以信息" @Param token header string true "登录返回的Token" @Param queryemail query string false "需要查询的学生邮箱" Format(email) @Param id query string false "需要查询学生ID" @Param name query string false "需要查询学生用户名" @Param queryRealname query string false "需要查询学生真实姓名" @Param queryUserSchoollD query string false "需要查询学生学号" @Success 200 {object} model.CommonResponse[[]model.GetUserResponse] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/student/{action} [post]
func (*Admin) GetStudents ¶
获取所有学生信息 godoc @Summary 获取所有学生信息 @Schemes @Description 获取所有学生信息 @Tags admin @Accept json @Produce json @Param action path string false "查询过滤器,如果没有默认查询所以信息" @Param token header string true "登录返回的Token" @Success 200 {object} model.CommonResponse[model.GetUserResponse] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/students/{action} [get]
func (*Admin) GetTeacher ¶
获得指定教师信息 godoc @Summary 获取指定教师信息 @Schemes @Description 获取指定教师信息 @Tags admin @Accept json @Produce json @Param action path string false "查询过滤器,如果没有默认查询所以信息" @Param token header string true "登录返回的Token" @Param queryemail query string false "需要查询的教师邮箱" Format(email) @Param id query string false "需要查询教师ID" @Param name query string false "需要查询教师用户名" @Param queryRealname query string false "需要查询教师真实姓名" @Param queryUserSchoollD query string false "需要查询教师学号" @Success 200 {object} model.CommonResponse[[]model.GetUserResponse] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/teacher/{action} [post]
func (*Admin) GetTeachers ¶
获取所有教师信息 godoc @Summary 获取所有教师信息 @Schemes @Description 获取所有教师信息 @Tags admin @Accept json @Produce json @Param action path string false "查询过滤器,如果没有默认查询所以信息" @Param token header string true "登录返回的Token" @Success 200 {object} model.CommonResponse[[]model.GetUserResponse] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/teachers/{action} [get]
func (*Admin) InitCMDRoute ¶
func (*Admin) InitRoute ¶
func (a *Admin) InitRoute(g *gin.RouterGroup)
func (*Admin) ListClassStudent ¶
管理员列出指定班级所有学生 godoc @Summary 管理员列出指定班级所有学生 @Schemes @Description 管理员列出指定班级所有学生 @Tags classAdmin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param classname query string true "班级名称" @Success 200 {object} model.CommonResponse[[]model.GetUserResponse] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/class/students [post]
func (*Admin) ListClassTeacher ¶
管理员列出指定班级老师 godoc @Summary 管理员列出指定班级老师 @Schemes @Description 管理员列出指定班级老师 @Tags classAdmin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param teacherid query int false "教师用户ID(可选)" @Param classid query int false "班级ID(可选)" @Success 200 {object} model.CommonResponse[[]model.Class] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/class/teachers [post]
func (*Admin) ListClasses ¶
获取所有班级 godoc @Summary 获取所有班级 @Schemes @Description 获取所有班级 @Tags auth @Accept json @Produce json @Param token header string true "登录返回的Token" @Success 200 {object} model.CommonResponse[[]model.GetClassResponse] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/classes [get]
func (*Admin) ListTeacherStudent ¶
管理员列出指定教师所有学生 godoc @Summary 管理员列出指定教师所有学生 @Schemes @Description 管理员列出指定教师所有学生 @Tags classAdmin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param teacherid query int true "教师用户ID" @Success 200 {object} model.CommonResponse[model.GetClassBelongsResponse] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/teacher/students [post]
func (*Admin) ModifyAdmin ¶
修改指定管理员信息 godoc @Summary 修改指定管理员信息 @Schemes @Description 修改指定管理员信息 @Tags admin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param id query string false "需要查询学生ID" @Param name query string false "需要修改的学生用户名" @Param email query string false "修改邮箱" Format(email) @Param realName query string false "修改真实姓名" @Param userSchoollD query string false "修改学号" @Param schoolCode query string false "修改学校代码" @Param class query string false "修改班级" @Param sex query string false "修改性别" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/admin [patch]
func (*Admin) ModifyAdminPassword ¶
修改指定管理员密码 godoc @Summary 修改指定管理员密码 @Schemes @Description 修改指定管理员密码 @Tags admin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param id query string false "需要查询管理员ID" @Param password query string false "新密码" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/admin/password [patch]
func (*Admin) ModifyStudent ¶
修改指定学生信息 godoc @Summary 修改指定学生信息 @Schemes @Description 修改指定学生信息 @Tags admin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param id query string false "需要查询学生ID" @Param name query string false "需要修改学生用户名" @Param email query string false "修改邮箱" Format(email) @Param realName query string false "修改真实姓名" @Param userSchoollD query string false "修改学号" @Param schoolCode query string false "修改学校代码" @Param class query string false "修改班级" @Param sex query string false "修改性别" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/student [patch]
func (*Admin) ModifyStudentClass ¶
管理员修改学生班级 godoc @Summary 管理员修改学生班级 @Schemes @Description 管理员修改学生班级 @Tags classAdmin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param studentid query int true "学生用户ID" @Param classname query string true "新班级名称" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/student/class [patch]
func (*Admin) ModifyStudentPassword ¶
修改指定学生密码 godoc @Summary 修改指定学生密码 @Schemes @Description 修改指定学生密码 @Tags admin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param id query string false "需要查询学生ID" @Param password query string false "新密码" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/student/password [patch]
func (*Admin) ModifyTeacher ¶
修改指定教师信息 godoc @Summary 修改指定教师信息 @Schemes @Description 修改指定教师信息 @Tags admin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param id query string false "需要查询ID" @Param name query string false "需要修改用户名" @Param email query string false "修改邮箱" Format(email) @Param realName query string false "修改真实姓名" @Param userSchoollD query string false "修改学号" @Param schoolCode query string false "修改学校代码" @Param class query string false "修改班级" @Param sex query string false "修改性别" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/teacher [patch]
func (*Admin) ModifyTeacherPassword ¶
修改指定教师密码 godoc @Summary 修改指定教师密码 @Schemes @Description 修改指定教师密码 @Tags admin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param id query string false "需要查询学生ID" @Param password query string false "新密码" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/teacher/password [patch]
func (*Admin) RegisterAdmin ¶
注册管理员 godoc @Summary 注册管理员 @Schemes @Description 注册管理员 @Tags admin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param name query string true "新用户用户名" @Param email query string true "新用户邮箱" Format(email) @Param realName query string true "新用户真实姓名" @Param sex query string true "新用户性别" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/admin/new [post]
func (*Admin) RegisterStudent ¶
注册学生 godoc @Summary 注册学生 @Schemes @Description 注册学生 @Tags admin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param name query string true "新用户用户名" @Param email query string true "新用户邮箱" Format(email) @Param realName query string true "新用户真实姓名" @Param userSchoollD query string true "新用户学号" @Param schoolCode query string true "新用户学校代码" @Param class query string true "新用户班级" @Param sex query string true "新用户性别" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/student/new [post]
func (*Admin) RegisterTeacher ¶
注册教师 godoc @Summary 注册教师 @Schemes @Description 注册教师 @Tags admin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param name query string true "新用户用户名" @Param email query string true "新用户邮箱" Format(email) @Param realName query string true "新用户真实姓名" @Param sex query string true "新用户性别" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/teacher/new [post]
func (*Admin) RemoveClass ¶
管理员删除班级 godoc @Summary 管理员删除班级 @Schemes @Description 管理员删除班级 @Tags classAdmin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param classname query string true "班级名称" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/class [delete]
func (*Admin) RemoveStudentFromClass ¶
管理员移除学生班级 godoc @Summary 管理员移除学生班级 @Schemes @Description 管理员移除学生班级 @Tags classAdmin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param studentid query int true "学生用户ID" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/student/class [delete]
func (*Admin) RemoveTeacherFromClass ¶
管理员将老师移除班级 godoc @Summary 管理员将老师移除班级 @Schemes @Description 管理员将老师移除班级 @Tags classAdmin @Accept json @Produce json @Param token header string true "登录返回的Token" @Param teacherid query int true "教师ID" @Param classname query string false "班级名称(可选)" @Success 200 {object} model.CommonResponse[any] @Failure 400 {object} model.CommonResponse[any] @Router /authrequired/admin/teacher/class [delete]