controller

package
v0.0.0-...-3e17545 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminController

type AdminController struct{}

func (*AdminController) DeleteRole

func (ac *AdminController) DeleteRole(ctx iris.Context)

@summary 删除用户角色 @description 删除用户的角色, 需要管理员权限 @produce json @param username path string true "用户名" @param role path string true "角色" @tags admin, user @router /api/admin/user/{username}/role/{role} [delete] @success 200 {object} response.SuccessResponse @failure 200 {object} response.FailureResponse

func (*AdminController) DeleteUser

func (ac *AdminController) DeleteUser(ctx iris.Context)

@summary 删除用户 @description 删除指定用户, 需要超级管理员权限 @produce json @param username path string true "用户名" @tags admin, user @router /api/admin/user/{username} [delete] @success 200 {object} response.SuccessResponse @failure 200 {object} response.FailureResponse

func (*AdminController) ModifyUser

func (ac *AdminController) ModifyUser(ctx iris.Context)

@summary 修改用户 @description 修改用户信息, 需要管理员权限 @accept json @produce json @param username path string true "用户名" @param body body request.AdminModifyUserRequest true "用户信息" @tags admin, user @router /api/admin/user/{username} [put] @success 200 {object} response.SuccessResponse @failure 200 {object} response.FailureResponse

func (*AdminController) SetRole

func (ac *AdminController) SetRole(ctx iris.Context)

@summary 设置用户角色 @description 设置用户的角色, 若已拥有仍返回成功, 需要管理员权限 @produce json @param username path string true "用户名" @param role path string true "角色" @tags admin, user @router /api/admin/user/{username}/role/{role} [put] @success 200 {object} response.SuccessResponse @failure 200 {object} response.FailureResponse

func (*AdminController) UserList

func (ac *AdminController) UserList(ctx iris.Context)

@summary 用户列表 @description 获取所有用户列表, 需要超级管理员权限 @produce json @tags admin, user @router /api/admin/user [get] @success 200 {object} response.UserListResponse

type AnnouncementController

type AnnouncementController struct{}

func (*AnnouncementController) CreateTemplate

func (ac *AnnouncementController) CreateTemplate(ctx iris.Context)

@summary 创建模板 @description 创建一个新的模板, 需要公告管理员权限 @accept json @produce json @param body body request.CreateTemplateRequest true "创建模板参数" @tags announcement @router /api/template [post] @success 200 {object} response.TemplateResponse @failure 200 {object} response.FailureResponse

func (*AnnouncementController) DeleteTemplate

func (ac *AnnouncementController) DeleteTemplate(ctx iris.Context)

@summary 删除模板 @description 删除模板, 需要公告管理员权限 @produce json @param id path uint true "模板ID" @tags announcement @router /api/template/{id} [delete] @success 200 {object} response.SuccessResponse @failure 200 {object} response.FailureResponse

func (*AnnouncementController) GetTemplate

func (ac *AnnouncementController) GetTemplate(ctx iris.Context)

@summary 模板信息 @description 查看模板的详细信息, 需要公告管理员权限 @produce json @param id path uint true "模板ID" @tags announcement @router /api/template/{id} [get] @success 200 {object} response.TemplateResponse @failure 200 {object} response.FailureResponse

func (*AnnouncementController) ModifyTemplate

func (ac *AnnouncementController) ModifyTemplate(ctx iris.Context)

@summary 修改模板 @description 修改模板信息, 需要公告管理员权限 @accept json @produce json @param body body request.ModifyTemplateRequest true "修改模板参数" @param id path uint true "模板ID" @tags announcement @router /api/template/{id} [put] @success 200 {object} response.TemplateResponse @failure 200 {object} response.FailureResponse

func (*AnnouncementController) TemplateList

func (ac *AnnouncementController) TemplateList(ctx iris.Context)

@summary 模板列表 @description 查看用户可见的模板列表, 超级管理员可见所有模板, 公告管理员可看到自己的和所有人可见/编辑的模板 @produce json @tags announcement @router /api/template [get] @success 200 {object} response.TemplateListResponse @failure 200 {object} response.FailureResponse

type DebugController

type DebugController struct{}

func (*DebugController) About

func (dc *DebugController) About(ctx iris.Context)

@summary 调试信息 @description 获取 Maid Nana 调试信息 @produce json @tags debug @router /api/about [get] @success 200 {object} response.DebugInfo

type UserController

type UserController struct{}

func (*UserController) GetUser

func (uc *UserController) GetUser(ctx iris.Context)

@summary 用户信息 @description 查看用户的详细信息 @produce json @param username path string true "用户名" @tags user @router /api/user/{username} [get] @success 200 {object} response.UserResponse @failure 200 {object} response.FailureResponse

func (*UserController) Login

func (uc *UserController) Login(ctx iris.Context)

@summary 登录 @description 登录账号 @accept json @produce json @param username path string true "用户名" @param body body request.LoginRequest true "登录参数" @tags user @router /api/user/{username}/login [post] @success 200 {object} response.UserResponse @failure 200 {object} response.FailureResponse

func (*UserController) Logout

func (uc *UserController) Logout(ctx iris.Context)

@summary 登出 @description 退出登录 @produce json @tags user @router /api/logout [post] @success 200 {object} response.SuccessResponse

func (*UserController) Register

func (uc *UserController) Register(ctx iris.Context)

@summary 注册 @description 注册账号, 需要先在 QQ 上私聊机器人发送 "验证码" 获取验证码 @accept json @produce json @param body body request.RegisterRequest true "注册参数" @tags user @router /api/user [post] @success 200 {object} response.UserResponse @failure 200 {object} response.FailureResponse

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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