apis

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthApi

type AuthApi struct {
	// contains filtered or unexported fields
}

func GetAuthApi

func GetAuthApi() *AuthApi

func (*AuthApi) ChangeMyPasswd

func (a *AuthApi) ChangeMyPasswd(c *gin.Context)

ChangeMyPasswd godoc

@Summary	修改密码
@Tags		账号相关
@Accept		application/json
@Produce	application/json
@Param		[body]	body		req.ChangePasswdReq	true	"修改密码信息"
@Success	200		{object}	R.Result
@Router		/auth/passwd [put]

func (*AuthApi) GetMyInfo

func (a *AuthApi) GetMyInfo(c *gin.Context)

GetMyInfo godoc

@Summary	查询我的信息
@Tags		账号相关
@Produce	application/json
@Success	200	{object}	R.Result{value=model.User}
@Router		/auth/my-info [get]

func (*AuthApi) GetWebShellToken

func (a *AuthApi) GetWebShellToken(c *gin.Context)

GetWebShellToken godoc

@Summary	获取WebShell连接需要的token
@Tags		账号相关
@Produce	application/json
@Success	200	{object}	R.Result
@Router		/auth/web-shell-token [get]

func (*AuthApi) Login

func (a *AuthApi) Login(c *gin.Context)

Login godoc

@Summary	登录
@Tags		账号相关
@Accept		application/json
@Produce	application/json

@Param		[body]	body		req.LoginReq	true	"登录信息"

@Success	200		{object}	R.Result{value=model.User}
@Router		/auth/login [post]

func (*AuthApi) UpdateMyInfo

func (a *AuthApi) UpdateMyInfo(c *gin.Context)

UpdateMyInfo godoc

@Summary	更新我的信息
@Tags		账号相关
@Accept		application/json
@Produce	application/json
@Param		[body]	body		req.UpsertMyInfoReq	true	"用户信息"
@Success	200		{object}	R.Result
@Router		/auth/my-info [put]

type DeptApi

type DeptApi struct {
	// contains filtered or unexported fields
}

func GetDeptApi

func GetDeptApi() *DeptApi

func (*DeptApi) AddDept

func (a *DeptApi) AddDept(c *gin.Context)

AddDept godoc

@Summary	添加部门
@Tags		部门管理
@Accept		application/json
@Produce	application/json

@Param		[body]	body		req.DeptUpsertReq	true	"部门信息"

@Success	200		{object}	R.Result
@Router		/dept [post]

func (*DeptApi) DeleteDept

func (a *DeptApi) DeleteDept(c *gin.Context)

DeleteDept godoc

@Summary	删除部门
@Tags		部门管理
@Produce	application/json

@Param		id	path		int64	true	"部门ID"

@Success	200	{object}	R.Result
@Router		/dept/:id [delete]

func (*DeptApi) GetDept

func (a *DeptApi) GetDept(c *gin.Context)

GetDept godoc

@Summary	查询部门信息
@Tags		部门管理
@Produce	application/json

@Param		id	path		int64	true	"部门ID"

@Success	200	{object}	R.Result{value=model.Dept}
@Router		/dept/:id [get]

func (*DeptApi) GetDeptTree

func (a *DeptApi) GetDeptTree(c *gin.Context)

GetDeptTree godoc

@Summary	查询部门树
@Tags		部门管理
@Produce	application/json
@Param		keyword	query		string	false	"按照名称模糊搜索"
@Success	200		{object}	R.Result{value=res.DeptTree}
@Router		/dept/tree [get]

func (*DeptApi) UpdateDept

func (a *DeptApi) UpdateDept(c *gin.Context)

UpdateDept godoc

@Summary	修改部门
@Tags		部门管理
@Accept		application/json
@Produce	application/json

@Param		id		path		int64				true	"部门ID"
@Param		[body]	body		req.DeptUpsertReq	true	"部门信息"

@Success	200		{object}	R.Result
@Router		/dept/:id [put]

type IconApi

type IconApi struct {
	// contains filtered or unexported fields
}

func GetIconApi

func GetIconApi() *IconApi

func (*IconApi) GetAll

func (a *IconApi) GetAll(c *gin.Context)

GetAll godoc

@Summary	查询全部图标
@Tags		图标管理
@Produce	application/json
@Success	200	{object}	R.Result{value=model.Icon}
@Router		/icon/all [get]

type JobApi

type JobApi struct {
	// contains filtered or unexported fields
}

func GetJobApi

func GetJobApi() *JobApi

func (*JobApi) AddJob

func (a *JobApi) AddJob(c *gin.Context)

AddJob godoc

@Summary	添加岗位
@Tags		岗位管理
@Accept		application/json
@Produce	application/json
@Param		[body]	body		req.JobUpsertReq	true	"岗位信息"
@Success	200		{object}	R.Result
@Router		/job [post]

func (*JobApi) DeleteJob

func (a *JobApi) DeleteJob(c *gin.Context)

DeleteJob godoc

@Summary	删除岗位
@Tags		岗位管理
@Produce	application/json
@Param		id	path		int64	true	"岗位ID"
@Success	200	{object}	R.Result
@Router		/job/:id [delete]

func (*JobApi) GetList

func (a *JobApi) GetList(c *gin.Context)

GetList godoc

@Summary	查询岗位列表
@Tags		岗位管理
@Produce	application/json
@Param		keyword		query		string	false	"按照名称模糊搜索"
@Param		page		query		int64	false	"页码"
@Param		pageSize	query		int64	false	"每页查询条数"
@Success	200			{object}	R.Result{value=res.PageableData[model.Job]}
@Router		/job/list [get]

func (*JobApi) UpdateJob

func (a *JobApi) UpdateJob(c *gin.Context)

UpdateJob godoc

@Summary	更新岗位
@Tags		岗位管理
@Accept		application/json
@Produce	application/json
@Param		id		path		int64				true	"岗位ID"
@Param		[body]	body		req.JobUpsertReq	true	"岗位信息"
@Success	200		{object}	R.Result
@Router		/job/:id [put]

type LogApi

type LogApi struct {
	// contains filtered or unexported fields
}

func GetLogApi

func GetLogApi() *LogApi

func (*LogApi) DeleteExceptionLog

func (a *LogApi) DeleteExceptionLog(c *gin.Context)

DeleteExceptionLog godoc

@Summary	清除异常日志
@Tags		日志管理
@Produce	application/json
@Param		type	query		int16	true	"清除方式"
@Success	200		{object}	R.Result
@Router		/log/exception [delete]

func (*LogApi) DeleteLoginLog

func (a *LogApi) DeleteLoginLog(c *gin.Context)

DeleteLoginLog godoc

@Summary	清除登录日志
@Tags		日志管理
@Produce	application/json
@Param		type	query		int16	true	"清除方式"
@Success	200		{object}	R.Result
@Router		/log/login [delete]

func (*LogApi) DeleteOpLog

func (a *LogApi) DeleteOpLog(c *gin.Context)

DeleteOpLog godoc

@Summary	清除操作日志
@Tags		日志管理
@Produce	application/json
@Param		type	query		int16	true	"清除方式"
@Success	200		{object}	R.Result
@Router		/log/op [delete]

func (*LogApi) GetExceptionLogList

func (a *LogApi) GetExceptionLogList(c *gin.Context)

GetExceptionLogList godoc

@Summary	查询异常日志列表
@Tags		日志管理
@Produce	application/json
@Param		keyword		query		string	false	"按照用户名搜索"
@Param		page		query		int64	false	"页码"
@Param		pageSize	query		int64	false	"每页查询条数"
@Success	200			{object}	R.Result{value=res.PageableData[model.ExceptionLog]}
@Router		/log/exception [get]

func (*LogApi) GetLoginLogList

func (a *LogApi) GetLoginLogList(c *gin.Context)

GetLoginLogList godoc

@Summary	查询登录日志列表
@Tags		日志管理
@Produce	application/json
@Param		keyword		query		string	false	"按照用户名搜索"
@Param		page		query		int64	false	"页码"
@Param		pageSize	query		int64	false	"每页查询条数"
@Success	200			{object}	R.Result{value=res.PageableData[model.LoginLog]}
@Router		/log/login [get]

func (*LogApi) GetOpLogList

func (a *LogApi) GetOpLogList(c *gin.Context)

GetOpLogList godoc

@Summary	查询操作日志列表
@Tags		日志管理
@Produce	application/json
@Param		keyword		query		string	false	"按照用户名搜索"
@Param		page		query		int64	false	"页码"
@Param		pageSize	query		int64	false	"每页查询条数"
@Success	200			{object}	R.Result{value=res.PageableData[model.OpLog]}
@Router		/log/op [get]
type MenuApi struct {
	// contains filtered or unexported fields
}

func GetMenuApi

func GetMenuApi() *MenuApi
func (a *MenuApi) AddMenu(c *gin.Context)

AddMenu godoc

@Summary	添加菜单
@Tags		菜单管理
@Accept		application/json
@Produce	application/json

@Param		[body]	body		req.MenuUpsertReq	true	"菜单信息"

@Success	200		{object}	R.Result
@Router		/menu [post]
func (a *MenuApi) DeleteMenu(c *gin.Context)

DeleteMenu godoc

@Summary	删除菜单
@Tags		菜单管理
@Produce	application/json

@Param		id	path		int64	true	"菜单ID"

@Success	200	{object}	R.Result
@Router		/menu/:id [delete]
func (a *MenuApi) GetMenu(c *gin.Context)

GetMenu godoc

@Summary	查询菜单信息
@Tags		菜单管理
@Produce	application/json

@Param		id	path		int64	true	"菜单ID"

@Success	200	{object}	R.Result{value=model.Menu}
@Router		/menu/:id [get]
func (a *MenuApi) GetMenuTree(c *gin.Context)

GetMenuTree godoc

@Summary	查询菜单树
@Tags		菜单管理
@Produce	application/json
@Success	200	{object}	R.Result{value=res.MenuTree}
@Router		/menu/tree [get]
func (a *MenuApi) GetMyMenuTree(c *gin.Context)

GetMyMenuTree godoc

@Summary	查询当前用户有权限访问的菜单树(仅查询显示的菜单)
@Tags		菜单管理
@Produce	application/json
@Success	200	{object}	R.Result{value=res.MenuTree}
@Router		/menu/my/tree [get]
func (a *MenuApi) GetMyPermissions(c *gin.Context)

GetMyPermissions godoc

@Summary	查询当前用户拥有的所有权限列表
@Tags		菜单管理
@Produce	application/json
@Success	200	{object}	R.Result{value=[]string}
@Router		/menu/my/permissions [get]
func (a *MenuApi) UpdateMenu(c *gin.Context)

UpdateMenu godoc

@Summary	修改菜单
@Tags		菜单管理
@Accept		application/json
@Produce	application/json

@Param		id		path		int64				true	"菜单ID"
@Param		[body]	body		req.MenuUpsertReq	true	"菜单信息"

@Success	200		{object}	R.Result
@Router		/menu/:id [put]

type RoleApi

type RoleApi struct {
	// contains filtered or unexported fields
}

func GetRoleApi

func GetRoleApi() *RoleApi

func (*RoleApi) AddRole

func (a *RoleApi) AddRole(c *gin.Context)

AddRole godoc

@Summary	添加角色
@Tags		角色管理
@Accept		application/json
@Produce	application/json
@Param		[body]	body		req.RoleUpsertReq	true	"角色信息"
@Success	200		{object}	R.Result
@Router		/role [post]

func (*RoleApi) DeleteRole

func (a *RoleApi) DeleteRole(c *gin.Context)

DeleteRole godoc

@Summary	删除角色
@Tags		角色管理
@Produce	application/json
@Param		id	path		int64	true	"角色ID"
@Success	200	{object}	R.Result
@Router		/role/:id [delete]

func (*RoleApi) GetList

func (a *RoleApi) GetList(c *gin.Context)

GetList godoc

@Summary	查询角色列表
@Tags		角色管理
@Produce	application/json
@Param		keyword		query		string	false	"按照名称模糊搜索"
@Param		page		query		int64	false	"页码"
@Param		pageSize	query		int64	false	"每页查询条数"
@Success	200			{object}	R.Result{value=res.PageableData[model.Role]}
@Router		/role/list [get]

func (*RoleApi) GetRole

func (a *RoleApi) GetRole(c *gin.Context)

GetRole godoc

@Summary	查询角色信息
@Tags		角色管理
@Produce	application/json
@Param		id	path		int64	true	"角色ID"
@Success	200	{object}	R.Result{value=model.Role}
@Router		/role/:id [get]

func (*RoleApi) UpdateRole

func (a *RoleApi) UpdateRole(c *gin.Context)

UpdateRole godoc

@Summary	更新角色
@Tags		角色管理
@Accept		application/json
@Produce	application/json
@Param		id		path		int64				true	"角色ID"
@Param		[body]	body		req.RoleUpsertReq	true	"角色信息"
@Success	200		{object}	R.Result
@Router		/role/:id [put]

func (*RoleApi) UpdateRoleMenus

func (a *RoleApi) UpdateRoleMenus(c *gin.Context)

UpdateRoleMenus godoc

@Summary	角色绑定菜单
@Tags		角色管理
@Accept		application/json
@Produce	application/json

@Param		[body]	body		req.RoleMenusUpdateReq	true	"菜单列表"

@Success	200		{object}	R.Result
@Router		/role/:id/menus [put]

type SettingsApi

type SettingsApi struct {
	// contains filtered or unexported fields
}

func GetSettingsApi

func GetSettingsApi() *SettingsApi

func (*SettingsApi) GetSettings

func (a *SettingsApi) GetSettings(c *gin.Context)

GetSettings godoc

@Summary	查询系统信息
@Tags		系统配置
@Produce	application/json

@Param		key	query		string	true	"键名"

@Success	200	{object}	R.Result{value=model.Settings}
@Router		/settings [get]

func (*SettingsApi) Upsert

func (a *SettingsApi) Upsert(c *gin.Context)

Upsert godoc

@Summary	保存/更新系统配置
@Tags		系统配置
@Accept		application/json
@Produce	application/json

@Param		[body]	body		req.SettingsUpsertReq	true	"配置信息"

@Success	200		{object}	R.Result
@Router		/settings [put]

type SseApi

type SseApi struct {
	// contains filtered or unexported fields
}

func GetSseApi

func GetSseApi() *SseApi

func (*SseApi) MessagePush

func (a *SseApi) MessagePush(c *gin.Context)

MessagePush godoc

@Summary	服务端事件消息推送
@Tags		消息服务
@Accept		application/json
@Produce	text/event-stream
@Router		/sse/message-push [get]

func (*SseApi) PushHostLogEvent

func (a *SseApi) PushHostLogEvent(c *gin.Context)

PushHostLogEvent godoc

@Summary	推送远程主机日志
@Tags		任务管理
@Accept		application/json
@Produce	text/event-stream
@Param		id			path		int64	true	"任务ID"
@Param		host		query		string	true	"主机IP"
@Param		hostLogName	query		string	true	"主机日志的文件名"
@Router		/sse/task/:id/host-log [get]

func (*SseApi) PushManifestLogEvent

func (a *SseApi) PushManifestLogEvent(c *gin.Context)

PushManifestLogEvent godoc

@Summary	推送manifest日志
@Tags		任务管理
@Accept		application/json
@Produce	text/event-stream
@Param		id		path		int64	true	"任务ID"
@Router		/sse/task/:id/manifest-log [get]

type UserApi

type UserApi struct {
	// contains filtered or unexported fields
}

func GetUserApi

func GetUserApi() *UserApi

func (*UserApi) AddUser

func (a *UserApi) AddUser(c *gin.Context)

AddUser godoc

@Summary		添加用户
@Description	添加用户,添加成功后,密码会通过邮箱发给用户
@Tags			用户管理
@Accept			application/json
@Produce		application/json
@Param			[body]	body		req.UserUpsertReq	true	"用户信息"
@Success		200		{object}	R.Result
@Router			/user [post]

func (*UserApi) ChangePasswd

func (a *UserApi) ChangePasswd(c *gin.Context)

ChangePasswd godoc

@Summary	修改密码
@Tags		用户管理
@Accept		application/json
@Produce	application/json
@Param		[body]	body		req.ChangePasswdReq	true	"修改密码信息"
@Success	200		{object}	R.Result
@Router		/user/passwd [put]

func (*UserApi) DeleteUser

func (a *UserApi) DeleteUser(c *gin.Context)

DeleteUser godoc

@Summary	删除用户
@Tags		用户管理
@Produce	application/json
@Param		id	path		int64	true	"用户ID"
@Success	200	{object}	R.Result
@Router		/user/:id [delete]

func (*UserApi) DisableAccount

func (a *UserApi) DisableAccount(c *gin.Context)

DisableAccount godoc

@Summary	禁用账号
@Tags		用户管理
@Produce	application/json
@Param		id	path		int64	true	"用户ID"
@Success	200	{object}	R.Result
@Router		/user/disable/:id [put]

func (*UserApi) EnableAccount

func (a *UserApi) EnableAccount(c *gin.Context)

EnableAccount godoc

@Summary	启用账号
@Tags		用户管理
@Produce	application/json
@Param		id	path		int64	true	"用户ID"
@Success	200	{object}	R.Result
@Router		/user/enable/:id [put]

func (*UserApi) GetList

func (a *UserApi) GetList(c *gin.Context)

GetList godoc

@Summary	查询用户列表
@Tags		用户管理
@Produce	application/json
@Param		keyword		query		string		false	"搜索关键字(支持按名字、昵称、邮箱、手机号模糊搜索)"
@Param		status		query		int64		false	"用户状态"
@Param		page		query		int64		false	"页码"
@Param		pageSize	query		int64		false	"每页查询条数"
@Param		dates		query		[]string	false	"开始时间和结束时间"
@Success	200			{object}	R.Result{value=res.PageableData[model.User]}
@Router		/user/list [get]

func (*UserApi) GetUser

func (a *UserApi) GetUser(c *gin.Context)

GetUser godoc

@Summary	查询用户信息
@Tags		用户管理
@Produce	application/json
@Param		id	path		int64	true	"用户ID"
@Success	200	{object}	R.Result{value=model.User}
@Router		/user/:id [get]

func (*UserApi) ResetPasswd

func (a *UserApi) ResetPasswd(c *gin.Context)

ResetPasswd godoc

@Summary	重置密码
@Tags		用户管理
@Accept		application/json
@Produce	application/json
@Param		[body]	body		req.ChangePasswdReq	true	"修改密码信息"
@Success	200		{object}	R.Result
@Router		/user/passwd-reset/:id [put]

func (*UserApi) UpdateUser

func (a *UserApi) UpdateUser(c *gin.Context)

UpdateUser godoc

@Summary	更新用户信息
@Tags		用户管理
@Accept		application/json
@Produce	application/json
@Param		id		path		int64				true	"用户ID"
@Param		[body]	body		req.UserUpsertReq	true	"用户信息"
@Success	200		{object}	R.Result
@Router		/user/:id [put]

func (*UserApi) UpdateUserMenus

func (a *UserApi) UpdateUserMenus(c *gin.Context)

UpdateUserMenus godoc

@Summary	用户绑定菜单
@Tags		用户管理
@Accept		application/json
@Produce	application/json

@Param		id		path		int64					true	"用户ID"

@Param		[body]	body		req.UserMenusUpdateReq	true	"菜单列表"
@Success	200		{object}	R.Result
@Router		/user/:id/menus [put]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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