mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
【更新】更新restful
This commit is contained in:
@@ -17,14 +17,6 @@ type DeptApi struct {
|
||||
RoleApp services.SysRoleModel
|
||||
}
|
||||
|
||||
// @Summary 获取角色的部门树
|
||||
// @Description 获取JSON
|
||||
// @Tags 菜单
|
||||
// @Param roleId path int false "roleId"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "抱歉未找到相关信息"}"
|
||||
// @Router /system/menu/menuTreRoleSelect/{roleId} [get]
|
||||
// @Security X-TOKEN
|
||||
func (m *DeptApi) GetDeptTreeRoleSelect(rc *restfulx.ReqCtx) {
|
||||
roleId := restfulx.PathParamInt(rc, "roleId")
|
||||
var dept entity.SysDept
|
||||
@@ -43,15 +35,6 @@ func (m *DeptApi) GetDeptTreeRoleSelect(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 部门列表数据
|
||||
// @Description 分页列表
|
||||
// @Tags 部门
|
||||
// @Param deptName query string false "deptName"
|
||||
// @Param status query string false "status"
|
||||
// @Param deptId query int false "deptId"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dept/deptList [get]
|
||||
// @Security
|
||||
func (a *DeptApi) GetDeptList(rc *restfulx.ReqCtx) {
|
||||
//pageNum := restfulx.QueryInt(rc.GinCtx, "pageNum", 1)
|
||||
//pageSize := restfulx.QueryInt(rc.GinCtx, "pageSize", 10)
|
||||
@@ -69,12 +52,6 @@ func (a *DeptApi) GetDeptList(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 所有部门列表数据
|
||||
// @Description 部门列表
|
||||
// @Tags 部门
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dept/ordinaryDeptLis [get]
|
||||
// @Security
|
||||
func (a *DeptApi) GetOrdinaryDeptList(rc *restfulx.ReqCtx) {
|
||||
var dept entity.SysDept
|
||||
if !IsTenantAdmin(rc.LoginAccount.TenantId) {
|
||||
@@ -84,15 +61,6 @@ func (a *DeptApi) GetOrdinaryDeptList(rc *restfulx.ReqCtx) {
|
||||
rc.ResData = a.DeptApp.FindList(dept)
|
||||
}
|
||||
|
||||
// @Summary 所有部门树数据
|
||||
// @Description 部门树列表
|
||||
// @Tags 部门
|
||||
// @Param deptName query string false "deptName"
|
||||
// @Param status query string false "status"
|
||||
// @Param deptId query int false "deptId"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dept/deptTree [get]
|
||||
// @Security
|
||||
func (a *DeptApi) GetDeptTree(rc *restfulx.ReqCtx) {
|
||||
deptName := restfulx.QueryParam(rc, "deptName")
|
||||
status := restfulx.QueryParam(rc, "status")
|
||||
@@ -104,28 +72,11 @@ func (a *DeptApi) GetDeptTree(rc *restfulx.ReqCtx) {
|
||||
rc.ResData = a.DeptApp.SelectDept(dept)
|
||||
}
|
||||
|
||||
// @Summary 部门数据
|
||||
// @Description 获取JSON
|
||||
// @Tags 部门
|
||||
// @Param deptId path string false "deptId"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dept/{deptId} [get]
|
||||
// @Security
|
||||
func (a *DeptApi) GetDept(rc *restfulx.ReqCtx) {
|
||||
deptId := restfulx.PathParamInt(rc, "deptId")
|
||||
rc.ResData = a.DeptApp.FindOne(int64(deptId))
|
||||
}
|
||||
|
||||
// @Summary 添加部门
|
||||
// @Description 获取JSON
|
||||
// @Tags 部门
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysDept true "data"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/dept [post]
|
||||
// @Security Bearer
|
||||
func (a *DeptApi) InsertDept(rc *restfulx.ReqCtx) {
|
||||
var dept entity.SysDept
|
||||
restfulx.BindQuery(rc, &dept)
|
||||
@@ -134,16 +85,6 @@ func (a *DeptApi) InsertDept(rc *restfulx.ReqCtx) {
|
||||
a.DeptApp.Insert(dept)
|
||||
}
|
||||
|
||||
// @Summary 修改部门
|
||||
// @Description 获取JSON
|
||||
// @Tags 部门
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysDept true "body"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
|
||||
// @Router /system/dept [put]
|
||||
// @Security Bearer
|
||||
func (a *DeptApi) UpdateDept(rc *restfulx.ReqCtx) {
|
||||
var dept entity.SysDept
|
||||
restfulx.BindQuery(rc, &dept)
|
||||
@@ -152,13 +93,6 @@ func (a *DeptApi) UpdateDept(rc *restfulx.ReqCtx) {
|
||||
a.DeptApp.Update(dept)
|
||||
}
|
||||
|
||||
// @Summary 删除部门
|
||||
// @Description 删除数据
|
||||
// @Tags 部门
|
||||
// @Param deptId path string true "deptId, 逗号隔开"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/dept/{deptId} [delete]
|
||||
func (a *DeptApi) DeleteDept(rc *restfulx.ReqCtx) {
|
||||
deptId := restfulx.PathParam(rc, "deptId")
|
||||
deptIds := utils.IdsStrToIdsIntGroup(deptId)
|
||||
|
||||
@@ -15,17 +15,6 @@ type DictApi struct {
|
||||
DictData services.SysDictDataModel
|
||||
}
|
||||
|
||||
// @Summary 字典类型列表数据
|
||||
// @Description 获取JSON
|
||||
// @Tags 职位
|
||||
// @Param dictName query string false "DictName"
|
||||
// @Param dictName query string false "dictType"
|
||||
// @Param status query string false "status"
|
||||
// @Param pageSize query int false "页条数"
|
||||
// @Param pageNum query int false "页码"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dict/type/list [get]
|
||||
// @Security
|
||||
func (p *DictApi) GetDictTypeList(rc *restfulx.ReqCtx) {
|
||||
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
|
||||
pageSize := restfulx.QueryInt(rc, "pageSize", 10)
|
||||
@@ -42,28 +31,11 @@ func (p *DictApi) GetDictTypeList(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 获取字典类型
|
||||
// @Description 获取JSON
|
||||
// @Tags 字典
|
||||
// @Param dictId path int true "dictId"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dict/type/{dictId} [get]
|
||||
// @Security
|
||||
func (p *DictApi) GetDictType(rc *restfulx.ReqCtx) {
|
||||
dictId := restfulx.PathParamInt(rc, "dictId")
|
||||
p.DictType.FindOne(int64(dictId))
|
||||
}
|
||||
|
||||
// @Summary 添加字典类型
|
||||
// @Description 获取JSON
|
||||
// @Tags 字典
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysDictType true "data"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/dict/type [post]
|
||||
// @Security X-TOKEN
|
||||
func (p *DictApi) InsertDictType(rc *restfulx.ReqCtx) {
|
||||
var dict entity.SysDictType
|
||||
restfulx.BindQuery(rc, &dict)
|
||||
@@ -72,16 +44,6 @@ func (p *DictApi) InsertDictType(rc *restfulx.ReqCtx) {
|
||||
p.DictType.Insert(dict)
|
||||
}
|
||||
|
||||
// @Summary 修改字典类型
|
||||
// @Description 获取JSON
|
||||
// @Tags 职位
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysDictType true "body"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/dict/type [put]
|
||||
// @Security X-TOKEN
|
||||
func (p *DictApi) UpdateDictType(rc *restfulx.ReqCtx) {
|
||||
var dict entity.SysDictType
|
||||
restfulx.BindQuery(rc, &dict)
|
||||
@@ -90,13 +52,6 @@ func (p *DictApi) UpdateDictType(rc *restfulx.ReqCtx) {
|
||||
p.DictType.Update(dict)
|
||||
}
|
||||
|
||||
// @Summary 删除字典类型
|
||||
// @Description 删除数据
|
||||
// @Tags 字典
|
||||
// @Param dictId path string true "dictId "
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/dict/type/{dictId} [delete]
|
||||
func (p *DictApi) DeleteDictType(rc *restfulx.ReqCtx) {
|
||||
dictId := restfulx.PathParam(rc, "dictId")
|
||||
dictIds := utils.IdsStrToIdsIntGroup(dictId)
|
||||
@@ -114,15 +69,6 @@ func (p *DictApi) DeleteDictType(rc *restfulx.ReqCtx) {
|
||||
p.DictType.Delete(deList)
|
||||
}
|
||||
|
||||
// @Summary 导出字典类型
|
||||
// @Description 导出数据
|
||||
// @Tags 字典
|
||||
// @Param dictName query string false "DictName"
|
||||
// @Param dictName query string false "dictType"
|
||||
// @Param status query string false "status"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/dict/type/export [get]
|
||||
func (p *DictApi) ExportDictType(rc *restfulx.ReqCtx) {
|
||||
filename := restfulx.QueryParam(rc, "filename")
|
||||
status := restfulx.QueryParam(rc, "status")
|
||||
@@ -135,15 +81,6 @@ func (p *DictApi) ExportDictType(rc *restfulx.ReqCtx) {
|
||||
rc.Download(fileName)
|
||||
}
|
||||
|
||||
// @Summary 字典数据列表
|
||||
// @Description 获取JSON
|
||||
// @Tags 字典
|
||||
// @Param dictLabel query string false "dictLabel"
|
||||
// @Param dictType query string false "dictType"
|
||||
// @Param status query string false "status"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dict/data/list [get]
|
||||
// @Security
|
||||
func (p *DictApi) GetDictDataList(rc *restfulx.ReqCtx) {
|
||||
dictLabel := restfulx.QueryParam(rc, "dictLabel")
|
||||
dictType := restfulx.QueryParam(rc, "dictType")
|
||||
@@ -151,41 +88,17 @@ func (p *DictApi) GetDictDataList(rc *restfulx.ReqCtx) {
|
||||
rc.ResData = p.DictData.FindList(entity.SysDictData{Status: status, DictType: dictType, DictLabel: dictLabel})
|
||||
}
|
||||
|
||||
// @Summary 字典数据获取
|
||||
// @Description 获取JSON
|
||||
// @Tags 字典
|
||||
// @Param dictType path string false "dictType"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dict/data/type [get]
|
||||
// @Security
|
||||
func (p *DictApi) GetDictDataListByDictType(rc *restfulx.ReqCtx) {
|
||||
dictType := restfulx.QueryParam(rc, "dictType")
|
||||
biz.IsTrue(dictType != "", "请传入字典类型")
|
||||
rc.ResData = p.DictData.FindList(entity.SysDictData{DictType: dictType})
|
||||
}
|
||||
|
||||
// @Summary 获取字典数据
|
||||
// @Description 获取JSON
|
||||
// @Tags 字典
|
||||
// @Param dictCode path int true "dictCode"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/dict/data/{dictCode} [get]
|
||||
// @Security
|
||||
func (p *DictApi) GetDictData(rc *restfulx.ReqCtx) {
|
||||
dictCode := restfulx.PathParamInt(rc, "dictCode")
|
||||
p.DictData.FindOne(int64(dictCode))
|
||||
}
|
||||
|
||||
// @Summary 添加字典数据
|
||||
// @Description 获取JSON
|
||||
// @Tags 字典
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysDictData true "data"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/dict/data [post]
|
||||
// @Security X-TOKEN
|
||||
func (p *DictApi) InsertDictData(rc *restfulx.ReqCtx) {
|
||||
var data entity.SysDictData
|
||||
restfulx.BindQuery(rc, &data)
|
||||
@@ -193,16 +106,6 @@ func (p *DictApi) InsertDictData(rc *restfulx.ReqCtx) {
|
||||
p.DictData.Insert(data)
|
||||
}
|
||||
|
||||
// @Summary 修改字典数据
|
||||
// @Description 获取JSON
|
||||
// @Tags 字典
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysDictData true "body"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/dict/data [put]
|
||||
// @Security X-TOKEN
|
||||
func (p *DictApi) UpdateDictData(rc *restfulx.ReqCtx) {
|
||||
var data entity.SysDictData
|
||||
restfulx.BindQuery(rc, &data)
|
||||
@@ -211,13 +114,6 @@ func (p *DictApi) UpdateDictData(rc *restfulx.ReqCtx) {
|
||||
p.DictData.Update(data)
|
||||
}
|
||||
|
||||
// @Summary 删除字典数据
|
||||
// @Description 删除数据
|
||||
// @Tags 字典
|
||||
// @Param dictCode path string true "dictCode "
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/dict/data/{dictCode} [delete]
|
||||
func (p *DictApi) DeleteDictData(rc *restfulx.ReqCtx) {
|
||||
dictCode := restfulx.PathParam(rc, "dictCode")
|
||||
p.DictData.Delete(utils.IdsStrToIdsIntGroup(dictCode))
|
||||
|
||||
@@ -16,39 +16,17 @@ type MenuApi struct {
|
||||
RoleApp services.SysRoleModel
|
||||
}
|
||||
|
||||
// @Summary 获取菜单树
|
||||
// @Description 获取JSON
|
||||
// @Tags 菜单
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/menu/menuTreSelect [get]
|
||||
// @Security X-TOKEN
|
||||
func (m *MenuApi) GetMenuTreeSelect(rc *restfulx.ReqCtx) {
|
||||
lable := m.MenuApp.SelectMenuLable(entity.SysMenu{})
|
||||
rc.ResData = lable
|
||||
}
|
||||
|
||||
// @Summary 登陆成功获取的路由,根据角色名称获取菜单列表数据(左菜单使用)
|
||||
// @Description 获取JSON
|
||||
// @Tags 菜单
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "抱歉未找到相关信息"}"
|
||||
// @Router /system/menu/menuRole [get]
|
||||
// @Security X-TOKEN
|
||||
func (m *MenuApi) GetMenuRole(rc *restfulx.ReqCtx) {
|
||||
roleKey := restfulx.QueryParam(rc, "roleKey")
|
||||
biz.IsTrue(roleKey != "", "请传入角色Key")
|
||||
rc.ResData = Build(*m.MenuApp.SelectMenuRole(roleKey))
|
||||
}
|
||||
|
||||
// @Summary 获取角色的菜单树
|
||||
// @Description 获取JSON
|
||||
// @Tags 菜单
|
||||
// @Param roleId path int false "roleId"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "抱歉未找到相关信息"}"
|
||||
// @Router /system/menu/menuTreRoleSelect/{roleId} [get]
|
||||
// @Security X-TOKEN
|
||||
func (m *MenuApi) GetMenuTreeRoleSelect(rc *restfulx.ReqCtx) {
|
||||
roleId := restfulx.PathParamInt(rc, "roleId")
|
||||
|
||||
@@ -63,30 +41,12 @@ func (m *MenuApi) GetMenuTreeRoleSelect(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 获取角色对应的菜单路径数组
|
||||
// @Description 获取JSON
|
||||
// @Tags 菜单
|
||||
// @Param roleKey query string true "roleKey"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "抱歉未找到相关信息"}"
|
||||
// @Router /system/menu/menuPaths [get]
|
||||
// @Security X-TOKEN
|
||||
func (m *MenuApi) GetMenuPaths(rc *restfulx.ReqCtx) {
|
||||
roleKey := restfulx.QueryParam(rc, "roleKey")
|
||||
biz.IsTrue(roleKey != "", "请传入角色Key")
|
||||
rc.ResData = m.RoleMenuApp.GetMenuPaths(entity.SysRoleMenu{RoleName: roleKey})
|
||||
}
|
||||
|
||||
// @Summary Menu列表数据
|
||||
// @Description 获取JSON
|
||||
// @Tags 菜单
|
||||
// @Param menuName query string false "menuName"
|
||||
// @Param IsHide query string false "IsHide"
|
||||
// @Param title query string false "title"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "抱歉未找到相关信息"}"
|
||||
// @Router /system/menu/menuList [get]
|
||||
// @Security Bearer
|
||||
func (m *MenuApi) GetMenuList(rc *restfulx.ReqCtx) {
|
||||
menuName := restfulx.QueryParam(rc, "menuName")
|
||||
status := restfulx.QueryParam(rc, "status")
|
||||
@@ -99,28 +59,12 @@ func (m *MenuApi) GetMenuList(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary Menu列表数据
|
||||
// @Description 获取JSON
|
||||
// @Tags 菜单
|
||||
// @Param menuId path string true "menuId"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "抱歉未找到相关信息"}"
|
||||
// @Router /system/menu/{menuId} [get]
|
||||
// @Security Bearer
|
||||
func (m *MenuApi) GetMenu(rc *restfulx.ReqCtx) {
|
||||
menuId := restfulx.PathParamInt(rc, "menuId")
|
||||
|
||||
rc.ResData = m.MenuApp.FindOne(int64(menuId))
|
||||
}
|
||||
|
||||
// @Summary 创建菜单
|
||||
// @Description 获取JSON
|
||||
// @Tags 菜单
|
||||
// @Param data body entity.SysMenu true "data"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
|
||||
// @Router /system/menu [post]
|
||||
// @Security X-TOKEN
|
||||
func (m *MenuApi) InsertMenu(rc *restfulx.ReqCtx) {
|
||||
var menu entity.SysMenu
|
||||
restfulx.BindQuery(rc, &menu)
|
||||
@@ -134,14 +78,6 @@ func (m *MenuApi) InsertMenu(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 修改菜单
|
||||
// @Description 获取JSON
|
||||
// @Tags 菜单
|
||||
// @Param data body entity.SysMenu true "body"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "修改成功"}"
|
||||
// @Success 200 {string} string "{"code": -1, "message": "修改失败"}"
|
||||
// @Router /system/menu [put]
|
||||
// @Security X-TOKEN
|
||||
func (m *MenuApi) UpdateMenu(rc *restfulx.ReqCtx) {
|
||||
var menu entity.SysMenu
|
||||
restfulx.BindQuery(rc, &menu)
|
||||
@@ -155,13 +91,6 @@ func (m *MenuApi) UpdateMenu(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 删除菜单
|
||||
// @Description 删除数据
|
||||
// @Tags 菜单
|
||||
// @Param menuId path int true "menuId"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/menu/{menuId} [delete]
|
||||
func (m *MenuApi) DeleteMenu(rc *restfulx.ReqCtx) {
|
||||
menuId := restfulx.PathParam(rc, "menuId")
|
||||
m.MenuApp.Delete(utils.IdsStrToIdsIntGroup(menuId))
|
||||
|
||||
@@ -13,16 +13,7 @@ type NoticeApi struct {
|
||||
NoticeApp services.SysNoticeModel
|
||||
}
|
||||
|
||||
// @Summary 通知列表数据
|
||||
// @Description 获取JSON
|
||||
// @Tags 通知
|
||||
// @Param noticeType query string false "noticeType"
|
||||
// @Param title query string false "title"
|
||||
// @Param pageSize query int false "页条数"
|
||||
// @Param pageNum query int false "页码"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/post [get]
|
||||
// @Security
|
||||
// GetNoticeList 通知列表数据
|
||||
func (p *NoticeApi) GetNoticeList(rc *restfulx.ReqCtx) {
|
||||
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
|
||||
pageSize := restfulx.QueryInt(rc, "pageSize", 10)
|
||||
@@ -45,16 +36,7 @@ func (p *NoticeApi) GetNoticeList(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 添加通知
|
||||
// @Description 获取JSON
|
||||
// @Tags 通知
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysNotice true "data"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/notice [post]
|
||||
// @Security X-TOKEN
|
||||
// InsertNotice 添加通知
|
||||
func (p *NoticeApi) InsertNotice(rc *restfulx.ReqCtx) {
|
||||
var notice entity.SysNotice
|
||||
restfulx.BindQuery(rc, ¬ice)
|
||||
@@ -62,16 +44,7 @@ func (p *NoticeApi) InsertNotice(rc *restfulx.ReqCtx) {
|
||||
p.NoticeApp.Insert(notice)
|
||||
}
|
||||
|
||||
// @Summary 修改通知
|
||||
// @Description 获取JSON
|
||||
// @Tags 通知
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysNotice true "body"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/notice [put]
|
||||
// @Security X-TOKEN
|
||||
// UpdateNotice 修改通知
|
||||
func (p *NoticeApi) UpdateNotice(rc *restfulx.ReqCtx) {
|
||||
var notice entity.SysNotice
|
||||
restfulx.BindQuery(rc, ¬ice)
|
||||
@@ -79,13 +52,7 @@ func (p *NoticeApi) UpdateNotice(rc *restfulx.ReqCtx) {
|
||||
p.NoticeApp.Update(notice)
|
||||
}
|
||||
|
||||
// @Summary 删除通知
|
||||
// @Description 删除数据
|
||||
// @Tags 通知
|
||||
// @Param noticeId path string true "noticeId "
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/notice/{noticeId} [delete]
|
||||
// DeleteNotice 删除通知
|
||||
func (p *NoticeApi) DeleteNotice(rc *restfulx.ReqCtx) {
|
||||
noticeId := restfulx.PathParam(rc, "noticeId")
|
||||
noticeIds := utils.IdsStrToIdsIntGroup(noticeId)
|
||||
|
||||
@@ -17,17 +17,7 @@ type PostApi struct {
|
||||
RoleApp services.SysRoleModel
|
||||
}
|
||||
|
||||
// @Summary 职位列表数据
|
||||
// @Description 获取JSON
|
||||
// @Tags 职位
|
||||
// @Param postName query string false "postName"
|
||||
// @Param postCode query string false "postCode"
|
||||
// @Param status query string false "status"
|
||||
// @Param pageSize query int false "页条数"
|
||||
// @Param pageNum query int false "页码"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/post [get]
|
||||
// @Security
|
||||
// GetPostList 职位列表数据
|
||||
func (p *PostApi) GetPostList(rc *restfulx.ReqCtx) {
|
||||
|
||||
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
|
||||
@@ -51,28 +41,13 @@ func (p *PostApi) GetPostList(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 获取职位
|
||||
// @Description 获取JSON
|
||||
// @Tags 职位
|
||||
// @Param postId path int true "postId"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/post/{postId} [get]
|
||||
// @Security
|
||||
// GetPost 获取职位
|
||||
func (p *PostApi) GetPost(rc *restfulx.ReqCtx) {
|
||||
postId := restfulx.PathParamInt(rc, "postId")
|
||||
p.PostApp.FindOne(int64(postId))
|
||||
}
|
||||
|
||||
// @Summary 添加职位
|
||||
// @Description 获取JSON
|
||||
// @Tags 职位
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysPost true "data"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/post [post]
|
||||
// @Security X-TOKEN
|
||||
// InsertPost 添加职位
|
||||
func (p *PostApi) InsertPost(rc *restfulx.ReqCtx) {
|
||||
var post entity.SysPost
|
||||
restfulx.BindQuery(rc, &post)
|
||||
@@ -81,16 +56,7 @@ func (p *PostApi) InsertPost(rc *restfulx.ReqCtx) {
|
||||
p.PostApp.Insert(post)
|
||||
}
|
||||
|
||||
// @Summary 修改职位
|
||||
// @Description 获取JSON
|
||||
// @Tags 职位
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysPost true "body"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/post [put]
|
||||
// @Security X-TOKEN
|
||||
// UpdatePost 修改职位
|
||||
func (p *PostApi) UpdatePost(rc *restfulx.ReqCtx) {
|
||||
var post entity.SysPost
|
||||
restfulx.BindQuery(rc, &post)
|
||||
@@ -99,13 +65,7 @@ func (p *PostApi) UpdatePost(rc *restfulx.ReqCtx) {
|
||||
p.PostApp.Update(post)
|
||||
}
|
||||
|
||||
// @Summary 删除职位
|
||||
// @Description 删除数据
|
||||
// @Tags 职位
|
||||
// @Param postId path string true "postId "
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/post/{postId} [delete]
|
||||
// DeletePost 删除职位
|
||||
func (p *PostApi) DeletePost(rc *restfulx.ReqCtx) {
|
||||
postId := restfulx.PathParam(rc, "postId")
|
||||
postIds := utils.IdsStrToIdsIntGroup(postId)
|
||||
|
||||
@@ -20,17 +20,7 @@ type RoleApi struct {
|
||||
RoleDeptApp services.SysRoleDeptModel
|
||||
}
|
||||
|
||||
// @Summary 角色列表数据
|
||||
// @Description Get JSON
|
||||
// @Tags 角色
|
||||
// @Param roleName query string false "roleName"
|
||||
// @Param status query string false "status"
|
||||
// @Param roleKey query string false "roleKey"
|
||||
// @Param pageSize query int false "页条数"
|
||||
// @Param pageNum query int false "页码"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/role/rolelist [get]
|
||||
// @Security
|
||||
// GetRoleList角色列表数据
|
||||
func (r *RoleApi) GetRoleList(rc *restfulx.ReqCtx) {
|
||||
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
|
||||
pageSize := restfulx.QueryInt(rc, "pageSize", 10)
|
||||
@@ -53,14 +43,7 @@ func (r *RoleApi) GetRoleList(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 获取Role数据
|
||||
// @Description 获取JSON
|
||||
// @Tags 角色/Role
|
||||
// @Param roleId path string true "roleId"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "抱歉未找到相关信息"}"
|
||||
// @Router /system/role [get]
|
||||
// @Security X-TOKEN
|
||||
// GetRole 获取Role数据
|
||||
func (r *RoleApi) GetRole(rc *restfulx.ReqCtx) {
|
||||
roleId := restfulx.PathParamInt(rc, "roleId")
|
||||
role := r.RoleApp.FindOne(int64(roleId))
|
||||
@@ -69,15 +52,7 @@ func (r *RoleApi) GetRole(rc *restfulx.ReqCtx) {
|
||||
rc.ResData = role
|
||||
}
|
||||
|
||||
// @Summary 创建角色
|
||||
// @Description 获取JSON
|
||||
// @Tags 角色/Role
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysRole true "data"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/role [post]
|
||||
// InsertRole 创建角色
|
||||
func (r *RoleApi) InsertRole(rc *restfulx.ReqCtx) {
|
||||
var role entity.SysRole
|
||||
restfulx.BindQuery(rc, &role)
|
||||
@@ -91,15 +66,7 @@ func (r *RoleApi) InsertRole(rc *restfulx.ReqCtx) {
|
||||
casbin.UpdateCasbin(tenantId, role.RoleKey, role.ApiIds)
|
||||
}
|
||||
|
||||
// @Summary 修改用户角色
|
||||
// @Description 获取JSON
|
||||
// @Tags 角色/Role
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysRole true "body"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "修改成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "修改失败"}"
|
||||
// @Router /system/role [put]
|
||||
// UpdateRole 修改用户角色
|
||||
func (r *RoleApi) UpdateRole(rc *restfulx.ReqCtx) {
|
||||
var role entity.SysRole
|
||||
restfulx.BindQuery(rc, &role)
|
||||
@@ -115,15 +82,7 @@ func (r *RoleApi) UpdateRole(rc *restfulx.ReqCtx) {
|
||||
casbin.UpdateCasbin(tenantId, role.RoleKey, role.ApiIds)
|
||||
}
|
||||
|
||||
// @Summary 修改用户角色状态
|
||||
// @Description 获取JSON
|
||||
// @Tags 角色/Role
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysRole true "body"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "修改成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "修改失败"}"
|
||||
// @Router /system/role/changeStatus [put]
|
||||
// UpdateRoleStatus 修改用户角色状态
|
||||
func (r *RoleApi) UpdateRoleStatus(rc *restfulx.ReqCtx) {
|
||||
var role entity.SysRole
|
||||
restfulx.BindQuery(rc, &role)
|
||||
@@ -132,15 +91,7 @@ func (r *RoleApi) UpdateRoleStatus(rc *restfulx.ReqCtx) {
|
||||
r.RoleApp.Update(role)
|
||||
}
|
||||
|
||||
// @Summary 修改用户角色部门
|
||||
// @Description 获取JSON
|
||||
// @Tags 角色/Role
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysRole true "body"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "修改成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "修改失败"}"
|
||||
// @Router /system/role/dataScope [put]
|
||||
// UpdateRoleDataScope 修改用户角色部门
|
||||
func (r *RoleApi) UpdateRoleDataScope(rc *restfulx.ReqCtx) {
|
||||
var role entity.SysRole
|
||||
restfulx.BindQuery(rc, &role)
|
||||
@@ -155,13 +106,7 @@ func (r *RoleApi) UpdateRoleDataScope(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 删除用户角色
|
||||
// @Description 删除数据
|
||||
// @Tags 角色/Role
|
||||
// @Param roleId path string true "roleId 多个用,分割"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/role/{roleId} [delete]
|
||||
// DeleteRole 删除用户角色
|
||||
func (r *RoleApi) DeleteRole(rc *restfulx.ReqCtx) {
|
||||
roleId := restfulx.PathParam(rc, "roleId")
|
||||
roleIds := utils.IdsStrToIdsIntGroup(roleId)
|
||||
@@ -188,15 +133,7 @@ func (r *RoleApi) DeleteRole(rc *restfulx.ReqCtx) {
|
||||
r.RoleMenuApp.DeleteRoleMenus(delList)
|
||||
}
|
||||
|
||||
// @Summary 导出角色
|
||||
// @Description 导出数据
|
||||
// @Tags 角色
|
||||
// @Param roleName query string false "roleName"
|
||||
// @Param status query string false "status"
|
||||
// @Param roleKey query string false "roleKey"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/dict/type/export [get]
|
||||
// ExportRole 导出角色
|
||||
func (p *RoleApi) ExportRole(rc *restfulx.ReqCtx) {
|
||||
filename := restfulx.QueryParam(rc, "filename")
|
||||
status := restfulx.QueryParam(rc, "status")
|
||||
|
||||
@@ -56,7 +56,7 @@ func (s *System) ServerInfo(request *restful.Request, response *restful.Response
|
||||
})
|
||||
}
|
||||
|
||||
// 连接websocket
|
||||
// ConnectWs 连接websocket
|
||||
func (s *System) ConnectWs(request *restful.Request, response *restful.Response) {
|
||||
wsConn, err := ws.Upgrader.Upgrade(response, request.Request, nil)
|
||||
defer func() {
|
||||
|
||||
@@ -36,21 +36,13 @@ type UserApi struct {
|
||||
LogLogin logServices.LogLoginModel
|
||||
}
|
||||
|
||||
// @Tags Base
|
||||
// @Summary 获取验证码
|
||||
// @Produce application/json
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"登陆成功"}"
|
||||
// @Router /system/user/getCaptcha [get]
|
||||
// GenerateCaptcha 获取验证码
|
||||
func (u *UserApi) GenerateCaptcha(request *restful.Request, response *restful.Response) {
|
||||
id, image := captcha.Generate()
|
||||
response.WriteEntity(map[string]any{"base64Captcha": image, "captchaId": id})
|
||||
}
|
||||
|
||||
// @Tags Base
|
||||
// @Summary 刷新token
|
||||
// @Produce application/json
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"登陆成功"}"
|
||||
// @Router /system/user/refreshToken [get]
|
||||
// RefreshToken 刷新token
|
||||
func (u *UserApi) RefreshToken(rc *restfulx.ReqCtx) {
|
||||
tokenStr := rc.Request.Request.Header.Get("X-TOKEN")
|
||||
j := token.NewJWT("", []byte(global.Conf.Jwt.Key), jwt.SigningMethodHS256)
|
||||
@@ -59,12 +51,7 @@ func (u *UserApi) RefreshToken(rc *restfulx.ReqCtx) {
|
||||
rc.ResData = map[string]any{"token": token, "expire": time.Now().Unix() + global.Conf.Jwt.ExpireTime}
|
||||
}
|
||||
|
||||
// @Tags Base
|
||||
// @Summary 用户登录
|
||||
// @Produce application/json
|
||||
// @Param data body form.Login true "用户名, 密码, 验证码"
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"登陆成功"}"
|
||||
// @Router /system/user/login [post]
|
||||
// Login 用户登录
|
||||
func (u *UserApi) Login(rc *restfulx.ReqCtx) {
|
||||
var l form.Login
|
||||
restfulx.BindQuery(rc, &l)
|
||||
@@ -112,12 +99,7 @@ func (u *UserApi) Login(rc *restfulx.ReqCtx) {
|
||||
u.LogLogin.Insert(loginLog)
|
||||
}
|
||||
|
||||
// @Tags Base
|
||||
// @Summary 用户权限信息
|
||||
// @Param userName query string false "userName"
|
||||
// @Produce application/json
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"成功"}"
|
||||
// @Router /system/user/auth [get]
|
||||
// Auth 用户权限信息
|
||||
func (u *UserApi) Auth(rc *restfulx.ReqCtx) {
|
||||
userName := restfulx.QueryParam(rc, "username")
|
||||
biz.NotEmpty(userName, "用户名必传")
|
||||
@@ -137,11 +119,7 @@ func (u *UserApi) Auth(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Tags Base
|
||||
// @Summary 退出登录
|
||||
// @Produce application/json
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"登陆成功"}"
|
||||
// @Router /system/user/logout [post]
|
||||
// LogOut 退出登录
|
||||
func (u *UserApi) LogOut(rc *restfulx.ReqCtx) {
|
||||
var loginLog logEntity.LogLogin
|
||||
ua := user_agent.New(rc.Request.Request.UserAgent())
|
||||
@@ -158,18 +136,7 @@ func (u *UserApi) LogOut(rc *restfulx.ReqCtx) {
|
||||
u.LogLogin.Insert(loginLog)
|
||||
}
|
||||
|
||||
// @Summary 列表数据
|
||||
// @Description 获取JSON
|
||||
// @Tags 用户
|
||||
// @Param userName query string false "userName"
|
||||
// @Param phone query string false "phone"
|
||||
// @Param status query string false "status"
|
||||
// @Param pageSize query int false "页条数"
|
||||
// @Param pageNum query int false "页码"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Success 200 {string} string "{"code": -1, "message": "抱歉未找到相关信息"}"
|
||||
// @Router /system/user/sysUserList [get]
|
||||
// @Security X-TOKEN
|
||||
// GetSysUserList 列表数据
|
||||
func (u *UserApi) GetSysUserList(rc *restfulx.ReqCtx) {
|
||||
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
|
||||
pageSize := restfulx.QueryInt(rc, "pageSize", 10)
|
||||
@@ -197,12 +164,7 @@ func (u *UserApi) GetSysUserList(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 获取当前登录用户
|
||||
// @Description 获取JSON
|
||||
// @Tags 个人中心
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/user/profile [get]
|
||||
// @Security
|
||||
// GetSysUserProfile 获取当前登录用户
|
||||
func (u *UserApi) GetSysUserProfile(rc *restfulx.ReqCtx) {
|
||||
|
||||
sysUser := entity.SysUser{}
|
||||
@@ -232,13 +194,7 @@ func (u *UserApi) GetSysUserProfile(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 修改头像
|
||||
// @Description 修改头像
|
||||
// @Tags 用户
|
||||
// @Param file formData file true "file"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
|
||||
// @Router /system/user/profileAvatar [post]
|
||||
// InsetSysUserAvatar 修改头像
|
||||
func (u *UserApi) InsetSysUserAvatar(rc *restfulx.ReqCtx) {
|
||||
form := rc.Request.Request.MultipartForm
|
||||
|
||||
@@ -258,13 +214,7 @@ func (u *UserApi) InsetSysUserAvatar(rc *restfulx.ReqCtx) {
|
||||
u.UserApp.Update(sysuser)
|
||||
}
|
||||
|
||||
// @Summary 修改密码
|
||||
// @Description 修改密码
|
||||
// @Tags 用户
|
||||
// @Param pwd body entity.SysUserPwd true "pwd"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
|
||||
// @Router /system/user/updatePwd [post]
|
||||
// SysUserUpdatePwd 修改密码
|
||||
func (u *UserApi) SysUserUpdatePwd(rc *restfulx.ReqCtx) {
|
||||
var pws entity.SysUserPwd
|
||||
restfulx.BindQuery(rc, &pws)
|
||||
@@ -274,13 +224,7 @@ func (u *UserApi) SysUserUpdatePwd(rc *restfulx.ReqCtx) {
|
||||
u.UserApp.SetPwd(user, pws)
|
||||
}
|
||||
|
||||
// @Summary 获取用户
|
||||
// @Description 获取JSON
|
||||
// @Tags 用户
|
||||
// @Param userId path int true "用户编码"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/user/sysUser/{userId} [get]
|
||||
// @Security
|
||||
// GetSysUser 获取用户
|
||||
func (u *UserApi) GetSysUser(rc *restfulx.ReqCtx) {
|
||||
userId := restfulx.PathParamInt(rc, "userId")
|
||||
|
||||
@@ -309,12 +253,7 @@ func (u *UserApi) GetSysUser(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 获取添加用户角色和职位
|
||||
// @Description 获取JSON
|
||||
// @Tags 用户
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/user/getInit [get]
|
||||
// @Security
|
||||
// GetSysUserInit 获取添加用户角色和职位
|
||||
func (u *UserApi) GetSysUserInit(rc *restfulx.ReqCtx) {
|
||||
|
||||
var role entity.SysRole
|
||||
@@ -333,12 +272,7 @@ func (u *UserApi) GetSysUserInit(rc *restfulx.ReqCtx) {
|
||||
rc.ResData = mp
|
||||
}
|
||||
|
||||
// @Summary 获取添加用户角色和职位
|
||||
// @Description 获取JSON
|
||||
// @Tags 用户
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/user/getInit [get]
|
||||
// @Security
|
||||
// GetUserRolePost 获取添加用户角色和职位
|
||||
func (u *UserApi) GetUserRolePost(rc *restfulx.ReqCtx) {
|
||||
var user entity.SysUser
|
||||
user.UserId = rc.LoginAccount.UserId
|
||||
@@ -361,15 +295,7 @@ func (u *UserApi) GetUserRolePost(rc *restfulx.ReqCtx) {
|
||||
rc.ResData = mp
|
||||
}
|
||||
|
||||
// @Summary 创建用户
|
||||
// @Description 获取JSON
|
||||
// @Tags 用户
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysUser true "用户数据"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/user/sysUser [post]
|
||||
// InsertSysUser 创建用户
|
||||
func (u *UserApi) InsertSysUser(rc *restfulx.ReqCtx) {
|
||||
var sysUser entity.SysUser
|
||||
restfulx.BindQuery(rc, &sysUser)
|
||||
@@ -377,15 +303,7 @@ func (u *UserApi) InsertSysUser(rc *restfulx.ReqCtx) {
|
||||
u.UserApp.Insert(sysUser)
|
||||
}
|
||||
|
||||
// @Summary 修改用户数据
|
||||
// @Description 获取JSON
|
||||
// @Tags 用户
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysUser true "用户数据"g
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/user/sysUser [put]
|
||||
// UpdateSysUser 修改用户数据
|
||||
func (u *UserApi) UpdateSysUser(rc *restfulx.ReqCtx) {
|
||||
var sysUser entity.SysUser
|
||||
restfulx.BindQuery(rc, &sysUser)
|
||||
@@ -393,15 +311,7 @@ func (u *UserApi) UpdateSysUser(rc *restfulx.ReqCtx) {
|
||||
u.UserApp.Update(sysUser)
|
||||
}
|
||||
|
||||
// @Summary 修改用户状态
|
||||
// @Description 获取JSON
|
||||
// @Tags 用户
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysUser true "用户数据"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/user/sysUser [put]
|
||||
// UpdateSysUserStu 修改用户状态
|
||||
func (u *UserApi) UpdateSysUserStu(rc *restfulx.ReqCtx) {
|
||||
var sysUser entity.SysUser
|
||||
restfulx.BindQuery(rc, &sysUser)
|
||||
@@ -409,27 +319,13 @@ func (u *UserApi) UpdateSysUserStu(rc *restfulx.ReqCtx) {
|
||||
u.UserApp.Update(sysUser)
|
||||
}
|
||||
|
||||
// @Summary 删除用户数据
|
||||
// @Description 删除数据
|
||||
// @Tags 用户
|
||||
// @Param userId path int true "多个id 使用逗号隔开"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/user/sysuser/{userId} [delete]
|
||||
// DeleteSysUser 删除用户数据
|
||||
func (u *UserApi) DeleteSysUser(rc *restfulx.ReqCtx) {
|
||||
userIds := restfulx.PathParam(rc, "userId")
|
||||
u.UserApp.Delete(utils.IdsStrToIdsIntGroup(userIds))
|
||||
}
|
||||
|
||||
// @Summary 导出用户
|
||||
// @Description 导出数据
|
||||
// @Tags 用户
|
||||
// @Param userName query string false "userName"
|
||||
// @Param phone query string false "phone"
|
||||
// @Param status query string false "status"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/dict/type/export [get]
|
||||
// ExportUser 导出用户
|
||||
func (u *UserApi) ExportUser(rc *restfulx.ReqCtx) {
|
||||
filename := restfulx.QueryParam(rc, "filename")
|
||||
status := restfulx.QueryParam(rc, "status")
|
||||
|
||||
Reference in New Issue
Block a user