mirror of
https://github.com/tiger1103/gfast.git
synced 2026-09-21 02:04:07 +00:00
API接口文档完善
This commit is contained in:
+138
-16
@@ -26,7 +26,13 @@ import (
|
||||
//菜单用户组用户管理
|
||||
type Auth struct{}
|
||||
|
||||
//菜单列表
|
||||
// @Summary 分页列表
|
||||
// @Description 获取菜单列表
|
||||
// @Tags 菜单管理
|
||||
// @Param data body auth_rule.ReqSearch true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/auth/menuList [get]
|
||||
// @Security
|
||||
func (c *Auth) MenuList(r *ghttp.Request) {
|
||||
var req *auth_rule.ReqSearch
|
||||
//获取参数
|
||||
@@ -85,7 +91,15 @@ func (c *Auth) MenuSort(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "排序成功")
|
||||
}
|
||||
|
||||
//添加菜单
|
||||
// @Summary 添加菜单
|
||||
// @Description 添加菜单
|
||||
// @Tags 菜单管理
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body auth_rule.MenuReq true "data"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "添加成功"}"
|
||||
// @Router /system/auth/addMenu [post]
|
||||
// @Security Bearer
|
||||
func (c *Auth) AddMenu(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
menu := new(auth_rule.MenuReq)
|
||||
@@ -118,7 +132,15 @@ func (c *Auth) AddMenu(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "成功", g.Map{"parentList": listEntities})
|
||||
}
|
||||
|
||||
//修改菜单
|
||||
// @Summary 修改菜单
|
||||
// @Description 修改菜单
|
||||
// @Tags 菜单管理
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body auth_rule.MenuReq true "data"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "修改成功"}"
|
||||
// @Router /system/auth/editMenu [post]
|
||||
// @Security Bearer
|
||||
func (c *Auth) EditMenu(r *ghttp.Request) {
|
||||
id := r.GetInt("menuId")
|
||||
if r.Method == "POST" {
|
||||
@@ -162,7 +184,15 @@ func (c *Auth) EditMenu(r *ghttp.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
//删除菜单
|
||||
// @Summary 删除菜单
|
||||
// @Description 删除菜单
|
||||
// @Tags 菜单管理
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param ids body integer true "ids[1,2,3]"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "修改成功"}"
|
||||
// @Router /system/auth/deleteMenu [delete]
|
||||
// @Security Bearer
|
||||
func (c *Auth) DeleteMenu(r *ghttp.Request) {
|
||||
ids := r.GetInts("ids")
|
||||
if len(ids) == 0 {
|
||||
@@ -178,7 +208,13 @@ func (c *Auth) DeleteMenu(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "删除成功")
|
||||
}
|
||||
|
||||
//角色列表
|
||||
// @Summary 角色列表
|
||||
// @Description 分页列表
|
||||
// @Tags 角色管理
|
||||
// @Param data body role.SelectPageReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/auth/roleList [get]
|
||||
// @Security
|
||||
func (c *Auth) RoleList(r *ghttp.Request) {
|
||||
var req *role.SelectPageReq
|
||||
//获取参数
|
||||
@@ -204,7 +240,15 @@ func (c *Auth) RoleList(r *ghttp.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
//添加角色
|
||||
// @Summary 添加角色
|
||||
// @Description 添加角色
|
||||
// @Tags 角色管理
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body string true "data"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "添加成功"}"
|
||||
// @Router /system/auth/addRole [post]
|
||||
// @Security Bearer
|
||||
func (c *Auth) AddRole(r *ghttp.Request) {
|
||||
//添加操作
|
||||
if r.Method == "POST" {
|
||||
@@ -258,7 +302,15 @@ func (c *Auth) AddRole(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "成功", res)
|
||||
}
|
||||
|
||||
//修改角色
|
||||
// @Summary 修改角色
|
||||
// @Description 修改角色
|
||||
// @Tags 角色管理
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body string true "data"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "添加成功"}"
|
||||
// @Router /system/auth/editRole [post]
|
||||
// @Security Bearer
|
||||
func (c *Auth) EditRole(r *ghttp.Request) {
|
||||
id := r.GetRequestInt64("roleId")
|
||||
if r.Method == "POST" {
|
||||
@@ -330,7 +382,15 @@ func (c *Auth) EditRole(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "成功", res)
|
||||
}
|
||||
|
||||
//删除角色
|
||||
// @Summary 删除角色
|
||||
// @Description 删除角色
|
||||
// @Tags 角色管理
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param ids body integer true "ids[1,2,3]"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "添加成功"}"
|
||||
// @Router /system/auth/deleteRole [delete]
|
||||
// @Security Bearer
|
||||
func (c *Auth) DeleteRole(r *ghttp.Request) {
|
||||
ids := r.GetInts("ids")
|
||||
if len(ids) == 0 {
|
||||
@@ -345,7 +405,15 @@ func (c *Auth) DeleteRole(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "删除成功")
|
||||
}
|
||||
|
||||
//添加管理员
|
||||
// @Summary 添加用户
|
||||
// @Description 添加用户
|
||||
// @Tags 用户管理
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body user.AddUserReq true "data"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "添加成功"}"
|
||||
// @Router /system/auth/addUser [post]
|
||||
// @Security Bearer
|
||||
func (c *Auth) AddUser(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *user.AddUserReq
|
||||
@@ -389,7 +457,15 @@ func (c *Auth) AddUser(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "成功", res)
|
||||
}
|
||||
|
||||
//修改管理员
|
||||
// @Summary 编辑用户
|
||||
// @Description 编辑用户
|
||||
// @Tags 用户管理
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body user.EditUserReq true "data"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "添加成功"}"
|
||||
// @Router /system/auth/editUser [post]
|
||||
// @Security Bearer
|
||||
func (c *Auth) EditUser(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *user.EditUserReq
|
||||
@@ -459,7 +535,13 @@ func (c *Auth) EditUser(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "成功", res)
|
||||
}
|
||||
|
||||
//用户列表
|
||||
// @Summary 用户列表
|
||||
// @Description 分页列表
|
||||
// @Tags 用户管理
|
||||
// @Param data body user.SearchReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/Auth/userList [get]
|
||||
// @Security
|
||||
func (c *Auth) UserList(r *ghttp.Request) {
|
||||
var req *user.SearchReq
|
||||
//获取参数
|
||||
@@ -525,7 +607,15 @@ func (c *Auth) UserList(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "成功", res)
|
||||
}
|
||||
|
||||
//删除管理员
|
||||
// @Summary 删除管理员
|
||||
// @Description 删除管理员
|
||||
// @Tags 用户管理
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param ids path integer true "ids[1,2,3...]"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "添加成功"}"
|
||||
// @Router /system/auth/deleteAdmin [delete]
|
||||
// @Security Bearer
|
||||
func (c *Auth) DeleteAdmin(r *ghttp.Request) {
|
||||
ids := r.GetInts("ids")
|
||||
if len(ids) > 0 {
|
||||
@@ -552,7 +642,15 @@ func (c *Auth) DeleteAdmin(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "删除成功")
|
||||
}
|
||||
|
||||
//设置角色状态
|
||||
// @Summary 设置角色状态
|
||||
// @Description 设置角色状态
|
||||
// @Tags 用户管理
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body role.StatusSetReq true "data"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "添加成功"}"
|
||||
// @Router /system/auth/statusSetRole [post]
|
||||
// @Security Bearer
|
||||
func (c *Auth) StatusSetRole(r *ghttp.Request) {
|
||||
var req *role.StatusSetReq
|
||||
//获取参数
|
||||
@@ -566,7 +664,15 @@ func (c *Auth) StatusSetRole(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "状态设置成功")
|
||||
}
|
||||
|
||||
//角色数据权限分配
|
||||
// @Summary 角色数据权限分配
|
||||
// @Description 角色数据权限分配
|
||||
// @Tags 用户管理
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body role.DataScopeReq true "data"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "添加成功"}"
|
||||
// @Router /system/auth/roleDataScope [post]
|
||||
// @Security Bearer
|
||||
func (c *Auth) RoleDataScope(r *ghttp.Request) {
|
||||
var req *role.DataScopeReq
|
||||
//获取参数
|
||||
@@ -580,7 +686,15 @@ func (c *Auth) RoleDataScope(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "数据权限设置成功", req)
|
||||
}
|
||||
|
||||
//修改用户状态
|
||||
// @Summary 修改用户状态
|
||||
// @Description 修改用户状态
|
||||
// @Tags 用户管理
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body user.StatusReq true "data"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "添加成功"}"
|
||||
// @Router /system/auth/changeUserStatus [post]
|
||||
// @Security Bearer
|
||||
func (c *Auth) ChangeUserStatus(r *ghttp.Request) {
|
||||
var req *user.StatusReq
|
||||
//获取参数
|
||||
@@ -594,7 +708,15 @@ func (c *Auth) ChangeUserStatus(r *ghttp.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
//重置用户密码
|
||||
// @Summary 重置用户密码
|
||||
// @Description 重置用户密码
|
||||
// @Tags 用户管理
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body user.ResetPwdReq true "data"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "添加成功"}"
|
||||
// @Router /system/auth/resetUserPwd [post]
|
||||
// @Security Bearer
|
||||
func (c *Auth) ResetUserPwd(r *ghttp.Request) {
|
||||
var req *user.ResetPwdReq
|
||||
//获取参数
|
||||
|
||||
@@ -14,7 +14,13 @@ import (
|
||||
|
||||
type Dict struct{}
|
||||
|
||||
//字典列表
|
||||
// @Summary 字典列表
|
||||
// @Description 字典列表
|
||||
// @Tags 字典管理
|
||||
// @Param data body sys_dict_type.SelectPageReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/config/dict/list [get]
|
||||
// @Security
|
||||
func (c *Dict) List(r *ghttp.Request) {
|
||||
var req *sys_dict_type.SelectPageReq
|
||||
//获取参数
|
||||
@@ -40,7 +46,13 @@ func (c *Dict) List(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "字典列表", result)
|
||||
}
|
||||
|
||||
//添加字典
|
||||
// @Summary 添加字典
|
||||
// @Description 添加字典
|
||||
// @Tags 字典管理
|
||||
// @Param data body sys_dict_type.AddReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/config/dict/add [post]
|
||||
// @Security
|
||||
func (c *Dict) Add(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *sys_dict_type.AddReq
|
||||
@@ -63,7 +75,13 @@ func (c *Dict) Add(r *ghttp.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
//修改字典
|
||||
// @Summary 修改字典
|
||||
// @Description 修改字典
|
||||
// @Tags 字典管理
|
||||
// @Param data body sys_dict_type.EditReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/config/dict/edit [post]
|
||||
// @Security
|
||||
func (c *Dict) Edit(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *sys_dict_type.EditReq
|
||||
@@ -91,7 +109,13 @@ func (c *Dict) Edit(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "ok", entity)
|
||||
}
|
||||
|
||||
//字典数据列表
|
||||
// @Summary 字典数据列表
|
||||
// @Description 字典数据列表
|
||||
// @Tags 字典管理
|
||||
// @Param data body sys_dict_data.SelectDataPageReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/config/dict/dataList [get]
|
||||
// @Security
|
||||
func (c *Dict) DataList(r *ghttp.Request) {
|
||||
var req *sys_dict_data.SelectDataPageReq
|
||||
//获取参数
|
||||
@@ -119,7 +143,13 @@ func (c *Dict) DataList(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "ok", result)
|
||||
}
|
||||
|
||||
//添加数据字典
|
||||
// @Summary 添加数据字典
|
||||
// @Description 添加数据字典
|
||||
// @Tags 字典管理
|
||||
// @Param data body sys_dict_data.AddDataReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/config/dict/dataAdd [post]
|
||||
// @Security
|
||||
func (c *Dict) DataAdd(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *sys_dict_data.AddDataReq
|
||||
@@ -138,7 +168,13 @@ func (c *Dict) DataAdd(r *ghttp.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
//修改字典数据
|
||||
// @Summary 修改字典数据
|
||||
// @Description 修改字典数据
|
||||
// @Tags 字典管理
|
||||
// @Param data body sys_dict_data.EditDataReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/config/dict/dataEdit [post]
|
||||
// @Security
|
||||
func (c *Dict) DataEdit(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *sys_dict_data.EditDataReq
|
||||
@@ -164,7 +200,13 @@ func (c *Dict) DataEdit(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "ok", dictData)
|
||||
}
|
||||
|
||||
//删除字典
|
||||
// @Summary 删除字典
|
||||
// @Description 删除字典
|
||||
// @Tags 字典管理
|
||||
// @Param dictIds body string true "dictIds[1,2,3]"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/config/dict/delete [delete]
|
||||
// @Security
|
||||
func (c *Dict) Delete(r *ghttp.Request) {
|
||||
dictIds := r.GetInts("dictIds")
|
||||
if len(dictIds) == 0 {
|
||||
@@ -179,7 +221,13 @@ func (c *Dict) Delete(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "删除成功")
|
||||
}
|
||||
|
||||
//删除字典数据
|
||||
// @Summary 删除字典数据
|
||||
// @Description 删除字典数据
|
||||
// @Tags 字典管理
|
||||
// @Param ids body integer true "ids[1,2,3...]"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/config/dict/dataDelete [delete]
|
||||
// @Security
|
||||
func (c *Dict) DataDelete(r *ghttp.Request) {
|
||||
dictCodes := r.GetInts("ids")
|
||||
if len(dictCodes) == 0 {
|
||||
@@ -194,9 +242,12 @@ func (c *Dict) DataDelete(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "删除成功")
|
||||
}
|
||||
|
||||
/**
|
||||
状态
|
||||
*/
|
||||
// @Summary 字典状态
|
||||
// @Description 字典状态
|
||||
// @Tags 字典管理
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/config/dict/sysNormalDisable [post]
|
||||
// @Security
|
||||
func (c *Dict) SysNormalDisable(r *ghttp.Request) {
|
||||
//菜单正常or停用状态
|
||||
statusOptions, err := dict_service.GetDictWithDataByType("sys_normal_disable", "", "")
|
||||
|
||||
@@ -14,7 +14,13 @@ import (
|
||||
|
||||
type Params struct{}
|
||||
|
||||
//参数列表
|
||||
// @Summary 参数列表
|
||||
// @Description 参数列表
|
||||
// @Tags 参数管理
|
||||
// @Param data body sys_config.SelectPageReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/config/params/list [get]
|
||||
// @Security
|
||||
func (c *Params) List(r *ghttp.Request) {
|
||||
var req *sys_config.SelectPageReq
|
||||
//获取参数
|
||||
@@ -39,7 +45,13 @@ func (c *Params) List(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "字典列表", result)
|
||||
}
|
||||
|
||||
//添加参数
|
||||
// @Summary 添加参数
|
||||
// @Description 添加参数
|
||||
// @Tags 参数管理
|
||||
// @Param data body sys_config.AddReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/config/params/add [post]
|
||||
// @Security
|
||||
func (c *Params) Add(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *sys_config.AddReq
|
||||
@@ -61,7 +73,13 @@ func (c *Params) Add(r *ghttp.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
//修改参数
|
||||
// @Summary 修改参数
|
||||
// @Description 修改参数
|
||||
// @Tags 参数管理
|
||||
// @Param data body sys_config.EditReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/config/params/edit [post]
|
||||
// @Security
|
||||
func (c *Params) Edit(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *sys_config.EditReq
|
||||
@@ -89,7 +107,13 @@ func (c *Params) Edit(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "ok", params)
|
||||
}
|
||||
|
||||
//删除参数
|
||||
// @Summary 删除参数
|
||||
// @Description 删除参数
|
||||
// @Tags 参数管理
|
||||
// @Param ids body integer true "ids[1,2,3...]"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/config/params/delete [delete]
|
||||
// @Security
|
||||
func (c *Params) Delete(r *ghttp.Request) {
|
||||
ids := r.GetInts("ids")
|
||||
if len(ids) == 0 {
|
||||
|
||||
@@ -16,8 +16,7 @@ type Dept struct{}
|
||||
// @Summary 分页部门列表数据
|
||||
// @Description 分页列表
|
||||
// @Tags 部门
|
||||
// @Param deptName query string false "deptName"
|
||||
// @Param status query string false "status"
|
||||
// @Param data body sys_dept.SearchParams true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dept/list [get]
|
||||
// @Security
|
||||
|
||||
@@ -16,7 +16,13 @@ import (
|
||||
|
||||
type Gen struct{}
|
||||
|
||||
//查询数据库列表
|
||||
// @Summary 查询数据库列表
|
||||
// @Description 查询数据库列表
|
||||
// @Tags 系统工具
|
||||
// @Param data body gen_table.SelectPageReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/tools/gen/dataList [get]
|
||||
// @Security
|
||||
func (c *Gen) DataList(r *ghttp.Request) {
|
||||
var req *gen_table.SelectPageReq
|
||||
//获取参数
|
||||
@@ -34,7 +40,13 @@ func (c *Gen) DataList(r *ghttp.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
//表列表
|
||||
// @Summary 表列表
|
||||
// @Description 表列表
|
||||
// @Tags 系统工具
|
||||
// @Param data body gen_table.SelectPageReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/tools/gen/tableList [post]
|
||||
// @Security
|
||||
func (c *Gen) TableList(r *ghttp.Request) {
|
||||
var req *gen_table.SelectPageReq
|
||||
//获取参数
|
||||
@@ -51,7 +63,13 @@ func (c *Gen) TableList(r *ghttp.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
//导入表结构操作
|
||||
// @Summary 导入表结构操作
|
||||
// @Description 导入表结构操作
|
||||
// @Tags 系统工具
|
||||
// @Param tables body string true "tables"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/tools/gen/importTableSave [post]
|
||||
// @Security
|
||||
func (c *Gen) ImportTableSave(r *ghttp.Request) {
|
||||
tables := r.GetString("tables")
|
||||
if tables == "" {
|
||||
@@ -74,7 +92,13 @@ func (c *Gen) ImportTableSave(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "导入数据表成功")
|
||||
}
|
||||
|
||||
//根据表格ID获取表格字段列表数据
|
||||
// @Summary 根据表格ID获取表格字段列表数据
|
||||
// @Description 根据表格ID获取表格字段列表数据
|
||||
// @Tags 系统工具
|
||||
// @Param tableId body integer true "tableId"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/tools/gen/columnList [post]
|
||||
// @Security
|
||||
func (c *Gen) ColumnList(r *ghttp.Request) {
|
||||
tableId := r.GetInt64("tableId")
|
||||
if tableId == 0 {
|
||||
@@ -103,7 +127,13 @@ func (c *Gen) ColumnList(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "ok", res)
|
||||
}
|
||||
|
||||
//编辑表格信息
|
||||
// @Summary 编辑表格信息
|
||||
// @Description 编辑表格信息
|
||||
// @Tags 系统工具
|
||||
// @Param data body gen_table.EditReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/tools/gen/editSave [post]
|
||||
// @Security
|
||||
func (c *Gen) EditSave(r *ghttp.Request) {
|
||||
var req *gen_table.EditReq
|
||||
//获取参数
|
||||
@@ -119,7 +149,13 @@ func (c *Gen) EditSave(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "设置成功")
|
||||
}
|
||||
|
||||
//删除表格数据
|
||||
// @Summary 删除表格数据
|
||||
// @Description 删除表格数据
|
||||
// @Tags 系统工具
|
||||
// @Param ids body integer true "ids[1,2,3...]"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/tools/gen/delete [delete]
|
||||
// @Security
|
||||
func (c *Gen) Delete(r *ghttp.Request) {
|
||||
ids := r.GetInts("ids")
|
||||
if len(ids) == 0 {
|
||||
@@ -132,7 +168,13 @@ func (c *Gen) Delete(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "删除成功")
|
||||
}
|
||||
|
||||
//代码生成预览
|
||||
// @Summary 代码生成预览
|
||||
// @Description 代码生成预览
|
||||
// @Tags 系统工具
|
||||
// @Param tableId body integer true "tableId"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/tools/gen/preview [post]
|
||||
// @Security
|
||||
func (c *Gen) Preview(r *ghttp.Request) {
|
||||
tableId := r.GetInt64("tableId")
|
||||
if tableId == 0 {
|
||||
|
||||
@@ -12,7 +12,12 @@ import (
|
||||
|
||||
type Index struct{}
|
||||
|
||||
//获取登录用户信息
|
||||
// @Summary 获取登录用户信息
|
||||
// @Description 获取登录用户信息
|
||||
// @Tags 公共
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/index/getInfo [get]
|
||||
// @Security
|
||||
func (c *Index) GetInfo(r *ghttp.Request) {
|
||||
//获取用户信息
|
||||
userEntity, err := user_service.GetCurrentUser(r)
|
||||
@@ -57,7 +62,12 @@ func (c *Index) GetInfo(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "ok", result)
|
||||
}
|
||||
|
||||
//获取后台菜单
|
||||
// @Summary 获取后台菜单
|
||||
// @Description 获取后台菜单
|
||||
// @Tags 公共
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/index/getRouters [get]
|
||||
// @Security
|
||||
func (c *Index) GetRouters(r *ghttp.Request) {
|
||||
//获取用户信息
|
||||
userEntity := user_service.GetLoginAdminInfo(r)
|
||||
|
||||
@@ -14,7 +14,13 @@ import (
|
||||
|
||||
type MonitorJob struct{}
|
||||
|
||||
//任务列表
|
||||
// @Summary 任务列表
|
||||
// @Description 任务列表
|
||||
// @Tags 定时任务
|
||||
// @Param data body sys_job.SelectPageReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/job/list [get]
|
||||
// @Security
|
||||
func (c *MonitorJob) List(r *ghttp.Request) {
|
||||
var req *sys_job.SelectPageReq
|
||||
//获取参数
|
||||
@@ -44,7 +50,13 @@ func (c *MonitorJob) List(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "任务列表", result)
|
||||
}
|
||||
|
||||
//添加任务
|
||||
// @Summary 添加任务
|
||||
// @Description 添加任务
|
||||
// @Tags 定时任务
|
||||
// @Param data body sys_job.ReqAdd true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/job/add [post]
|
||||
// @Security
|
||||
func (c *MonitorJob) Add(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *sys_job.ReqAdd
|
||||
@@ -80,7 +92,13 @@ func (c *MonitorJob) Add(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "添加任务", res)
|
||||
}
|
||||
|
||||
//修改任务
|
||||
// @Summary 修改任务
|
||||
// @Description 修改任务
|
||||
// @Tags 定时任务
|
||||
// @Param data body sys_job.ReqEdit true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/job/edit [post]
|
||||
// @Security
|
||||
func (c *MonitorJob) Edit(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *sys_job.ReqEdit
|
||||
@@ -122,7 +140,13 @@ func (c *MonitorJob) Edit(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "添加任务", res)
|
||||
}
|
||||
|
||||
//详情
|
||||
// @Summary 详情
|
||||
// @Description 详情
|
||||
// @Tags 定时任务
|
||||
// @Param id body integer true "id"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/job/details [post]
|
||||
// @Security
|
||||
func (c *MonitorJob) Details(r *ghttp.Request) {
|
||||
id := r.GetInt64("id")
|
||||
job, err := monitor_service.GetJobInfoById(id)
|
||||
@@ -132,7 +156,13 @@ func (c *MonitorJob) Details(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "success", job)
|
||||
}
|
||||
|
||||
//删除计划任务
|
||||
// @Summary 删除计划任务
|
||||
// @Description 删除计划任务
|
||||
// @Tags 定时任务
|
||||
// @Param ids body integer true "ids[]"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/job/delete [delete]
|
||||
// @Security
|
||||
func (c *MonitorJob) Delete(r *ghttp.Request) {
|
||||
ids := r.GetInts("id")
|
||||
err := monitor_service.DeleteJobByIds(ids)
|
||||
@@ -142,7 +172,13 @@ func (c *MonitorJob) Delete(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "删除成功")
|
||||
}
|
||||
|
||||
//启动任务
|
||||
// @Summary 启动任务
|
||||
// @Description 启动任务
|
||||
// @Tags 定时任务
|
||||
// @Param id body integer true "id"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/job/start [post]
|
||||
// @Security
|
||||
func (c *MonitorJob) Start(r *ghttp.Request) {
|
||||
id := r.GetInt64("id")
|
||||
job, err := monitor_service.GetJobInfoById(id)
|
||||
@@ -156,7 +192,13 @@ func (c *MonitorJob) Start(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "定时任务管理启动成功")
|
||||
}
|
||||
|
||||
//停止任务
|
||||
// @Summary 停止任务
|
||||
// @Description 停止任务
|
||||
// @Tags 定时任务
|
||||
// @Param id body integer true "id"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/job/stop [post]
|
||||
// @Security
|
||||
func (c *MonitorJob) Stop(r *ghttp.Request) {
|
||||
id := r.GetInt64("id")
|
||||
job, err := monitor_service.GetJobInfoById(id)
|
||||
|
||||
@@ -12,7 +12,13 @@ import (
|
||||
|
||||
type MonitorLoginLog struct{}
|
||||
|
||||
//登录日志列表
|
||||
// @Summary 登录日志列表
|
||||
// @Description 登录日志列表
|
||||
// @Tags 登录日志
|
||||
// @Param data body sys_login_log.SelectPageReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/loginlog/list [get]
|
||||
// @Security
|
||||
func (c *MonitorLoginLog) List(r *ghttp.Request) {
|
||||
var req *sys_login_log.SelectPageReq
|
||||
//获取参数
|
||||
@@ -37,7 +43,13 @@ func (c *MonitorLoginLog) List(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "登录日志列表", result)
|
||||
}
|
||||
|
||||
//删除登录日志
|
||||
// @Summary 删除登录日志
|
||||
// @Description 删除登录日志
|
||||
// @Tags 登录日志
|
||||
// @Param ids body integer true "ids[]"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/loginlog/delete [delete]
|
||||
// @Security
|
||||
func (c *MonitorLoginLog) Delete(r *ghttp.Request) {
|
||||
ids := r.GetInts("ids")
|
||||
err := monitor_service.DeleteLoginLogByIds(ids)
|
||||
@@ -47,7 +59,12 @@ func (c *MonitorLoginLog) Delete(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "删除成功")
|
||||
}
|
||||
|
||||
//清空登录日志
|
||||
// @Summary 清空登录日志
|
||||
// @Description 清空登录日志
|
||||
// @Tags 登录日志
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/loginlog/clear [post]
|
||||
// @Security
|
||||
func (c *MonitorLoginLog) Clear(r *ghttp.Request) {
|
||||
err := monitor_service.ClearLoginLog()
|
||||
if err != nil {
|
||||
|
||||
@@ -11,7 +11,13 @@ import (
|
||||
|
||||
type MonitorOnline struct{}
|
||||
|
||||
//用户状态列表
|
||||
// @Summary 用户状态列表
|
||||
// @Description 用户状态列表
|
||||
// @Tags 在线用户
|
||||
// @Param data body user_online.ReqListSearch true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/online/list [get]
|
||||
// @Security
|
||||
func (c *MonitorOnline) List(r *ghttp.Request) {
|
||||
var req *user_online.ReqListSearch
|
||||
//获取参数
|
||||
@@ -30,7 +36,13 @@ func (c *MonitorOnline) List(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "用户在线状态", result)
|
||||
}
|
||||
|
||||
//强制退出
|
||||
// @Summary 强制退出
|
||||
// @Description 强制退出
|
||||
// @Tags 在线用户
|
||||
// @Param ids body integer true "ids[]"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/online/forceLogout [post]
|
||||
// @Security
|
||||
func (c *MonitorOnline) ForceLogout(r *ghttp.Request) {
|
||||
ids := r.GetInts("ids")
|
||||
if len(ids) == 0 {
|
||||
|
||||
@@ -12,7 +12,13 @@ import (
|
||||
|
||||
type MonitorOperationLog struct{}
|
||||
|
||||
//操作日志列表
|
||||
// @Summary 操作日志列表
|
||||
// @Description 操作日志列表
|
||||
// @Tags 操作日志
|
||||
// @Param data body sys_oper_log.SelectPageReq true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/operlog/list [get]
|
||||
// @Security
|
||||
func (c *MonitorOperationLog) List(r *ghttp.Request) {
|
||||
var req *sys_oper_log.SelectPageReq
|
||||
//获取参数
|
||||
@@ -37,7 +43,13 @@ func (c *MonitorOperationLog) List(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "操作日志列表", result)
|
||||
}
|
||||
|
||||
//操作详细
|
||||
// @Summary 操作详细
|
||||
// @Description 操作详细
|
||||
// @Tags 操作日志
|
||||
// @Param id body integer true "id"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/operlog/detail [post]
|
||||
// @Security
|
||||
func (c *MonitorOperationLog) Detail(r *ghttp.Request) {
|
||||
id := r.GetInt64("id")
|
||||
log, err := monitor_service.GetOperationLogById(id)
|
||||
@@ -49,7 +61,13 @@ func (c *MonitorOperationLog) Detail(r *ghttp.Request) {
|
||||
})
|
||||
}
|
||||
|
||||
//删除日志
|
||||
// @Summary 删除日志
|
||||
// @Description 删除日志
|
||||
// @Tags 操作日志
|
||||
// @Param ids body integer true "ids[]"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/operlog/delete [delete]
|
||||
// @Security
|
||||
func (c *MonitorOperationLog) Delete(r *ghttp.Request) {
|
||||
ids := r.GetInts("ids")
|
||||
err := monitor_service.DeleteOperationLogByIds(ids)
|
||||
@@ -59,7 +77,13 @@ func (c *MonitorOperationLog) Delete(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "删除成功")
|
||||
}
|
||||
|
||||
//清空日志
|
||||
// @Summary 清空日志
|
||||
// @Description 清空日志
|
||||
// @Tags 操作日志
|
||||
// @Param ids body integer true "ids[]"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/operlog/clear [post]
|
||||
// @Security
|
||||
func (c *MonitorOperationLog) Clear(r *ghttp.Request) {
|
||||
err := monitor_service.ClearOperationLog()
|
||||
if err != nil {
|
||||
|
||||
@@ -23,6 +23,12 @@ type MonitorServer struct{}
|
||||
|
||||
var StartTime = gtime.Datetime()
|
||||
|
||||
// @Summary 服务监控
|
||||
// @Description 服务监控
|
||||
// @Tags 服务监控
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/monitor/server/info [get]
|
||||
// @Security
|
||||
func (c *MonitorServer) Info(r *ghttp.Request) {
|
||||
cpuNum := runtime.NumCPU() //核心数
|
||||
|
||||
|
||||
@@ -11,6 +11,13 @@ import (
|
||||
|
||||
type Post struct{}
|
||||
|
||||
// @Summary 分页岗位列表数据
|
||||
// @Description 分页列表
|
||||
// @Tags 岗位
|
||||
// @Param data body sys_post.SearchParams true "data"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/post/list [post]
|
||||
// @Security
|
||||
func (c *Post) List(r *ghttp.Request) {
|
||||
var req *sys_post.SearchParams
|
||||
|
||||
@@ -33,6 +40,15 @@ func (c *Post) List(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "成功", result)
|
||||
}
|
||||
|
||||
// @Summary 添加岗位
|
||||
// @Description 添加岗位
|
||||
// @Tags 岗位
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body sys_post.AddParams true "data"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "添加成功"}"
|
||||
// @Router /system/post/add [post]
|
||||
// @Security Bearer
|
||||
func (c *Post) Add(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
|
||||
@@ -50,6 +66,15 @@ func (c *Post) Add(r *ghttp.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 修改岗位
|
||||
// @Description 获取JSON
|
||||
// @Tags 岗位
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body sys_post.EditParams true "data"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "修改成功"}"
|
||||
// @Router /system/post/edit [post]
|
||||
// @Security Bearer
|
||||
func (c *Post) Edit(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var editParams *sys_post.EditParams
|
||||
@@ -78,6 +103,12 @@ func (c *Post) Edit(r *ghttp.Request) {
|
||||
|
||||
}
|
||||
|
||||
// @Summary 删除岗位
|
||||
// @Description 删除数据
|
||||
// @Tags 岗位
|
||||
// @Param ids path integer true "ids[1,2,3...]"
|
||||
// @Success 200 {object} response.Response "{"code": 0, "message": "删除成功"}"
|
||||
// @Router /system/post/delete [get]
|
||||
func (c *Post) Delete(r *ghttp.Request) {
|
||||
ids := r.GetInts("ids")
|
||||
if len(ids) == 0 {
|
||||
|
||||
@@ -9,7 +9,12 @@ import (
|
||||
|
||||
type Public struct{}
|
||||
|
||||
//获取验证码图片信息
|
||||
// @Summary 获取验证码图片信息
|
||||
// @Description 获取验证码图片信息
|
||||
// @Tags 公共
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/public/verify [post]
|
||||
// @Security
|
||||
func (p *Public) Verify(r *ghttp.Request) {
|
||||
idKeyC, base64stringC := service.GetVerifyImgString()
|
||||
response.SusJson(true, r, "ok", g.MapStrStr{"idKeyC": idKeyC, "base64stringC": base64stringC})
|
||||
|
||||
@@ -11,7 +11,13 @@ import (
|
||||
|
||||
type Upload struct{}
|
||||
|
||||
//CkEditor编辑器上传附件
|
||||
// @Summary CkEditor编辑器上传附件
|
||||
// @Description CkEditor编辑器上传附件
|
||||
// @Tags 公共
|
||||
// @Param upFile body string true "upFile"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/upload/ckEditorUp [post]
|
||||
// @Security
|
||||
func (c *Upload) CkEditorUp(r *ghttp.Request) {
|
||||
upFile := r.GetUploadFile("upload")
|
||||
fType := gstr.ToLower(r.GetString("type"))
|
||||
@@ -30,7 +36,13 @@ func (c *Upload) CkEditorUp(r *ghttp.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
//单图片上传
|
||||
// @Summary 单图片上传
|
||||
// @Description 单图片上传
|
||||
// @Tags 公共
|
||||
// @Param file body string true "file"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/upload/upImg [post]
|
||||
// @Security
|
||||
func (c *Upload) UpImg(r *ghttp.Request) {
|
||||
upFile := r.GetUploadFile("file")
|
||||
info, err := upload_service.UpImg(upFile)
|
||||
@@ -43,7 +55,13 @@ func (c *Upload) UpImg(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "上传成功", res)
|
||||
}
|
||||
|
||||
//批量上传图片
|
||||
// @Summary 批量上传图片
|
||||
// @Description 批量上传图片
|
||||
// @Tags 公共
|
||||
// @Param file body string true "file"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/upload/upImgs [post]
|
||||
// @Security
|
||||
func (c *Upload) UpImgs(r *ghttp.Request) {
|
||||
upFiles := r.GetUploadFiles("file")
|
||||
infos, err := upload_service.UpImgs(upFiles)
|
||||
@@ -56,7 +74,13 @@ func (c *Upload) UpImgs(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "上传成功", res)
|
||||
}
|
||||
|
||||
//单文件上传
|
||||
// @Summary 单文件上传
|
||||
// @Description 单文件上传
|
||||
// @Tags 公共
|
||||
// @Param file body string true "file"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/upload/upFile [post]
|
||||
// @Security
|
||||
func (c *Upload) UpFile(r *ghttp.Request) {
|
||||
upFile := r.GetUploadFile("file")
|
||||
info, err := upload_service.UpFile(upFile)
|
||||
@@ -69,7 +93,13 @@ func (c *Upload) UpFile(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "上传成功", res)
|
||||
}
|
||||
|
||||
//批量上传文件
|
||||
// @Summary 批量上传文件
|
||||
// @Description 批量上传文件
|
||||
// @Tags 公共
|
||||
// @Param file body string true "file"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/upload/upFiles [post]
|
||||
// @Security
|
||||
func (c *Upload) UpFiles(r *ghttp.Request) {
|
||||
upFiles := r.GetUploadFiles("file")
|
||||
infos, err := upload_service.UpFiles(upFiles)
|
||||
|
||||
@@ -12,7 +12,13 @@ import (
|
||||
|
||||
type User struct{}
|
||||
|
||||
//头像上传上传
|
||||
// @Summary 头像上传上传
|
||||
// @Description 头像上传上传
|
||||
// @Tags 个人中心
|
||||
// @Param avatarfile body string true "avatarfile"
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/user/avatar [post]
|
||||
// @Security
|
||||
func (c *User) Avatar(r *ghttp.Request) {
|
||||
upFile := r.GetUploadFile("avatarfile")
|
||||
info, err := upload_service.UpImg(upFile)
|
||||
@@ -31,9 +37,12 @@ func (c *User) Avatar(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "上传成功", res)
|
||||
}
|
||||
|
||||
/**
|
||||
获取当前登录用户详情
|
||||
*/
|
||||
// @Summary 获取当前登录用户详情
|
||||
// @Description 获取当前登录用户详情
|
||||
// @Tags 个人中心
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/user/profile [post]
|
||||
// @Security
|
||||
func (c *User) Profile(r *ghttp.Request) {
|
||||
//获取用户信息
|
||||
userInfo, err := user_service.GetCurrentUserInfo(r)
|
||||
@@ -47,9 +56,12 @@ func (c *User) Profile(r *ghttp.Request) {
|
||||
response.SusJson(true, r, "ok", userInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
修改用户信息
|
||||
*/
|
||||
// @Summary 修改用户信息
|
||||
// @Description 修改用户信息
|
||||
// @Tags 个人中心
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/user/edit [post]
|
||||
// @Security
|
||||
func (c *User) Edit(r *ghttp.Request) {
|
||||
|
||||
if r.Method == "POST" {
|
||||
@@ -67,9 +79,12 @@ func (c *User) Edit(r *ghttp.Request) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
修改密码
|
||||
*/
|
||||
// @Summary 修改密码
|
||||
// @Description 修改密码
|
||||
// @Tags 个人中心
|
||||
// @Success 0 {object} response.Response "{"code": 200, "data": [...]}"
|
||||
// @Router /system/user/updatePwd [post]
|
||||
// @Security
|
||||
func (c *User) UpdatePwd(r *ghttp.Request) {
|
||||
if r.Method == "POST" {
|
||||
var req *user_service.UpdatePwdReq
|
||||
|
||||
Reference in New Issue
Block a user