admin

package
v0.0.0-...-a9e7740 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: Artistic-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendMsg

func SendMsg(data *service.MessageData) *service.MessageRes

消息发送

Types

type AdminController

type AdminController struct {
	BaseController
}

管理员

func (*AdminController) Detail

func (c *AdminController) Detail()

@Title 获取详细信息 @Description @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /detail [get]

func (*AdminController) Get

func (c *AdminController) Get()

@Title 获取管理员信息 @Description @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router / [get]

func (*AdminController) IndexData

func (c *AdminController) IndexData()

@Title 获取首页展示信息 @Description 获取首页展示信息 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /index_data [get]

func (*AdminController) List

func (c *AdminController) List()

@Title 获取管理员列表 @Description 获取管理员列表 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param user_id body uint true "管理员id" @Param page body uint false "当前页数" @Param limit body uint false "查询条数" @Failure 400 no enough input @Failure 500 server error @router /list [get]

func (*AdminController) Login

func (c *AdminController) Login()

@Title 登录 @Description 用户登录 @Success 200 {object} service.AdminLoginData Res {"code":1,"data":null,"msg":"ok"} @Param username body string true "用户名" @Param password body string true "密码" @Failure 400 no enough input @Failure 500 server error @router /login [post]

func (*AdminController) Logout

func (c *AdminController) Logout()

@Title 退出登录 @Description @Success 200 {object} service.AdminLoginData Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /logout [post]

func (*AdminController) Post

func (c *AdminController) Post()

@Title 修改管理员账号 @Description 修改管理员账号 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param user_id body uint true "用户id" @Param password body string false "管理员密码" @Param real_name body string false "真实姓名" @Param phone body string false "手机号码" @Param sex body uint8 false "性别" @Param role_id body uint false "角色id" @Param birthday body string false "生日 Y-m-d" @Param route_ids body string false "扩展路由id" @Param is_delete body int8 false "扩展路由id" @Failure 400 no enough input @Failure 500 server error @router / [post]

func (*AdminController) Put

func (c *AdminController) Put()

@Title 创建管理员账号 @Description 创建管理员账号 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param username body string true "管理员账号" @Param password body string true "管理员密码" @Param realName body string true "真实姓名" @Param Introduction body string false "个人描述" @Param phone body string true "手机号码" @Param sex body uint8 true "性别" @Param role_id body uint true "角色id" @Param birthday body int false "生日" @Param w body string false "扩展路由id" @Failure 400 no enough input @Failure 500 server error @router / [put]

func (*AdminController) ReLogin

func (c *AdminController) ReLogin()

@Title 重新登录 @Description @Success 200 Res {"code":1,"data":service.AdminLoginData ,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /re_login [post]

func (*AdminController) RefreshLogin

func (c *AdminController) RefreshLogin()

@Title 刷新登陆信息 @Description @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /refresh_login [get]

type BaseController

type BaseController struct {
	beego.Controller
	//当前环境
	ENV string
	// contains filtered or unexported fields
}

* 后台基类

func (*BaseController) CheckLogin

func (c *BaseController) CheckLogin()

* 校验登录

func (*BaseController) Get

func (c *BaseController) Get()

@Title 测试接口 @Description 测试数据 @Success 200 @router / [get]

func (*BaseController) Prepare

func (c *BaseController) Prepare()

func (*BaseController) ResponseToJson

func (c *BaseController) ResponseToJson(httpCode int, data interface{}, info ...string)

返回结果 json

type CronController

type CronController struct {
	BaseController
}

Crontab 时间查询

func (*CronController) NextRunTime

func (c *CronController) NextRunTime()

@Title cron @Description 根据时间表达式 返回下次执行执行 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param cron_spec string true "任务表达式" @Param cal_run_num string false "执行次数 默认5次" @Failure 400 no enough input @Failure 500 server error @router /next_runtime [get]

type NotifyController

type NotifyController struct {
	BaseController
}

func (*NotifyController) Delete

func (c *NotifyController) Delete()

@Title 删除通知模板 @Description 删除通知模板 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param notify_tpl_id body int int "通知模板id" @Failure 400 no enough input @Failure 500 server error @router / [delete]

func (*NotifyController) Detail

func (c *NotifyController) Detail()

@Title 获取通知模板详细 @Description @Param id body int false "通知模板id" @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /detail [get]

func (*NotifyController) List

func (c *NotifyController) List()

@Title 通知模板 @Description 获取通知模板列表 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param page query int false "当前页数" @Param limit query int false "查询条数" @Param audit query int false "审核状态 -1查询所有" @Failure 400 no enough input @Failure 500 server error @router /list [get]

func (*NotifyController) Post

func (c *NotifyController) Post()

@Title 修改通知模板 @Description 修改通知模板 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param tpl_name body string true "通知模板名称" @Param tpl_data body string true "通知模板内容" @Param status body int8 true "状态 0.无效 1.有效" @Failure 400 no enough input @Failure 500 server error @router / [post]

func (*NotifyController) Put

func (c *NotifyController) Put()

@Title 创建通知模板 @Description 创建通知模板 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param tpl_name body string true "通知模板名称" @Param tpl_data body string true "通知模板内容" @Param status body int8 true "状态 0.无效 1.有效" @Failure 400 no enough input @Failure 500 server error @router / [put]

type RoleController

type RoleController struct {
	BaseController
}

后台角色

func (*RoleController) All

func (c *RoleController) All()

@Title 获取全部角色列表 @Description 获取全部角色列表 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /all [get]

func (*RoleController) Delete

func (c *RoleController) Delete()

@Title 删除角色 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param role_id body int true "角色id" @router / [delete]

func (*RoleController) Detail

func (c *RoleController) Detail()

@Title 获取详细信息 @Description @Param role_id body int false "角色id" @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /detail [get]

func (*RoleController) List

func (c *RoleController) List()

@Title 获取角色列表 @Description 获取角色列表 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param page body uint false "当前页数" @Param limit body uint false "查询条数" @Failure 400 no enough input @Failure 500 server error @router /list [get]

func (*RoleController) Post

func (c *RoleController) Post()

@Title 修改角色 @Description 修改后台角色 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param role_id body uint true "角色id" @Param role_name body string false "角色名称" @Param parent_id body uint false "上级id" @Param status body int8 false "状态 0.无效 1.有效" @Param is_delete body int8 false "删除状态 0.正常 1.删除" @Failure 400 no enough input @Failure 500 server error @router / [post]

func (*RoleController) Put

func (c *RoleController) Put()

@Title 创建角色 @Description 创建后台角色 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param role_name body string true "角色名称" @Param parent_id body uint true "上级角色id" @Param status body int8 true "状态 0.无效 1.有效" @Param route_ids body string false "扩展路由id" @Failure 400 no enough input @Failure 500 server error @router / [put]

func (*RoleController) RouteEdit

func (c *RoleController) RouteEdit()

@Title 角色权限编辑 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param role_id body int true "角色id" @Param route_ids body string true "路由ids" @router /route_edit [post]

type RouteController

type RouteController struct {
	BaseController
}

路由

func (*RouteController) All

func (c *RouteController) All()

@Title 获取全部路由列表 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /all [get]

func (*RouteController) Delete

func (c *RouteController) Delete()

@Title 删除路由 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param route_id body int true "路由id" @router / [delete]

func (*RouteController) Detail

func (c *RouteController) Detail()

@Title 获取详细信息 @Description @Param route_id body int false "路由id" @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /detail [get]

func (*RouteController) EditSort

func (c *RouteController) EditSort()

@Title 修改路由排序 @Description 修改路由 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param route_id body int int "任务id" @Param sort body int16 int "排序值" @Failure 400 no enough input @Failure 500 server error @router /edit_sort [post]

func (*RouteController) List

func (c *RouteController) List()

@Title 获取路由列表 @Description 获取角色列表 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /list [get]

func (*RouteController) Menu

func (c *RouteController) Menu()

@Title 获取菜单列表 根据管理员角色 @Description 获取菜单列表 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /menu [get]

func (*RouteController) Post

func (c *RouteController) Post()

@Title 修改路由 @Description 修改后台路由 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param route_id body int true "路由id" @Param route_name body string false "路由角色" @Param route body string false "路由url" @Param request body string false "请求类型" @Param parent_id body int true "上级路由id" @Param status body int8 false "状态 0.无效 1.有效" @Param is_delete body int8 false "删除状态 0.正常 1.删除" @Failure 400 no enough input @Failure 500 server error @router / [post]

func (*RouteController) Put

func (c *RouteController) Put()

@Title 创建路由 @Description 创建后台角色 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param route_name body string true "路由名称" @Param route body string true "路由url" @Param request body string false "请求类型" @Param parent_id body int true "上级路由id" @Param status body int8 true "状态 0.无效 1.有效" @Failure 400 no enough input @Failure 500 server error @router / [put]

type ServersController

type ServersController struct {
	BaseController
}

资源服务器管理

func (*ServersController) Delete

func (c *ServersController) Delete()

@Title 删除路由 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param route_id body int true "路由id" @router / [delete]

func (*ServersController) Detail

func (c *ServersController) Detail()

@Title 获取详细信息 @Description @Param server_id body int false "服务器id" @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /detail [get]

func (*ServersController) GroupList

func (c *ServersController) GroupList()

@Title 资源服务器列表 @Description 获取服务器列表 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param page body int false "当前页数" @Param limit body int false "查询条数" @Failure 400 no enough input @Failure 500 server error @router /group_list [get]

func (*ServersController) List

func (c *ServersController) List()

@Title 资源服务器列表 @Description 获取服务器列表 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param page body int false "当前页数" @Param limit body int false "查询条数" @Failure 400 no enough input @Failure 500 server error @router /list [get]

func (*ServersController) Post

func (c *ServersController) Post()

@Title 修改资源服务器 @Description 修改资源服务器 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param Servers_id body int true "路由id" @Param Servers_name body string false "路由角色" @Param Servers body string false "路由url" @Param request body string false "请求类型" @Param parent_id body int true "上级路由id" @Param status body int8 false "状态 0.无效 1.有效" @Param is_delete body int8 false "删除状态 0.正常 1.删除" @Failure 400 no enough input @Failure 500 server error @router / [post]

func (*ServersController) Put

func (c *ServersController) Put()

@Title 创建资源服务器由 @Description 创建资源服务器 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param Servers_name body string true "路由名称" @Param Servers body string true "路由url" @Param request body string false "请求类型" @Param parent_id body uint true "上级路由id" @Param status body int8 true "状态 0.无效 1.有效" @Failure 400 no enough input @Failure 500 server error @router / [put]

type TaskController

type TaskController struct {
	BaseController
}

任务管理

func (*TaskController) Audit

func (c *TaskController) Audit()

@Title 审核任务 @Description 审核任务 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param task_id body int int "任务id" @Param audit body int8 int "审核状态 1.通过 2.不通过" @Failure 400 no enough input @Failure 500 server error @router /audit [post]

func (*TaskController) BanList

func (c *TaskController) BanList()

@Title 获取禁用命令列表 @Description 获取禁用命令列表 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /ban_list [get]

func (*TaskController) Delete

func (c *TaskController) Delete()

@Title 删除任务 @Description 删除任务 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param task_id body int int "任务id" @Failure 400 no enough input @Failure 500 server error @router / [delete]

func (*TaskController) Detail

func (c *TaskController) Detail()

@Title 获取详细信息 @Description @Param task_id body int false "任务id" @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Failure 400 no enough input @Failure 500 server error @router /detail [get]

func (*TaskController) EditBan

func (c *TaskController) EditBan()

@Title 编辑禁用命令 @Description 编辑禁用命令 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param ban_list body array true "禁用命令" @Param id body string false "id" @Failure 400 no enough input @Failure 500 server error @router /edit_ban [post]

func (*TaskController) ExecuteTask

func (c *TaskController) ExecuteTask()

@Title 任务 执行一次 @Description 任务执行 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param task_id body int int "任务id" @Failure 400 no enough input @Failure 500 server error @router /execute [get]

func (*TaskController) GroupList

func (c *TaskController) GroupList()

@Title 任务列表 @Description 获取任务列表 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param page query int false "当前页数" @Param limit query int false "查询条数" @Failure 400 no enough input @Failure 500 server error @router /group_list [get]

func (*TaskController) IsBan

func (c *TaskController) IsBan()

@Title 是否为禁用命令 @Description 是否为禁用命令 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param ban_order body string true "禁用命令" @Failure 400 no enough input @Failure 500 server error @router /is_ban [get]

func (*TaskController) List

func (c *TaskController) List()

@Title 任务列表 @Description 获取服务器列表 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param page query int false "当前页数" @Param limit query int false "查询条数" @Param audit query int false "审核状态" @Failure 400 no enough input @Failure 500 server error @router /list [get]

func (*TaskController) Log

func (c *TaskController) Log()

@Title 任务日志 @Description 获取任务日志列表 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param page query int false "当前页数" @Param limit query int false "查询条数" @Param audit query int false "审核状态" @Failure 400 no enough input @Failure 500 server error @router /log [get]

func (*TaskController) LogDetail

func (c *TaskController) LogDetail()

@Title 任务日志详细 @Description 获取任务日志详细 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param page query int false "当前页数" @Param limit query int false "查询条数" @Param audit query int false "审核状态" @Failure 400 no enough input @Failure 500 server error @router /log_detail [get]

func (*TaskController) NotifyData

func (c *TaskController) NotifyData()

@Title 通知数据集合 @Description 通知所需要的数据信息 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param expand body string false "扩展信息、 admin,notify_type,notify_tpl" @Failure 400 no enough input @Failure 500 server error @router /notify_data [get]

func (*TaskController) Post

func (c *TaskController) Post()

@Title 修改任务 @Description 修改任务 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param Task_id body uint true "路由id" @Param Task_name body string false "路由角色" @Param Task body string false "路由url" @Param request body string false "请求类型" @Param parent_id body uint true "上级路由id" @Param status body int8 false "状态 0.无效 1.有效" @Param is_delete body int8 false "删除状态 0.正常 1.删除" @Failure 400 no enough input @Failure 500 server error @router / [post]

func (*TaskController) Put

func (c *TaskController) Put()

@Title 创建任务 @Description 创建任务 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param Task_name body string true "路由名称" @Param Task body string true "路由url" @Param request body string false "请求类型" @Param parent_id body uint true "上级路由id" @Param status body int8 true "状态 0.无效 1.有效" @Failure 400 no enough input @Failure 500 server error @router / [put]

func (*TaskController) TaskRunning

func (c *TaskController) TaskRunning()

@Title 任务 启动-停止 @Description 审核任务 @Success 200 {object} Res {"code":1,"data":null,"msg":"ok"} @Param task_id body int int "任务id" @Param status body int8 int "任务状态 0.无效 1.有效" @Failure 400 no enough input @Failure 500 server error @router /running [post]

Jump to

Keyboard shortcuts

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