api

package
v1.0.22 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Index

func Index(c *gin.Context)

Index 默认首页

Types

type Captcha

type Captcha struct{}

Captcha 验证码

func NewCaptcha

func NewCaptcha() *Captcha

NewCaptcha 验证码实例

func (*Captcha) Captcha

func (a *Captcha) Captcha(c *gin.Context)

Captcha 验证码

type Config

type Config struct {
	ConfigService *service.Config
}

Config 字典数据管理

func NewConfig

func NewConfig() *Config

NewConfig 字典实例化

func (*Config) Create

func (d *Config) Create(c *gin.Context)

Create 创建数据 @Tags 参数设置 @Security Bearer @Summary 添加参数信息 @Param body body model.Config true "参数信息" @Success 200 string string "{code: 200, msg: 添加成功}" @Failure 200 string string "{code: -1, msg: 添加失败}" @Router /api/v1/config [post]

func (*Config) Delete

func (d *Config) Delete(c *gin.Context)

Delete 删除数据 @Tags 参数设置 @Security Bearer @Summary 删除参数信息 @Param id path string true "id" @Success 200 string string "{code: 200, msg: 删除成功}" @Failure 200 string string "{code: -1, msg: 删除失败}" @Router /api/v1/config/{id} [delete]

func (*Config) Get

func (d *Config) Get(c *gin.Context)

Get 查询指定数据 @Tags 参数设置 @Security Bearer @Summary 通过ID获取参数信息 @Param id path int true "参数ID" @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/config/{id} [get]

func (*Config) GetWithKey

func (d *Config) GetWithKey(c *gin.Context)

GetWithKey 查询指定类型数据 @Tags 参数设置 @Security Bearer @Summary 通过key值获取参数信息 @Param configName path int true "参数键值" @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/config_key [get]

func (*Config) Query

func (d *Config) Query(c *gin.Context)

Query 查询数据 @Tags 参数设置 @Security Bearer @Summary 参数列表 @Param pageIndex query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param configName query string false "configName" @Param configKey query string false "configKey" @Param configType query string false "configType" @Success 200 string string "{code: 200, data: [...]}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/config [get]

func (*Config) Update

func (d *Config) Update(c *gin.Context)

Update 更新数据 @Tags 参数设置 @Security Bearer @Summary 更新参数信息 @Param body body model.Config true "参数信息" @Success 200 string string "{code: 200, msg: 更新成功}" @Failure 200 string string "{code: -1, msg: 更新失败}" @Router /api/v1/config [put]

type DBColumn

type DBColumn struct {
	DBColumnService *service.DBColumn
}

DBColumn 数据库列管理

func NewDBColumn

func NewDBColumn() *DBColumn

NewDBColumn 数据库列实例化

func (*DBColumn) Query

func (d *DBColumn) Query(c *gin.Context)

Query 查询数据 @Tags 工具 @Security Bearer @Summary 分页列表数据 @Param pageIndex query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param tableName query string false "数据表名称" @Success 200 {string} string "{code: 200, data: [...]}" "查询结果" @Failure 200 {string} string "{code:-1, msg:错误信息}" @Router /api/v1/db/columns [get]

type DBTable

type DBTable struct {
	DBTableService *service.DBTable
}

DBTable 数据库表管理

func NewDBTable

func NewDBTable() *DBTable

NewDBTable 数据库表实例化

func (*DBTable) Query

func (d *DBTable) Query(c *gin.Context)

Query 查询数据 @Tags 工具 @Security Bearer @Summary 数据库表分页列表 @Param pageIndex query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param tableName query string false "数据表名称" @Success 200 {string} string "{code: 200, data: [...]}" "查询结果" @Failure 200 {string} string "{code:-1, msg:错误信息}" @Router /api/v1/db/tables [get]

type Dept

type Dept struct {
	DeptService *service.Dept
	RoleService *service.Role
}

Dept 字典数据管理

func NewDept

func NewDept() *Dept

NewDept 字典实例化

func (*Dept) Create

func (d *Dept) Create(c *gin.Context)

Create 创建数据 @Tags 部门 @Security Bearer @Summary 添加部门 @Param body body model.Dept true "部门信息" @Success 200 string string "{code: 200, msg: 添加成功}" @Failure 200 string string "{code: -1, msg: 添加失败}" @Router /api/v1/depts [post]

func (*Dept) Delete

func (d *Dept) Delete(c *gin.Context)

Delete 删除数据 @Tags 部门 @Security Bearer @Summary 删除部门 @Param id path string true "id" @Success 200 string string "{code: 200, msg: 删除成功}" @Failure 200 string string "{code: -1, msg: 删除失败}" @Router /api/v1/depts/{id} [delete]

func (*Dept) Get

func (d *Dept) Get(c *gin.Context)

Get 查询指定数据 @Tags 部门 @Security Bearer @Summary 通过ID获取部门信息 @Param id path int true "部门ID" @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/depts/{id} [get]

func (*Dept) GetDeptTree

func (d *Dept) GetDeptTree(c *gin.Context)

GetDeptTree 部门树 @Tags 部门 @Security Bearer @Summary 查看部门树数据 @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/dept_tree [get]

func (*Dept) GetDeptTreeWithRole

func (d *Dept) GetDeptTreeWithRole(c *gin.Context)

GetDeptTreeWithRole 角色部门树 @Tags 部门 @Security Bearer @Summary 查看角色部门树数据 @Param id path string true "角色ID" @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/role_dept_treeselect/:id [get]

func (*Dept) Query

func (d *Dept) Query(c *gin.Context)

Query 查询数据 @Tags 部门 @Security Bearer @Summary 部门列表数据 @Param pageIndex query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param deptName query string false "部门名称" @Param status query string false "status" @Success 200 string string "{code: 200, data: [...]}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/depts [get]

func (*Dept) Update

func (d *Dept) Update(c *gin.Context)

Update 更新数据 @Tags 部门 @Security Bearer @Summary 修改部门 @Param body body model.Dept true "部门信息" @Success 200 string string "{code: 200, msg: 更新成功}" @Failure 200 string string "{code: -1, msg: 更新失败}" @Router /api/v1/depts [put]

type DictData

type DictData struct {
	DictDataService *service.DictData
}

DictData 字典数据管理

func NewDictData

func NewDictData() *DictData

NewDictData 字典实例化

func (*DictData) Create

func (d *DictData) Create(c *gin.Context)

Create 创建数据 @Tags 字典数据 @Security Bearer @Summary 添加字典数据 @Param body body model.DictData true "字典数据" @Success 200 string string "{code: 200, msg: 添加成功}" @Failure 200 string string "{code: -1, msg: 添加失败}" @Router /api/v1/dicts [post]

func (*DictData) Delete

func (d *DictData) Delete(c *gin.Context)

Delete 删除数据 @Tags 字典数据 @Security Bearer @Summary 删除字典数据 @Param id path string true "id" @Success 200 string string "{code: 200, msg: 删除成功}" @Failure 200 string string "{code: -1, msg: 删除失败}" @Router /api/v1/dicts/{id} [delete]

func (*DictData) Get

func (d *DictData) Get(c *gin.Context)

Get 查询指定数据 @Tags 字典数据 @Security Bearer @Summary 通过编码获取字典数据 @Param id path int true "字典编码" @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/dicts/{id} [get]

func (*DictData) GetWithType

func (d *DictData) GetWithType(c *gin.Context)

GetWithType 查询指定类型数据 @Tags 字典数据 @Security Bearer @Summary 通过字典类型获取字典数据 @Param type path int true "字典类型" @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/dict_datas/{type} [get]

func (*DictData) Query

func (d *DictData) Query(c *gin.Context)

Query 查询数据 @Tags 字典数据 @Security Bearer @Summary 字典数据列表 @Param pageIndex query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param status query string false "status" @Param id query string false "字典码" @Param dictType query string false "字典类型" @Success 200 string string "{code: 200, data: [...]}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/dicts [get]

func (*DictData) Update

func (d *DictData) Update(c *gin.Context)

Update 更新数据 @Tags 字典数据 @Security Bearer @Summary 更新字典数据 @Param body body model.DictData true "字典数据" @Success 200 string string "{code: 200, msg: 更新成功}" @Failure 200 string string "{code: -1, msg: 更新失败}" @Router /api/v1/dicts [put]

type DictType

type DictType struct {
	DictTypeService *service.DictType
}

DictType 字典类型管理

func NewDictType

func NewDictType() *DictType

NewDictType 字典类型实例化

func (*DictType) Create

func (d *DictType) Create(c *gin.Context)

Create 创建数据 @Tags 字典类型 @Security Bearer @Summary 添加字典类型 @Param body body model.DictType true "字典类型" @Success 200 {string} string "{code: 200, msg: 添加成功}" @Failure 200 {string} string "{code: -1, msg: 添加失败}" @Router /api/v1/dict_types [post]

func (*DictType) Delete

func (d *DictType) Delete(c *gin.Context)

Delete 删除数据 @Tags 字典类型 @Security Bearer @Summary 删除字典类型 @Param id path string true "字典ID" @Success 200 {string} string "{code: 200, msg: 删除成功}" @Failure 200 {string} string "{code: -1, msg: 删除失败}" @Router /api/v1/dict_types/{id} [delete]

func (*DictType) Get

func (d *DictType) Get(c *gin.Context)

Get 查询指定数据 @Tags 字典类型 @Security Bearer @Summary 通过字典ID获取字典类型 @Param id path int true "字典类型编码" @Success 200 {string} string "{code: 200, data: {}}" "查询结果" @Failure 200 {string} string "{code:-1, msg:错误信息}" @Router /api/v1/dict_types/{id} [get]

func (*DictType) GetWithOptionSelect

func (d *DictType) GetWithOptionSelect(c *gin.Context)

GetWithOptionSelect 查询选择项数据 @Tags 字典类型 @Security Bearer @Summary 通过字典类型获取选择项数据 @Param id path int true "字典类型ID" @Query name query string false "字典类型名称" @Success 200 {string} string "{code: 200, data: {}}" "查询结果" @Failure 200 {string} string "{code:-1, msg:错误信息}" @Router /api/v1/dict_options/{id} [get]

func (*DictType) Query

func (d *DictType) Query(c *gin.Context)

Query 查询数据 @Tags 字典类型 @Security Bearer @Summary 字典类型列表 @Param pageIndex query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param name query string false "字典名称" @Param type query string false "字典类型" @Success 200 {string} string "{code: 200, data: [...]}" "查询结果" @Failure 200 {string} string "{code:-1, msg:错误信息}" @Router /api/v1/dict_types [get]

func (*DictType) Update

func (d *DictType) Update(c *gin.Context)

Update 更新数据 @Tags 字典类型 @Security Bearer @Summary 更新字典类型 @Param body body model.DictType true "字典类型数据" @Success 200 {string} string "{code: 200, msg: 更新成功}" @Failure 200 {string} string "{code: -1, msg: 更新失败}" @Router /api/v1/dict_types [put]

type FileDir

type FileDir struct {
	FileDirService *service.FileDir
}

FileDir 文件夹管理

func NewFileDir

func NewFileDir() *FileDir

NewFileDir 文件夹实例化

func (*FileDir) Create

func (d *FileDir) Create(c *gin.Context)

Create 创建数据 @Tags 文件夹 @Security Bearer @Summary 添加文件夹数据 @Param body body model.FileDir true "文件夹信息" @Success 200 {string} string "{code: 200, msg: 添加成功}" @Failure 200 {string} string "{code: -1, msg: 添加失败}" @Router /api/v1/file_dirs [post]

func (*FileDir) Delete

func (d *FileDir) Delete(c *gin.Context)

Delete 删除数据 @Tags 文件夹 @Security Bearer @Summary 删除文件夹信息 @Param id path string true "文件夹ID"" @Success 200 {string} string "{code: 200, msg: 删除成功}" @Failure 200 {string} string "{code: -1, msg: 删除失败}" @Router /api/v1/file_dirs/{id} [delete]

func (*FileDir) Get

func (d *FileDir) Get(c *gin.Context)

Get 查询指定数据 @Tags 文件夹 @Security Bearer @Summary 通过ID取文件夹信息 @Param id path int true "文件夹ID" @Success 200 {string} string "{code: 200, data: {}}" "查询结果" @Failure 200 {string} string "{code:-1, msg:错误信息}" @Router /api/v1/file_dirs/{id} [get]

func (*FileDir) Query

func (d *FileDir) Query(c *gin.Context)

Query 查询数据 @Tags 文件夹 @Security Bearer @Summary 文件夹列表 @Param pageIndex query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param id query string false "id" @Param pid query string false "pid" @Success 200 {string} string "{code: 200, data: [...]}" "查询结果" @Failure 200 {string} string "{code:-1, msg:错误信息}" @Router /api/v1/file_dirs [get]

func (*FileDir) Update

func (d *FileDir) Update(c *gin.Context)

Update 更新数据 @Tags 文件夹 @Security Bearer @Summary 更新文件夹信息 @Param body body model.FileDir true "文件夹信息" @Success 200 {string} string "{code: 200, msg: 更新成功}" @Failure 200 {string} string "{code: -1, msg: 更新失败}" @Router /api/v1/file_dirs [put]

type FileInfo

type FileInfo struct {
	FileInfoService *service.FileInfo
}

FileInfo 文件信息管理

func NewFileInfo

func NewFileInfo() *FileInfo

NewFileInfo 字典实例化

func (*FileInfo) Create

func (d *FileInfo) Create(c *gin.Context)

Create 创建数据 @Tags 文件信息 @Security Bearer @Summary 添加文件信息 @Param body body model.FileInfo true "文件信息" @Success 200 {string} string "{code: 200, msg: 添加成功}" @Failure 200 {string} string "{code: -1, msg: 添加失败}" @Router /api/v1/file_infos [post]

func (*FileInfo) Delete

func (d *FileInfo) Delete(c *gin.Context)

Delete 删除数据 @Tags 文件信息 @Security Bearer @Summary 删除文件信息 @Param id path string true "id" @Success 200 {string} string "{code: 200, msg: 删除成功}" @Failure 200 {string} string "{code: -1, msg: 删除失败}" @Router /api/v1/file_infos/{id} [delete]

func (*FileInfo) Get

func (d *FileInfo) Get(c *gin.Context)

Get 查询指定数据 @Tags 文件信息 @Security Bearer @Summary 通过编码获取字典数据 @Param id path int true "文件ID" @Success 200 {string} string "{code: 200, data: {}}" "查询结果" @Failure 200 {string} string "{code:-1, msg:错误信息}" @Router /api/v1/file_infos/{id} [get]

func (*FileInfo) Query

func (d *FileInfo) Query(c *gin.Context)

Query 查询数据 @Tags 文件信息 @Security Bearer @Summary 文件信息列表 @Param pageIndex query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param pId query string false "pId" @Success 200 {string} string "{code: 200, data: [...]}" "查询结果" @Failure 200 {string} string "{code:-1, msg:错误信息}" @Router /api/v1/file_infos [get]

func (*FileInfo) Update

func (d *FileInfo) Update(c *gin.Context)

Update 更新数据 @Tags 文件信息 @Security Bearer @Summary 更新文件信息 @Param body body model.FileInfo true "文件信息" @Success 200 {string} string "{code: 200, msg: 更新成功}" @Failure 200 {string} string "{code: -1, msg: 更新失败}" @Router /api/v1/file_infos [put]

type FileResponse

type FileResponse struct {
	Size     int64  `json:"size"`
	Path     string `json:"path"`
	FullPath string `json:"full_path"`
	Name     string `json:"name"`
	Type     string `json:"type"`
}

FileResponse 文件返回内容

type Generate

type Generate struct {
	GenerateService *service.Generate
	TableService    *service.Tables
	ColumnService   *service.Column
}

Generate 生成

func NewGenerate

func NewGenerate() *Generate

NewGenerate 生成实例

func (*Generate) GenCode

func (a *Generate) GenCode(c *gin.Context)

GenCode 生成代码 @Tags 工具 @Security Bearer @Summary 生成代码信息 @Param id path int true "表ID" @Success 200 {string} string "{code: 200, msg: 更新成功}" @Failure 200 {string} string "{code: -1, msg: 更新失败}" @Router /api/v1/gen/toproject/:id [get]

func (*Generate) GenConfig

func (a *Generate) GenConfig(c *gin.Context)

GenConfig 生成菜单和api配置 @Tags 工具 @Security Bearer @Summary 生成菜单和api配置信息 @Param id path int true "表ID" @Success 200 {string} string "{code: 200, msg: 更新成功}" @Failure 200 {string} string "{code: -1, msg: 更新失败}" @Router /api/v1/gen/todb/:id [get]

func (*Generate) Preview

func (a *Generate) Preview(c *gin.Context)

Preview 预览 @Tags 工具 @Security Bearer @Summary 预览代码信息 @Param id path int true "表ID" @Success 200 {string} string "{code: 200, msg: 更新成功}" @Failure 200 {string} string "{code: -1, msg: 更新失败}" @Router /api/v1/gen/preview/:id [get]

type Login

type Login struct {
	Auth            auth.Auther
	UserService     *service.User
	RoleMenuService *service.RoleMenu
	LoginLogService *service.LoginLog
}

Login 登录管理

func NewLogin

func NewLogin(auth auth.Auther) *Login

NewLogin 登录实例

func (*Login) GetUserInfo

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

GetUserInfo 获取当前用户信息 @Tags 登录管理 @Summary 获取当前用户信息 @Security Bearer @Success 200 {object} ginx.Response @Failure 401 {object} ginx.Response "{error:{code:0,message:未授权}}" @Failure 500 {object} ginx.Response "{error:{code:0,message:服务器错误}}" @Router /api/v1/getinfo [get]

func (*Login) LogOut

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

LogOut 退出系统 @Tags 登录管理 @Summary 退出登录 @Security Bearer @Success 200 {object} ginx.Response "{code:200,msg:成功退出系统}" @Failure 400 {object} ginx.Response "{code:-1,msg:退出系统失败}" @Router /api/v1/logout [post]

func (*Login) Login

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

Login 登陆 @Tags 登录管理 @Summary 系统登录 @Param body body param.LoginParam true "登录参数" @Success 200 {string} string "{"code": 200, "expire": "2019-08-07T12:45:48+08:00", "token": ".eyJleHAiOjE1NjUxNTMxNDgsImlkIjoiYWRtaW4iLCJvcmlnX2lhdCI6MTU2NTE0OTU0OH0.-zvzHvbg0A" }" @Failure 400 {object} ginx.Response "{code:-1, msg:登录失败}" @Router /login [post]

func (*Login) RefreshToken

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

RefreshToken 刷新Token @Tags 登录管理 @Summary 刷新认证Token @Security Bearer @Success 200 {object} ginx.Response "{code:200,msg:刷新成功}" @Failure 400 {object} ginx.Response "{code:-1,msg:刷新失败}" @Router /api/v1/refresh_token [get]

type LoginLog

type LoginLog struct {
	LoginLogService *service.LoginLog
}

LoginLog 登录日志管理

func NewLoginLog

func NewLoginLog() *LoginLog

NewLoginLog 字典实例化

func (*LoginLog) Create

func (d *LoginLog) Create(c *gin.Context)

Create 创建数据 @Tags 登录日志 @Security Bearer @Summary 添加登录日志 @Param body body model.LoginLog true "登录日志信息" @Success 200 string string "{code: 200, msg: 添加成功}" @Failure 200 string string "{code: -1, msg: 添加失败}" @Router /api/v1/loginlogs [post]

func (*LoginLog) Delete

func (d *LoginLog) Delete(c *gin.Context)

Delete 删除数据 @Tags 登录日志 @Security Bearer @Summary 删除登录日志 @Param id path string true "日志ID" @Success 200 string string "{code: 200, msg: 删除成功}" @Failure 200 string string "{code: -1, msg: 删除失败}" @Router /api/v1/loginlogs/{id} [delete]

func (*LoginLog) Get

func (d *LoginLog) Get(c *gin.Context)

Get 查询指定数据 @Tags 登录日志 @Security Bearer @Summary 通过ID获取登录日志 @Param id path int true "登录日志ID" @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/loginlogs/{id} [get]

func (*LoginLog) Query

func (d *LoginLog) Query(c *gin.Context)

Query 查询数据 @Tags 登录日志 @Security Bearer @Summary 登录日志列表 @Param pageIndex query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param status query string false "status" @Param userName query string false "username" @Param ipAddr query string false "ipaddr" @Success 200 string string "{code: 200, data: [...]}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/loginlogs [get]

func (*LoginLog) Update

func (d *LoginLog) Update(c *gin.Context)

Update 更新数据 @Tags 登录日志 @Security Bearer @Summary 更新登录日志 @Param body body model.LoginLog true "登录日志" @Success 200 string string "{code: 200, msg: 更新成功}" @Failure 200 string string "{code: -1, msg: 更新失败}" @Router /api/v1/loginlogs [put]

type Menu struct {
	MenuService *service.Menu
	RoleService *service.Role
}

Menu 菜单管理

func NewMenu

func NewMenu() *Menu

NewMenu 菜单实例化

func (d *Menu) Create(c *gin.Context)

Create 创建数据 @Tags 菜单 @Security ApiKeyAuth @Summary 添加菜单数据 @Param body body model.Menu true "菜单数据" @Success 200 {object} ginx.Response "{code: 200, msg: 添加成功}" @Failure 400 {object} ginx.Response "{code: -1, msg: 添加失败}" @Router /api/v1/menus [post]

func (d *Menu) Delete(c *gin.Context)

Delete 删除数据 @Tags 菜单 @Security ApiKeyAuth @Summary 删除菜单数据 @Param id path string true "菜单ID" @Success 200 {object} ginx.Response "{code: 200, msg: 删除成功}" @Failure 400 {object} ginx.Response "{code: -1, msg: 删除失败}" @Router /api/v1/menus/{id} [delete]

func (d *Menu) Get(c *gin.Context)

Get 查询指定数据 @Tags 菜单 @Security ApiKeyAuth @Summary 通过菜单ID获取菜单数据 @Param id query string false "菜单ID" @Success 200 {object} ginx.Response{data=model.Menu} "菜单详情" @Failure 400 {object} ginx.Response "{code:-1, msg:错误信息}" @Router /api/v1/menus/{id} [get]

func (d *Menu) GetLeftMenu(c *gin.Context)

GetLeftMenu 查询左侧菜单 @Tags 菜单 @Security ApiKeyAuth @Summary 根据角色名称获取菜单列表数据(左菜单使用) @Success 200 {object} ginx.Response{data=[]model.Menu} @Failure 400 {object} ginx.Response "{code:-1, msg:错误信息}" @Router /api/v1/menu_role [get]

func (d *Menu) GetTreeWithRole(c *gin.Context)

GetTreeWithRole 查询角色菜单树数据 @Tags 菜单 @Security ApiKeyAuth @Summary 查询角色菜单树数据 @Param id path int true "角色ID" @Success 200 {object} ginx.Response "{code:200, data:{}}" @Failure 400 {object} ginx.Response "{code:-1, msg:错误信息}" @Router /api/v1/role_menu_treeselect/:id [get]

func (d *Menu) Query(c *gin.Context)

Query 查询数据 @Tags 菜单 @Security ApiKeyAuth @Summary 菜单数据列表 @Param title query string false "title" @Param visible query string false "visible" @Param menu_name query string false "菜单名称" @Success 200 {object} ginx.Response{data=[]model.Menu} "查询结果" @Failure 400 {object} ginx.Response "{"code":-1,"msg":"错误信息"}" @Router /api/v1/menus [get]

func (d *Menu) TreeMenu(c *gin.Context)

TreeMenu 菜单树 @Tags 菜单 @Security ApiKeyAuth @Summary 获取菜单树 @Success 200 {object} ginx.Response "{code: 200, data: {}}" @Failure 400 {object} ginx.Response "{code:-1, msg:错误信息}" @Router /api/v1/menu_treeselect [get]

func (d *Menu) Update(c *gin.Context)

Update 更新数据 @Tags 菜单 @Security ApiKeyAuth @Summary 更新菜单数据 @Param body body model.Menu true "更新菜单" @Success 200 {object} ginx.Response "{code: 200, msg: 更新成功}" @Failure 400 {object} ginx.Response "{code: -1, msg: 更新失败}" @Router /api/v1/menus [put]

type Monitor

type Monitor struct {
	MonitoeService *service.Monitor
}

Monitor 监控管理

func NewMonitor

func NewMonitor() *Monitor

NewMonitor 监控实例

func (*Monitor) ServerInfo

func (a *Monitor) ServerInfo(c *gin.Context)

ServerInfo 系统信息 @Tags 系统信息 @Security Bearer @Summary 查看系统信息 @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/settings/server_info [get]

type OperLog

type OperLog struct {
	OperLogService *service.OperLog
}

OperLog 操作日志管理

func NewOperLog

func NewOperLog() *OperLog

NewOperLog 操作日志实例化

func (*OperLog) Create

func (d *OperLog) Create(c *gin.Context)

Create 创建数据 @Tags 操作日志 @Security Bearer @Summary 添加操作日志 @Param body body model.OperLog true "操作日志" @Success 200 string string "{code: 200, msg: 添加成功}" @Failure 200 string string "{code: -1, msg: 添加失败}" @Router /api/v1/operlogs [post]

func (*OperLog) Delete

func (d *OperLog) Delete(c *gin.Context)

Delete 删除数据 @Tags 操作日志 @Security Bearer @Summary 删除操作日志 @Param id path string true "以逗号(,)分割的id" @Success 200 string string "{code: 200, msg: 删除成功}" @Failure 200 string string "{code: -1, msg: 删除失败}" @Router /api/v1/operlogs/{id} [delete]

func (*OperLog) Get

func (d *OperLog) Get(c *gin.Context)

Get 查询指定数据 @Tags 操作日志 @Security Bearer @Summary 通过ID获取操作日志 @Param id path int true "日志ID" @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/operlogs/{id} [get]

func (*OperLog) Query

func (d *OperLog) Query(c *gin.Context)

Query 查询数据 @Tags 操作日志 @Security Bearer @Summary 操作日志列表 @Param pageIndex query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param status query string false "状态" @Param operName query string false "操作人" @Param operIp query string false "操作IP" @Success 200 string string "{code: 200, data: [...]}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/operlogs [get]

type Post

type Post struct {
	PostService *service.Post
}

Post 岗位管理

func NewPost

func NewPost() *Post

NewPost 字典实例化

func (*Post) Create

func (d *Post) Create(c *gin.Context)

Create 创建数据 @Tags 岗位 @Security Bearer @Summary 添加岗位 @Param body body model.Post true "岗位信息" @Success 200 string string "{code: 200, msg: 添加成功}" @Failure 200 string string "{code: -1, msg: 添加失败}" @Router /api/v1/posts [post]

func (*Post) Delete

func (d *Post) Delete(c *gin.Context)

Delete 删除数据 @Tags 岗位 @Security Bearer @Summary 删除岗位信息 @Param id path string true "职务ID" @Success 200 string string "{code: 200, msg: 删除成功}" @Failure 200 string string "{code: -1, msg: 删除失败}" @Router /api/v1/posts/{id} [delete]

func (*Post) Get

func (d *Post) Get(c *gin.Context)

Get 查询指定数据 @Tags 岗位 @Security Bearer @Summary 获取岗位信息 @Param id path int true "岗位ID" @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/posts/{id} [get]

func (*Post) Query

func (d *Post) Query(c *gin.Context)

Query 查询数据 @Tags 岗位 @Security Bearer @Summary 岗位列表 @Param pageIndex query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param postName query string false "岗位名称" @Param postCode query string false "岗位编码" @Param status query string false "status" @Success 200 string string "{code: 200, data: [...]}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/posts [get]

func (*Post) Update

func (d *Post) Update(c *gin.Context)

Update 更新数据 @Tags 岗位 @Security Bearer @Summary 更新岗位信息 @Param body body model.Post true "岗位信息" @Success 200 string string "{code: 200, msg: 更新成功}" @Failure 200 string string "{code: -1, msg: 更新失败}" @Router /api/v1/posts [put]

type Role

type Role struct {
	RoleService *service.Role
}

Role 角色管理

func NewRole

func NewRole(e *casbin.SyncedEnforcer) *Role

NewRole 角色实例化

func (*Role) Create

func (d *Role) Create(c *gin.Context)

Create 创建数据 @Tags 角色 @Security Bearer @Summary 创建角色 @Param body body model.Role true "角色信息" @Success 200 string string "{code: 200, msg: 添加成功}" @Failure 200 string string "{code: -1, msg: 添加失败}" @Router /api/v1/roles [post]

func (*Role) Delete

func (d *Role) Delete(c *gin.Context)

Delete 删除数据 @Tags 角色 @Security Bearer @Summary 删除角色数据 @Param id path int true "角色ID" @Success 200 string string "{code: 200, msg: 删除成功}" @Failure 200 string string "{code: -1, msg: 删除失败}" @Router /api/v1/roles/{id} [delete]

func (*Role) Get

func (d *Role) Get(c *gin.Context)

Get 查询指定数据 @Tags 角色 @Security Bearer @Summary 通过角色ID获取角色数据 @Param id path string false "角色ID" @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/roles/{id} [get]

func (*Role) Query

func (d *Role) Query(c *gin.Context)

Query 查询数据 @Tags 角色 @Security Bearer @Summary 角色列表 @Param pageIndex query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param rolName query string false "角色名称" @Param status query string false "status" @Param roleKey query string false "角色key" @Success 200 string string "{code: 200, data: [...]}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/roles [get]

func (*Role) Update

func (d *Role) Update(c *gin.Context)

Update 更新数据 @Tags 角色 @Security Bearer @Summary 更新角色信息 @Param body body model.Role true "角色信息" @Success 200 string string "{code: 200, msg: 更新成功}" @Failure 200 string string "{code: -1, msg: 更新失败}" @Router /api/v1/roles [put]

func (*Role) UpdateDataScope

func (d *Role) UpdateDataScope(c *gin.Context)

UpdateDataScope 更新数据权限 @Tags 角色 @Security Bearer @Summary 更新数据权限 @Param body body model.Role true "角色信息" @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/roles/datascope [put]

type RoleMenu

type RoleMenu struct {
	RoleMenuService *service.RoleMenu
}

RoleMenu 角色菜单

func NewRoleMenu

func NewRoleMenu() *RoleMenu

NewRoleMenu 角色菜单实例

func (*RoleMenu) DeleteRoleMenu

func (d *RoleMenu) DeleteRoleMenu(c *gin.Context)

DeleteRoleMenu 删除角色菜单信息 @Tags 角色菜单 @Security Bearer @Summary 删除数据角色菜单数据 @Param id path string true "角色ID" @Param menu_id query string false "菜单ID" @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/rolemenu/{id} [delete]

func (*RoleMenu) GetRoleMenu

func (d *RoleMenu) GetRoleMenu(c *gin.Context)

GetRoleMenu 获取角色菜单信息 @Tags 角色菜单 @Security Bearer @Summary 角色菜单列表数据 @Param id query string false "角色ID" @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/rolemenu [get]

type Setting

type Setting struct {
	SettingService *service.Setting
}

Setting 设置管理

func NewSetting

func NewSetting() *Setting

NewSetting 设置实例

func (*Setting) Create

func (d *Setting) Create(c *gin.Context)

Create 创建数据 @Tags 系统信息 @Security Bearer @Summary 添加系统信息 @Param body body model.Setting true "设置信息" @Success 200 string string "{code: 200, msg: 添加成功}" @Failure 200 string string "{code: -1, msg: 添加失败}" @Router /api/v1/system/setting [post]

func (*Setting) Get

func (d *Setting) Get(c *gin.Context)

Get 查询系统信息 @Tags 系统信息 @Security Bearer @Summary 查询系统信息 @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/setting [get]

type Tables

type Tables struct {
	TablesService *service.Tables
	ColumnService *service.Column
}

Tables 字典数据管理

func NewTables

func NewTables() *Tables

NewTables 字典实例化

func (*Tables) Create

func (d *Tables) Create(c *gin.Context)

Create 创建数据 @Tags 工具 @Security Bearer @Summary 添加表结构 @Param body body model.Tables true "结构数据" @Success 200 {string} string "{code: 200, msg: 添加成功}" @Failure 200 {string} string "{code: -1, msg: 添加失败}" @Router /api/v1/sys/tables [post]

func (*Tables) Delete

func (d *Tables) Delete(c *gin.Context)

Delete 删除数据 @Tags 工具 @Security Bearer @Summary 删除表结构 @Param id path string true "表ID" @Success 200 {string} string "{code: 200, msg: 删除成功}" @Failure 200 {string} string "{code: -1, msg: 删除失败}" @Router /api/v1/sys/tables/{id} [delete]

func (*Tables) Get

func (d *Tables) Get(c *gin.Context)

Get 查询指定数据 @Tags 工具 @Security Bearer @Summary 通过编码获取字典数据 @Param id path int true "表ID" @Success 200 {string} string "{code: 200, data: {}}" "查询结果" @Failure 200 {string} string "{code:-1, msg:错误信息}" @Router /api/v1/sys/tables/{id} [get]

func (*Tables) GetInfo

func (d *Tables) GetInfo(c *gin.Context)

GetInfo 获取表信息 @Tags 工具 @Security Bearer @Summary 通过表名获取表数据 @Param table_name query int true "表名称" @Success 200 {string} string "{code: 200, data: {}}" "查询结果" @Failure 200 {string} string "{code:-1, msg:错误信息}" @Router /api/v1/sys/table_info [get]

func (*Tables) Query

func (d *Tables) Query(c *gin.Context)

Query 查询数据 @Tags 工具 @Security Bearer @Summary 生成表分页列表 @Param pageIndex query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param tableName query string false "数据表名称" @Param tableComment query string false "数据表注释(说明)" @Success 200 {string} string "{code: 200, data: [...]}" "查询结果" @Failure 200 {string} string "{code:-1, msg:错误信息}" @Router /api/v1/sys/tables [get]

func (*Tables) Tree

func (d *Tables) Tree(c *gin.Context)

Tree 表结构 @Tags 工具 @Security Bearer @Summary 查询表结构 @Success 200 {string} string "{code: 200, data: {}}" "查询结果" @Failure 200 {string} string "{code:-1, msg:错误信息}" @Router /api/v1/gen/tabletree [get]

func (*Tables) Update

func (d *Tables) Update(c *gin.Context)

Update 更新数据 @Tags 工具 @Security Bearer @Summary 更新表结构 @Param body body model.Tables true "表结构数据" @Success 200 {string} string "{code: 200, msg: 更新成功}" @Failure 200 {string} string "{code: -1, msg: 更新失败}" @Router /api/v1/sys/tables [put]

type Upload

type Upload struct {
}

Upload 上传

func NewUpload

func NewUpload() *Upload

NewUpload 上传实例

func (*Upload) UploadFile

func (u *Upload) UploadFile(c *gin.Context)

@Summary 上传图片 @Description 获取JSON @Tags 公共接口 @Accept multipart/form-data @Param type query string true "type" (1:单图,2:多图, 3:base64图片) @Param file formData file true "file" @Success 200 {string} string "{"code": 200, "message": "添加成功"}" @Success 200 {string} string "{"code": -1, "message": "添加失败"}" @Router /api/v1/public/upload_file [post]

type User

type User struct {
	UserService *service.User
	RoleService *service.Role
	PostService *service.Post
	DeptService *service.Dept
}

User 系统用户管理

func NewUser

func NewUser() *User

NewUser 系统用户实例

func (*User) Create

func (d *User) Create(c *gin.Context)

Create 创建数据 @Tags 系统用户 @Security Bearer @Summary 添加用户数据 @Param body body model.User true "用户数据" @Success 200 string string "{code: 200, msg: 添加成功}" @Failure 200 string string "{code: -1, msg: 添加失败}" @Router /api/v1/sys_users [post]

func (*User) Delete

func (d *User) Delete(c *gin.Context)

Delete 删除数据 @Tags 系统用户 @Security Bearer @Summary 删除用户数据 @Param id path int true "id" @Success 200 string string "{code: 200, msg: 删除成功}" @Failure 200 string string "{code: -1, msg: 删除失败}" @Router /api/v1/sys_users/{id} [delete]

func (*User) Get

func (d *User) Get(c *gin.Context)

Get 查询指定数据 @Tags 系统用户 @Security Bearer @Summary 通过用户ID查询用户信息,待优化 @Param id path int true "用户ID" @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/sys_users/{id} [get]

func (*User) GetProfile

func (d *User) GetProfile(c *gin.Context)

GetProfile 个人中心数据 @Tags 系统用户 @Security Bearer @Summary 获取个人中心用户,待优化 @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/user/profile [get]

func (*User) GetUserInit

func (d *User) GetUserInit(c *gin.Context)

GetUserInit 用户角色和职位数据 @Tags 系统用户 @Security Bearer @Summary 获取用户角色和职位 @Success 200 string string "{code: 200, data: {}}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/sys_users [get]

func (*User) Query

func (d *User) Query(c *gin.Context)

Query 查询数据 @Tags 系统用户 @Security Bearer @Summary 用户信息列表 @Param pageIndex query int true "分页索引" default(1) @Param pageSize query int true "分页大小" default(10) @Param username query string false "用户名" @Param status query string false "状态" @Param phone query string false "手机号" @Param postId query int false "岗位ID" @Param deptId query int false "部门ID" @Success 200 string string "{code: 200, data: [...]}" "查询结果" @Failure 200 string string "{code:-1, msg:错误信息}" @Router /api/v1/sys_user_list [get]

func (*User) Update

func (d *User) Update(c *gin.Context)

Update 更新数据 @Tags 系统用户 @Security Bearer @Summary 更新用户数据 @Param body body model.User true "用户数据" @Success 200 string string "{code: 200, msg: 更新成功}" @Failure 200 string string "{code: -1, msg: 更新失败}" @Router /api/v1/sys_users [put]

func (*User) UpdateAvatar

func (d *User) UpdateAvatar(c *gin.Context)

UpdateAvatar 修改头像 @Tags 系统用户 @Security Bearer @Summary 修改用户头像数据 @Param file formData file true "file" @Success 200 string string "{code: 200, msg: 修改成功}" @Failure 200 string string "{code: -1, msg: 修改失败}" @Router /api/v1/user/avatar [post]

func (*User) UpdatePassword

func (d *User) UpdatePassword(c *gin.Context)

UpdatePassword 修改密码 @Tags 系统用户 @Security Bearer @Summary 修改用户密码 @Success 200 string string "{code: 200, msg: 删除成功}" @Failure 200 string string "{code: -1, msg: 删除失败}" @Router /api/v1/user/pwd [put]

Jump to

Keyboard shortcuts

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