admin

package
v0.0.0-...-971e649 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

Types

type Admin

type Admin struct {
	*apputils.ServerUtils
}

func (*Admin) AddClass

func (t *Admin) AddClass(c *gin.Context)

管理员添加班级 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

func (t *Admin) AddStudentToClass(c *gin.Context)

管理员添加学生到指定班级 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

func (t *Admin) AddTeacherToClass(c *gin.Context)

管理员添加老师到班级 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) Close

func (a *Admin) Close() error

func (*Admin) DeleteAdmin

func (t *Admin) DeleteAdmin(c *gin.Context)

删除指定管理员 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

func (t *Admin) DeleteStudent(c *gin.Context)

删除指定学生 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

func (t *Admin) DeleteTeacher(c *gin.Context)

删除指定教师 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

func (t *Admin) GetStudent(c *gin.Context)

获得指定学生信息 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

func (t *Admin) GetStudents(c *gin.Context)

获取所有学生信息 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

func (t *Admin) GetTeacher(c *gin.Context)

获得指定教师信息 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

func (t *Admin) GetTeachers(c *gin.Context)

获取所有教师信息 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 (a *Admin) InitCMDRoute(cmd *gin.Engine)

func (*Admin) InitRoute

func (a *Admin) InitRoute(g *gin.RouterGroup)

func (*Admin) ListClassStudent

func (t *Admin) ListClassStudent(c *gin.Context)

管理员列出指定班级所有学生 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

func (t *Admin) ListClassTeacher(c *gin.Context)

管理员列出指定班级老师 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

func (t *Admin) ListClasses(c *gin.Context)

获取所有班级 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

func (t *Admin) ListTeacherStudent(c *gin.Context)

管理员列出指定教师所有学生 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

func (t *Admin) ModifyAdmin(c *gin.Context)

修改指定管理员信息 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

func (t *Admin) ModifyAdminPassword(c *gin.Context)

修改指定管理员密码 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

func (t *Admin) ModifyStudent(c *gin.Context)

修改指定学生信息 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

func (t *Admin) ModifyStudentClass(c *gin.Context)

管理员修改学生班级 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

func (t *Admin) ModifyStudentPassword(c *gin.Context)

修改指定学生密码 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

func (t *Admin) ModifyTeacher(c *gin.Context)

修改指定教师信息 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

func (t *Admin) ModifyTeacherPassword(c *gin.Context)

修改指定教师密码 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

func (t *Admin) RegisterAdmin(c *gin.Context)

注册管理员 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

func (t *Admin) RegisterStudent(c *gin.Context)

注册学生 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

func (t *Admin) RegisterTeacher(c *gin.Context)

注册教师 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

func (t *Admin) RemoveClass(c *gin.Context)

管理员删除班级 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

func (t *Admin) RemoveStudentFromClass(c *gin.Context)

管理员移除学生班级 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

func (t *Admin) RemoveTeacherFromClass(c *gin.Context)

管理员将老师移除班级 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]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL