【更新】更新

This commit is contained in:
PandaGoAdmin
2022-08-02 17:19:14 +08:00
parent 791a23306c
commit 0555922a90
50 changed files with 678 additions and 450 deletions

View File

@@ -5,7 +5,6 @@ import (
entity "pandax/apps/system/entity"
services "pandax/apps/system/services"
"pandax/base/casbin"
"pandax/base/ctx"
"pandax/base/ginx"
"pandax/base/utils"
"strconv"
@@ -23,7 +22,7 @@ type SystemApiApi struct {
// @Param data body entity.SysApi true "api路径, api中文描述, api组, 方法"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /system/api [post]
func (s *SystemApiApi) CreateApi(rc *ctx.ReqCtx) {
func (s *SystemApiApi) CreateApi(rc *ginx.ReqCtx) {
var api entity.SysApi
ginx.BindJsonAndValid(rc.GinCtx, &api)
log.Println(api)
@@ -37,7 +36,7 @@ func (s *SystemApiApi) CreateApi(rc *ctx.ReqCtx) {
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /system/api/{id} [delete]
func (s *SystemApiApi) DeleteApi(rc *ctx.ReqCtx) {
func (s *SystemApiApi) DeleteApi(rc *ginx.ReqCtx) {
ids := rc.GinCtx.Param("id")
s.ApiApp.Delete(utils.IdsStrToIdsIntGroup(ids))
}
@@ -55,7 +54,7 @@ func (s *SystemApiApi) DeleteApi(rc *ctx.ReqCtx) {
// @Param pageNum query int false "页码"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /system/api/list [get]
func (s *SystemApiApi) GetApiList(rc *ctx.ReqCtx) {
func (s *SystemApiApi) GetApiList(rc *ginx.ReqCtx) {
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
path := rc.GinCtx.Query("path")
@@ -80,7 +79,7 @@ func (s *SystemApiApi) GetApiList(rc *ctx.ReqCtx) {
// @Param id path int true "根据id获取api"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /system/api/{id} [get]
func (s *SystemApiApi) GetApiById(rc *ctx.ReqCtx) {
func (s *SystemApiApi) GetApiById(rc *ginx.ReqCtx) {
id := ginx.QueryInt(rc.GinCtx, "id", 0)
rc.ResData = s.ApiApp.FindOne(int64(id))
@@ -94,7 +93,7 @@ func (s *SystemApiApi) GetApiById(rc *ctx.ReqCtx) {
// @Param data body entity.SysApi true "api路径, api中文描述, api组, 方法"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
// @Router /api/api [put]
func (s *SystemApiApi) UpdateApi(rc *ctx.ReqCtx) {
func (s *SystemApiApi) UpdateApi(rc *ginx.ReqCtx) {
var api entity.SysApi
ginx.BindJsonAndValid(rc.GinCtx, &api)
s.ApiApp.Update(api)
@@ -107,7 +106,7 @@ func (s *SystemApiApi) UpdateApi(rc *ctx.ReqCtx) {
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /system/api/all [get]
func (s *SystemApiApi) GetAllApis(rc *ctx.ReqCtx) {
func (s *SystemApiApi) GetAllApis(rc *ginx.ReqCtx) {
rc.ResData = s.ApiApp.FindList(entity.SysApi{})
}
@@ -119,7 +118,7 @@ func (s *SystemApiApi) GetAllApis(rc *ctx.ReqCtx) {
// @Param roleKey query string true "权限id, 权限模型列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /casbin/getPolicyPathByRoleId [get]
func (s *SystemApiApi) GetPolicyPathByRoleId(rc *ctx.ReqCtx) {
func (s *SystemApiApi) GetPolicyPathByRoleId(rc *ginx.ReqCtx) {
roleKey := rc.GinCtx.Query("roleKey")
tenantId := strconv.Itoa(int(rc.LoginAccount.TenantId))
rc.ResData = casbin.GetPolicyPathByRoleId(tenantId, roleKey)

View File

@@ -4,7 +4,6 @@ import (
entity "pandax/apps/system/entity"
services "pandax/apps/system/services"
"pandax/base/biz"
"pandax/base/ctx"
"pandax/base/ginx"
"pandax/base/utils"
)
@@ -24,7 +23,7 @@ type ConfigApi struct {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/config [get]
// @Security
func (p *ConfigApi) GetConfigList(rc *ctx.ReqCtx) {
func (p *ConfigApi) GetConfigList(rc *ginx.ReqCtx) {
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
configName := rc.GinCtx.Query("configName")
@@ -48,7 +47,7 @@ func (p *ConfigApi) GetConfigList(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/config/configKey [get]
// @Security
func (p *ConfigApi) GetConfigListByKey(rc *ctx.ReqCtx) {
func (p *ConfigApi) GetConfigListByKey(rc *ginx.ReqCtx) {
configKey := rc.GinCtx.Query("configKey")
biz.IsTrue(configKey != "", "请传入配置Key")
rc.ResData = p.ConfigApp.FindList(entity.SysConfig{ConfigKey: configKey})
@@ -61,7 +60,7 @@ func (p *ConfigApi) GetConfigListByKey(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/config/{configId} [get]
// @Security
func (p *ConfigApi) GetConfig(rc *ctx.ReqCtx) {
func (p *ConfigApi) GetConfig(rc *ginx.ReqCtx) {
id := ginx.PathParamInt(rc.GinCtx, "configId")
p.ConfigApp.FindOne(int64(id))
}
@@ -76,7 +75,7 @@ func (p *ConfigApi) GetConfig(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/config [post]
// @Security X-TOKEN
func (p *ConfigApi) InsertConfig(rc *ctx.ReqCtx) {
func (p *ConfigApi) InsertConfig(rc *ginx.ReqCtx) {
var config entity.SysConfig
ginx.BindJsonAndValid(rc.GinCtx, &config)
@@ -93,7 +92,7 @@ func (p *ConfigApi) InsertConfig(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/config [put]
// @Security X-TOKEN
func (p *ConfigApi) UpdateConfig(rc *ctx.ReqCtx) {
func (p *ConfigApi) UpdateConfig(rc *ginx.ReqCtx) {
var post entity.SysConfig
ginx.BindJsonAndValid(rc.GinCtx, &post)
p.ConfigApp.Update(post)
@@ -106,7 +105,7 @@ func (p *ConfigApi) UpdateConfig(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /system/config/{configId} [delete]
func (p *ConfigApi) DeleteConfig(rc *ctx.ReqCtx) {
func (p *ConfigApi) DeleteConfig(rc *ginx.ReqCtx) {
configId := rc.GinCtx.Param("configId")
p.ConfigApp.Delete(utils.IdsStrToIdsIntGroup(configId))
}

View File

@@ -6,7 +6,6 @@ import (
entity "pandax/apps/system/entity"
services "pandax/apps/system/services"
"pandax/base/biz"
"pandax/base/ctx"
"pandax/base/ginx"
"pandax/base/utils"
"pandax/pkg/global"
@@ -26,13 +25,12 @@ type DeptApi struct {
// @Success 200 {string} string "{"code": 400, "message": "抱歉未找到相关信息"}"
// @Router /system/menu/menuTreRoleSelect/{roleId} [get]
// @Security X-TOKEN
func (m *DeptApi) GetDeptTreeRoleSelect(rc *ctx.ReqCtx) {
func (m *DeptApi) GetDeptTreeRoleSelect(rc *ginx.ReqCtx) {
roleId := ginx.PathParamInt(rc.GinCtx, "roleId")
var dept entity.SysDept
if !IsTenantAdmin(rc.LoginAccount.TenantId) {
dept.TenantId = rc.LoginAccount.TenantId
}
result := m.DeptApp.SelectDeptLable(dept)
deptIds := make([]int64, 0)
@@ -54,7 +52,7 @@ func (m *DeptApi) GetDeptTreeRoleSelect(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/dept/deptList [get]
// @Security
func (a *DeptApi) GetDeptList(rc *ctx.ReqCtx) {
func (a *DeptApi) GetDeptList(rc *ginx.ReqCtx) {
//pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
//pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
deptName := rc.GinCtx.Query("deptName")
@@ -77,7 +75,7 @@ func (a *DeptApi) GetDeptList(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/dept/ordinaryDeptLis [get]
// @Security
func (a *DeptApi) GetOrdinaryDeptList(rc *ctx.ReqCtx) {
func (a *DeptApi) GetOrdinaryDeptList(rc *ginx.ReqCtx) {
var dept entity.SysDept
if !IsTenantAdmin(rc.LoginAccount.TenantId) {
dept.TenantId = rc.LoginAccount.TenantId
@@ -95,7 +93,7 @@ func (a *DeptApi) GetOrdinaryDeptList(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/dept/deptTree [get]
// @Security
func (a *DeptApi) GetDeptTree(rc *ctx.ReqCtx) {
func (a *DeptApi) GetDeptTree(rc *ginx.ReqCtx) {
deptName := rc.GinCtx.Query("deptName")
status := rc.GinCtx.Query("status")
deptId := ginx.QueryInt(rc.GinCtx, "deptId", 0)
@@ -113,7 +111,7 @@ func (a *DeptApi) GetDeptTree(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/dept/{deptId} [get]
// @Security
func (a *DeptApi) GetDept(rc *ctx.ReqCtx) {
func (a *DeptApi) GetDept(rc *ginx.ReqCtx) {
deptId := ginx.PathParamInt(rc.GinCtx, "deptId")
rc.ResData = a.DeptApp.FindOne(int64(deptId))
}
@@ -128,7 +126,7 @@ func (a *DeptApi) GetDept(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/dept [post]
// @Security Bearer
func (a *DeptApi) InsertDept(rc *ctx.ReqCtx) {
func (a *DeptApi) InsertDept(rc *ginx.ReqCtx) {
var dept entity.SysDept
g := rc.GinCtx
ginx.BindJsonAndValid(g, &dept)
@@ -147,7 +145,7 @@ func (a *DeptApi) InsertDept(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
// @Router /system/dept [put]
// @Security Bearer
func (a *DeptApi) UpdateDept(rc *ctx.ReqCtx) {
func (a *DeptApi) UpdateDept(rc *ginx.ReqCtx) {
var dept entity.SysDept
g := rc.GinCtx
ginx.BindJsonAndValid(g, &dept)
@@ -163,7 +161,7 @@ func (a *DeptApi) UpdateDept(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /system/dept/{deptId} [delete]
func (a *DeptApi) DeleteDept(rc *ctx.ReqCtx) {
func (a *DeptApi) DeleteDept(rc *ginx.ReqCtx) {
deptId := rc.GinCtx.Param("deptId")
deptIds := utils.IdsStrToIdsIntGroup(deptId)

View File

@@ -5,7 +5,6 @@ import (
entity "pandax/apps/system/entity"
services "pandax/apps/system/services"
"pandax/base/biz"
"pandax/base/ctx"
"pandax/base/ginx"
"pandax/base/utils"
"pandax/pkg/global"
@@ -27,7 +26,7 @@ type DictApi struct {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/dict/type/list [get]
// @Security
func (p *DictApi) GetDictTypeList(rc *ctx.ReqCtx) {
func (p *DictApi) GetDictTypeList(rc *ginx.ReqCtx) {
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
status := rc.GinCtx.Query("status")
@@ -50,7 +49,7 @@ func (p *DictApi) GetDictTypeList(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/dict/type/{dictId} [get]
// @Security
func (p *DictApi) GetDictType(rc *ctx.ReqCtx) {
func (p *DictApi) GetDictType(rc *ginx.ReqCtx) {
dictId := ginx.PathParamInt(rc.GinCtx, "dictId")
p.DictType.FindOne(int64(dictId))
}
@@ -65,7 +64,7 @@ func (p *DictApi) GetDictType(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/dict/type [post]
// @Security X-TOKEN
func (p *DictApi) InsertDictType(rc *ctx.ReqCtx) {
func (p *DictApi) InsertDictType(rc *ginx.ReqCtx) {
var dict entity.SysDictType
ginx.BindJsonAndValid(rc.GinCtx, &dict)
@@ -83,7 +82,7 @@ func (p *DictApi) InsertDictType(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/dict/type [put]
// @Security X-TOKEN
func (p *DictApi) UpdateDictType(rc *ctx.ReqCtx) {
func (p *DictApi) UpdateDictType(rc *ginx.ReqCtx) {
var dict entity.SysDictType
ginx.BindJsonAndValid(rc.GinCtx, &dict)
@@ -98,7 +97,7 @@ func (p *DictApi) UpdateDictType(rc *ctx.ReqCtx) {
// @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 *ctx.ReqCtx) {
func (p *DictApi) DeleteDictType(rc *ginx.ReqCtx) {
dictId := rc.GinCtx.Param("dictId")
dictIds := utils.IdsStrToIdsIntGroup(dictId)
@@ -124,7 +123,7 @@ func (p *DictApi) DeleteDictType(rc *ctx.ReqCtx) {
// @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 *ctx.ReqCtx) {
func (p *DictApi) ExportDictType(rc *ginx.ReqCtx) {
filename := rc.GinCtx.Query("filename")
status := rc.GinCtx.Query("status")
dictName := rc.GinCtx.Query("dictName")
@@ -145,7 +144,7 @@ func (p *DictApi) ExportDictType(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/dict/data/list [get]
// @Security
func (p *DictApi) GetDictDataList(rc *ctx.ReqCtx) {
func (p *DictApi) GetDictDataList(rc *ginx.ReqCtx) {
dictLabel := rc.GinCtx.Query("dictLabel")
dictType := rc.GinCtx.Query("dictType")
status := rc.GinCtx.Query("status")
@@ -159,7 +158,7 @@ func (p *DictApi) GetDictDataList(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/dict/data/type [get]
// @Security
func (p *DictApi) GetDictDataListByDictType(rc *ctx.ReqCtx) {
func (p *DictApi) GetDictDataListByDictType(rc *ginx.ReqCtx) {
dictType := rc.GinCtx.Query("dictType")
biz.IsTrue(dictType != "", "请传入字典类型")
rc.ResData = p.DictData.FindList(entity.SysDictData{DictType: dictType})
@@ -172,7 +171,7 @@ func (p *DictApi) GetDictDataListByDictType(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/dict/data/{dictCode} [get]
// @Security
func (p *DictApi) GetDictData(rc *ctx.ReqCtx) {
func (p *DictApi) GetDictData(rc *ginx.ReqCtx) {
dictCode := ginx.PathParamInt(rc.GinCtx, "dictCode")
p.DictData.FindOne(int64(dictCode))
}
@@ -187,7 +186,7 @@ func (p *DictApi) GetDictData(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/dict/data [post]
// @Security X-TOKEN
func (p *DictApi) InsertDictData(rc *ctx.ReqCtx) {
func (p *DictApi) InsertDictData(rc *ginx.ReqCtx) {
var data entity.SysDictData
ginx.BindJsonAndValid(rc.GinCtx, &data)
@@ -205,7 +204,7 @@ func (p *DictApi) InsertDictData(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/dict/data [put]
// @Security X-TOKEN
func (p *DictApi) UpdateDictData(rc *ctx.ReqCtx) {
func (p *DictApi) UpdateDictData(rc *ginx.ReqCtx) {
var data entity.SysDictData
ginx.BindJsonAndValid(rc.GinCtx, &data)
@@ -220,7 +219,7 @@ func (p *DictApi) UpdateDictData(rc *ctx.ReqCtx) {
// @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 *ctx.ReqCtx) {
func (p *DictApi) DeleteDictData(rc *ginx.ReqCtx) {
param := rc.GinCtx.Param("dictCode")
p.DictData.Delete(utils.IdsStrToIdsIntGroup(param))
}

View File

@@ -4,7 +4,6 @@ import (
entity "pandax/apps/system/entity"
services "pandax/apps/system/services"
"pandax/base/biz"
"pandax/base/ctx"
"pandax/base/ginx"
)
@@ -23,7 +22,7 @@ type MenuApi struct {
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/menu/menuTreSelect [get]
// @Security X-TOKEN
func (m *MenuApi) GetMenuTreeSelect(rc *ctx.ReqCtx) {
func (m *MenuApi) GetMenuTreeSelect(rc *ginx.ReqCtx) {
lable := m.MenuApp.SelectMenuLable(entity.SysMenu{})
rc.ResData = lable
}
@@ -35,7 +34,7 @@ func (m *MenuApi) GetMenuTreeSelect(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "抱歉未找到相关信息"}"
// @Router /system/menu/menuRole [get]
// @Security X-TOKEN
func (m *MenuApi) GetMenuRole(rc *ctx.ReqCtx) {
func (m *MenuApi) GetMenuRole(rc *ginx.ReqCtx) {
roleKey := rc.GinCtx.Query("roleKey")
biz.IsTrue(roleKey != "", "请传入角色Key")
rc.ResData = Build(*m.MenuApp.SelectMenuRole(roleKey))
@@ -49,7 +48,7 @@ func (m *MenuApi) GetMenuRole(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "抱歉未找到相关信息"}"
// @Router /system/menu/menuTreRoleSelect/{roleId} [get]
// @Security X-TOKEN
func (m *MenuApi) GetMenuTreeRoleSelect(rc *ctx.ReqCtx) {
func (m *MenuApi) GetMenuTreeRoleSelect(rc *ginx.ReqCtx) {
roleId := ginx.PathParamInt(rc.GinCtx, "roleId")
result := m.MenuApp.SelectMenuLable(entity.SysMenu{})
@@ -71,7 +70,7 @@ func (m *MenuApi) GetMenuTreeRoleSelect(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "抱歉未找到相关信息"}"
// @Router /system/menu/menuPaths [get]
// @Security X-TOKEN
func (m *MenuApi) GetMenuPaths(rc *ctx.ReqCtx) {
func (m *MenuApi) GetMenuPaths(rc *ginx.ReqCtx) {
roleKey := rc.GinCtx.Query("roleKey")
biz.IsTrue(roleKey != "", "请传入角色Key")
rc.ResData = m.RoleMenuApp.GetMenuPaths(entity.SysRoleMenu{RoleName: roleKey})
@@ -87,7 +86,7 @@ func (m *MenuApi) GetMenuPaths(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "抱歉未找到相关信息"}"
// @Router /system/menu/menuList [get]
// @Security Bearer
func (m *MenuApi) GetMenuList(rc *ctx.ReqCtx) {
func (m *MenuApi) GetMenuList(rc *ginx.ReqCtx) {
menuName := rc.GinCtx.Query("menuName")
status := rc.GinCtx.Query("status")
@@ -107,7 +106,7 @@ func (m *MenuApi) GetMenuList(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "抱歉未找到相关信息"}"
// @Router /system/menu/{menuId} [get]
// @Security Bearer
func (m *MenuApi) GetMenu(rc *ctx.ReqCtx) {
func (m *MenuApi) GetMenu(rc *ginx.ReqCtx) {
menuId := ginx.PathParamInt(rc.GinCtx, "menuId")
rc.ResData = m.MenuApp.FindOne(int64(menuId))
@@ -121,7 +120,7 @@ func (m *MenuApi) GetMenu(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
// @Router /system/menu [post]
// @Security X-TOKEN
func (m *MenuApi) InsertMenu(rc *ctx.ReqCtx) {
func (m *MenuApi) InsertMenu(rc *ginx.ReqCtx) {
var menu entity.SysMenu
ginx.BindJsonAndValid(rc.GinCtx, &menu)
menu.CreateBy = rc.LoginAccount.UserName
@@ -142,7 +141,7 @@ func (m *MenuApi) InsertMenu(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": -1, "message": "修改失败"}"
// @Router /system/menu [put]
// @Security X-TOKEN
func (m *MenuApi) UpdateMenu(rc *ctx.ReqCtx) {
func (m *MenuApi) UpdateMenu(rc *ginx.ReqCtx) {
var menu entity.SysMenu
ginx.BindJsonAndValid(rc.GinCtx, &menu)
menu.UpdateBy = rc.LoginAccount.UserName
@@ -162,7 +161,7 @@ func (m *MenuApi) UpdateMenu(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /system/menu/{menuId} [delete]
func (m *MenuApi) DeleteMenu(rc *ctx.ReqCtx) {
func (m *MenuApi) DeleteMenu(rc *ginx.ReqCtx) {
menuId := ginx.PathParamInt(rc.GinCtx, "menuId")
m.MenuApp.Delete([]int64{int64(menuId)})
}

View File

@@ -3,7 +3,6 @@ package api
import (
"pandax/apps/system/entity"
"pandax/apps/system/services"
"pandax/base/ctx"
"pandax/base/ginx"
"pandax/base/utils"
"strings"
@@ -24,7 +23,7 @@ type NoticeApi struct {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/post [get]
// @Security
func (p *NoticeApi) GetNoticeList(rc *ctx.ReqCtx) {
func (p *NoticeApi) GetNoticeList(rc *ginx.ReqCtx) {
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
noticeType := rc.GinCtx.Query("noticeType")
@@ -56,7 +55,7 @@ func (p *NoticeApi) GetNoticeList(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/notice [post]
// @Security X-TOKEN
func (p *NoticeApi) InsertNotice(rc *ctx.ReqCtx) {
func (p *NoticeApi) InsertNotice(rc *ginx.ReqCtx) {
var notice entity.SysNotice
ginx.BindJsonAndValid(rc.GinCtx, &notice)
notice.UserName = rc.LoginAccount.UserName
@@ -73,7 +72,7 @@ func (p *NoticeApi) InsertNotice(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/notice [put]
// @Security X-TOKEN
func (p *NoticeApi) UpdateNotice(rc *ctx.ReqCtx) {
func (p *NoticeApi) UpdateNotice(rc *ginx.ReqCtx) {
var notice entity.SysNotice
ginx.BindJsonAndValid(rc.GinCtx, &notice)
@@ -87,7 +86,7 @@ func (p *NoticeApi) UpdateNotice(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /system/notice/{noticeId} [delete]
func (p *NoticeApi) DeleteNotice(rc *ctx.ReqCtx) {
func (p *NoticeApi) DeleteNotice(rc *ginx.ReqCtx) {
noticeId := rc.GinCtx.Param("noticeId")
noticeIds := utils.IdsStrToIdsIntGroup(noticeId)
p.NoticeApp.Delete(noticeIds)

View File

@@ -6,7 +6,6 @@ import (
"pandax/apps/system/entity"
"pandax/apps/system/services"
"pandax/base/biz"
"pandax/base/ctx"
"pandax/base/ginx"
"pandax/base/utils"
"pandax/pkg/global"
@@ -29,7 +28,7 @@ type PostApi struct {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/post [get]
// @Security
func (p *PostApi) GetPostList(rc *ctx.ReqCtx) {
func (p *PostApi) GetPostList(rc *ginx.ReqCtx) {
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
@@ -59,7 +58,7 @@ func (p *PostApi) GetPostList(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/post/{postId} [get]
// @Security
func (p *PostApi) GetPost(rc *ctx.ReqCtx) {
func (p *PostApi) GetPost(rc *ginx.ReqCtx) {
postId := ginx.PathParamInt(rc.GinCtx, "postId")
p.PostApp.FindOne(int64(postId))
}
@@ -74,7 +73,7 @@ func (p *PostApi) GetPost(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/post [post]
// @Security X-TOKEN
func (p *PostApi) InsertPost(rc *ctx.ReqCtx) {
func (p *PostApi) InsertPost(rc *ginx.ReqCtx) {
var post entity.SysPost
ginx.BindJsonAndValid(rc.GinCtx, &post)
post.TenantId = rc.LoginAccount.TenantId
@@ -92,7 +91,7 @@ func (p *PostApi) InsertPost(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/post [put]
// @Security X-TOKEN
func (p *PostApi) UpdatePost(rc *ctx.ReqCtx) {
func (p *PostApi) UpdatePost(rc *ginx.ReqCtx) {
var post entity.SysPost
ginx.BindJsonAndValid(rc.GinCtx, &post)
@@ -107,7 +106,7 @@ func (p *PostApi) UpdatePost(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /system/post/{postId} [delete]
func (p *PostApi) DeletePost(rc *ctx.ReqCtx) {
func (p *PostApi) DeletePost(rc *ginx.ReqCtx) {
postId := rc.GinCtx.Param("postId")
postIds := utils.IdsStrToIdsIntGroup(postId)

View File

@@ -7,7 +7,6 @@ import (
services "pandax/apps/system/services"
"pandax/base/biz"
"pandax/base/casbin"
"pandax/base/ctx"
"pandax/base/ginx"
"pandax/base/utils"
"pandax/pkg/global"
@@ -32,7 +31,7 @@ type RoleApi struct {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/role/rolelist [get]
// @Security
func (r *RoleApi) GetRoleList(rc *ctx.ReqCtx) {
func (r *RoleApi) GetRoleList(rc *ginx.ReqCtx) {
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
status := rc.GinCtx.Query("status")
@@ -62,7 +61,7 @@ func (r *RoleApi) GetRoleList(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "抱歉未找到相关信息"}"
// @Router /system/role [get]
// @Security X-TOKEN
func (r *RoleApi) GetRole(rc *ctx.ReqCtx) {
func (r *RoleApi) GetRole(rc *ginx.ReqCtx) {
roleId := ginx.PathParamInt(rc.GinCtx, "roleId")
role := r.RoleApp.FindOne(int64(roleId))
role.MenuIds = r.RoleApp.GetRoleMeunId(entity.SysRole{RoleId: int64(roleId)})
@@ -79,7 +78,7 @@ func (r *RoleApi) GetRole(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/role [post]
func (r *RoleApi) InsertRole(rc *ctx.ReqCtx) {
func (r *RoleApi) InsertRole(rc *ginx.ReqCtx) {
var role entity.SysRole
ginx.BindJsonAndValid(rc.GinCtx, &role)
role.CreateBy = rc.LoginAccount.UserName
@@ -101,7 +100,7 @@ func (r *RoleApi) InsertRole(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "修改成功"}"
// @Success 200 {string} string "{"code": 400, "message": "修改失败"}"
// @Router /system/role [put]
func (r *RoleApi) UpdateRole(rc *ctx.ReqCtx) {
func (r *RoleApi) UpdateRole(rc *ginx.ReqCtx) {
var role entity.SysRole
ginx.BindJsonAndValid(rc.GinCtx, &role)
role.UpdateBy = rc.LoginAccount.UserName
@@ -125,7 +124,7 @@ func (r *RoleApi) UpdateRole(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "修改成功"}"
// @Success 200 {string} string "{"code": 400, "message": "修改失败"}"
// @Router /system/role/changeStatus [put]
func (r *RoleApi) UpdateRoleStatus(rc *ctx.ReqCtx) {
func (r *RoleApi) UpdateRoleStatus(rc *ginx.ReqCtx) {
var role entity.SysRole
ginx.BindJsonAndValid(rc.GinCtx, &role)
role.UpdateBy = rc.LoginAccount.UserName
@@ -142,7 +141,7 @@ func (r *RoleApi) UpdateRoleStatus(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "修改成功"}"
// @Success 200 {string} string "{"code": 400, "message": "修改失败"}"
// @Router /system/role/dataScope [put]
func (r *RoleApi) UpdateRoleDataScope(rc *ctx.ReqCtx) {
func (r *RoleApi) UpdateRoleDataScope(rc *ginx.ReqCtx) {
var role entity.SysRole
ginx.BindJsonAndValid(rc.GinCtx, &role)
role.UpdateBy = rc.LoginAccount.UserName
@@ -163,7 +162,7 @@ func (r *RoleApi) UpdateRoleDataScope(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /system/role/{roleId} [delete]
func (r *RoleApi) DeleteRole(rc *ctx.ReqCtx) {
func (r *RoleApi) DeleteRole(rc *ginx.ReqCtx) {
roleId := rc.GinCtx.Param("roleId")
roleIds := utils.IdsStrToIdsIntGroup(roleId)
@@ -198,7 +197,7 @@ func (r *RoleApi) DeleteRole(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /system/dict/type/export [get]
func (p *RoleApi) ExportRole(rc *ctx.ReqCtx) {
func (p *RoleApi) ExportRole(rc *ginx.ReqCtx) {
filename := rc.GinCtx.Query("filename")
status := rc.GinCtx.Query("status")
roleName := rc.GinCtx.Query("roleName")

View File

@@ -7,7 +7,7 @@ import (
"github.com/kakuilan/kgo"
"net/http"
"pandax/base/biz"
"pandax/base/ctx"
"pandax/base/ginx"
"pandax/base/ws"
"runtime"
)
@@ -71,8 +71,8 @@ func (s *System) ConnectWs(g *gin.Context) {
panic(any(biz.NewBizErr("升级websocket失败")))
}
// 权限校验
rc := ctx.NewReqCtxWithGin(g)
if err = ctx.PermissionHandler(rc); err != nil {
rc := ginx.NewReqCtx(g)
if err = ginx.PermissionHandler(rc); err != nil {
panic(any(biz.NewBizErr("没有权限")))
}

View File

@@ -8,7 +8,6 @@ package api
import (
"pandax/apps/system/entity"
"pandax/apps/system/services"
"pandax/base/ctx"
"pandax/base/ginx"
"pandax/base/utils"
)
@@ -24,7 +23,7 @@ type SysTenantsApi struct {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/tenant/list [get]
// @Security
func (p *SysTenantsApi) GetSysTenantsList(rc *ctx.ReqCtx) {
func (p *SysTenantsApi) GetSysTenantsList(rc *ginx.ReqCtx) {
data := entity.SysTenants{}
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
@@ -44,7 +43,7 @@ func (p *SysTenantsApi) GetSysTenantsList(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/tenant/lists [get]
// @Security
func (p *SysTenantsApi) GetSysTenantsAll(rc *ctx.ReqCtx) {
func (p *SysTenantsApi) GetSysTenantsAll(rc *ginx.ReqCtx) {
list := make([]entity.SysTenants, 0)
if rc.LoginAccount.RoleKey == "admin" {
data := entity.SysTenants{}
@@ -62,7 +61,7 @@ func (p *SysTenantsApi) GetSysTenantsAll(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/tenant/{tenantId} [get]
// @Security
func (p *SysTenantsApi) GetSysTenants(rc *ctx.ReqCtx) {
func (p *SysTenantsApi) GetSysTenants(rc *ginx.ReqCtx) {
tenantId := ginx.PathParamInt(rc.GinCtx, "tenantId")
p.SysTenantsApp.FindOne(int64(tenantId))
}
@@ -77,7 +76,7 @@ func (p *SysTenantsApi) GetSysTenants(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/tenant [post]
// @Security X-TOKEN
func (p *SysTenantsApi) InsertSysTenants(rc *ctx.ReqCtx) {
func (p *SysTenantsApi) InsertSysTenants(rc *ginx.ReqCtx) {
var data entity.SysTenants
ginx.BindJsonAndValid(rc.GinCtx, &data)
@@ -94,7 +93,7 @@ func (p *SysTenantsApi) InsertSysTenants(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/tenant [put]
// @Security X-TOKEN
func (p *SysTenantsApi) UpdateSysTenants(rc *ctx.ReqCtx) {
func (p *SysTenantsApi) UpdateSysTenants(rc *ginx.ReqCtx) {
var data entity.SysTenants
ginx.BindJsonAndValid(rc.GinCtx, &data)
@@ -108,7 +107,7 @@ func (p *SysTenantsApi) UpdateSysTenants(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /system/tenant/{tenantId} [delete]
func (p *SysTenantsApi) DeleteSysTenants(rc *ctx.ReqCtx) {
func (p *SysTenantsApi) DeleteSysTenants(rc *ginx.ReqCtx) {
tenantId := rc.GinCtx.Param("tenantId")
tenantIds := utils.IdsStrToIdsIntGroup(tenantId)
p.SysTenantsApp.Delete(tenantIds)

View File

@@ -9,6 +9,7 @@ import (
"pandax/apps/system/api/form"
"pandax/apps/system/api/vo"
"pandax/apps/system/entity"
"pandax/base/token"
logEntity "pandax/apps/log/entity"
logServices "pandax/apps/log/services"
@@ -16,7 +17,6 @@ import (
"pandax/apps/system/services"
"pandax/base/biz"
"pandax/base/captcha"
"pandax/base/ctx"
"pandax/base/ginx"
"pandax/base/utils"
"pandax/pkg/global"
@@ -49,9 +49,9 @@ func (u *UserApi) GenerateCaptcha(c *gin.Context) {
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"登陆成功"}"
// @Router /system/user/refreshToken [get]
func (u *UserApi) RefreshToken(rc *ctx.ReqCtx) {
func (u *UserApi) RefreshToken(rc *ginx.ReqCtx) {
tokenStr := rc.GinCtx.Request.Header.Get("X-TOKEN")
j := ctx.NewJWT("", []byte(global.Conf.Jwt.Key), jwt.SigningMethodHS256)
j := token.NewJWT("", []byte(global.Conf.Jwt.Key), jwt.SigningMethodHS256)
token, err := j.RefreshToken(tokenStr)
biz.ErrIsNil(err, "刷新token失败")
rc.ResData = map[string]any{"token": token, "expire": time.Now().Unix() + global.Conf.Jwt.ExpireTime}
@@ -63,15 +63,15 @@ func (u *UserApi) RefreshToken(rc *ctx.ReqCtx) {
// @Param data body form.Login true "用户名, 密码, 验证码"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"登陆成功"}"
// @Router /system/user/login [post]
func (u *UserApi) Login(rc *ctx.ReqCtx) {
func (u *UserApi) Login(rc *ginx.ReqCtx) {
var l form.Login
ginx.BindJsonAndValid(rc.GinCtx, &l)
biz.IsTrue(captcha.Verify(l.CaptchaId, l.Captcha), "验证码认证失败")
login := u.UserApp.Login(entity.Login{Username: l.Username, Password: l.Password})
role := u.RoleApp.FindOne(login.RoleId)
j := ctx.NewJWT("", []byte(global.Conf.Jwt.Key), jwt.SigningMethodHS256)
token, err := j.CreateToken(ctx.Claims{
j := token.NewJWT("", []byte(global.Conf.Jwt.Key), jwt.SigningMethodHS256)
token, err := j.CreateToken(token.Claims{
UserId: login.UserId,
TenantId: login.TenantId,
UserName: login.Username,
@@ -115,7 +115,7 @@ func (u *UserApi) Login(rc *ctx.ReqCtx) {
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"成功"}"
// @Router /system/user/auth [get]
func (u *UserApi) Auth(rc *ctx.ReqCtx) {
func (u *UserApi) Auth(rc *ginx.ReqCtx) {
userName := rc.GinCtx.Query("username")
biz.NotEmpty(userName, "用户名必传")
var user entity.SysUser
@@ -139,7 +139,7 @@ func (u *UserApi) Auth(rc *ctx.ReqCtx) {
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"登陆成功"}"
// @Router /system/user/logout [post]
func (u *UserApi) LogOut(rc *ctx.ReqCtx) {
func (u *UserApi) LogOut(rc *ginx.ReqCtx) {
var loginLog logEntity.LogLogin
ua := user_agent.New(rc.GinCtx.Request.UserAgent())
loginLog.Ipaddr = rc.GinCtx.ClientIP()
@@ -167,7 +167,7 @@ func (u *UserApi) LogOut(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": -1, "message": "抱歉未找到相关信息"}"
// @Router /system/user/sysUserList [get]
// @Security X-TOKEN
func (u *UserApi) GetSysUserList(rc *ctx.ReqCtx) {
func (u *UserApi) GetSysUserList(rc *ginx.ReqCtx) {
pageNum := ginx.QueryInt(rc.GinCtx, "pageNum", 1)
pageSize := ginx.QueryInt(rc.GinCtx, "pageSize", 10)
status := rc.GinCtx.Query("status")
@@ -199,7 +199,7 @@ func (u *UserApi) GetSysUserList(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/user/profile [get]
// @Security
func (u *UserApi) GetSysUserProfile(rc *ctx.ReqCtx) {
func (u *UserApi) GetSysUserProfile(rc *ginx.ReqCtx) {
sysUser := entity.SysUser{}
sysUser.UserId = rc.LoginAccount.UserId
@@ -235,7 +235,7 @@ func (u *UserApi) GetSysUserProfile(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
// @Router /system/user/profileAvatar [post]
func (u *UserApi) InsetSysUserAvatar(rc *ctx.ReqCtx) {
func (u *UserApi) InsetSysUserAvatar(rc *ginx.ReqCtx) {
form, err := rc.GinCtx.MultipartForm()
biz.ErrIsNil(err, "头像上传失败")
@@ -262,7 +262,7 @@ func (u *UserApi) InsetSysUserAvatar(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
// @Router /system/user/updatePwd [post]
func (u *UserApi) SysUserUpdatePwd(rc *ctx.ReqCtx) {
func (u *UserApi) SysUserUpdatePwd(rc *ginx.ReqCtx) {
var pws entity.SysUserPwd
ginx.BindJsonAndValid(rc.GinCtx, &pws)
@@ -278,7 +278,7 @@ func (u *UserApi) SysUserUpdatePwd(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/user/sysUser/{userId} [get]
// @Security
func (u *UserApi) GetSysUser(rc *ctx.ReqCtx) {
func (u *UserApi) GetSysUser(rc *ginx.ReqCtx) {
userId := ginx.PathParamInt(rc.GinCtx, "userId")
user := entity.SysUser{}
@@ -312,7 +312,7 @@ func (u *UserApi) GetSysUser(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/user/getInit [get]
// @Security
func (u *UserApi) GetSysUserInit(rc *ctx.ReqCtx) {
func (u *UserApi) GetSysUserInit(rc *ginx.ReqCtx) {
var role entity.SysRole
if !IsTenantAdmin(rc.LoginAccount.TenantId) {
@@ -336,7 +336,7 @@ func (u *UserApi) GetSysUserInit(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /system/user/getInit [get]
// @Security
func (u *UserApi) GetUserRolePost(rc *ctx.ReqCtx) {
func (u *UserApi) GetUserRolePost(rc *ginx.ReqCtx) {
var user entity.SysUser
user.UserId = rc.LoginAccount.UserId
@@ -367,7 +367,7 @@ func (u *UserApi) GetUserRolePost(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/user/sysUser [post]
func (u *UserApi) InsertSysUser(rc *ctx.ReqCtx) {
func (u *UserApi) InsertSysUser(rc *ginx.ReqCtx) {
var sysUser entity.SysUser
ginx.BindJsonAndValid(rc.GinCtx, &sysUser)
sysUser.CreateBy = rc.LoginAccount.UserName
@@ -383,7 +383,7 @@ func (u *UserApi) InsertSysUser(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/user/sysUser [put]
func (u *UserApi) UpdateSysUser(rc *ctx.ReqCtx) {
func (u *UserApi) UpdateSysUser(rc *ginx.ReqCtx) {
var sysUser entity.SysUser
ginx.BindJsonAndValid(rc.GinCtx, &sysUser)
sysUser.CreateBy = rc.LoginAccount.UserName
@@ -399,7 +399,7 @@ func (u *UserApi) UpdateSysUser(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
// @Router /system/user/sysUser [put]
func (u *UserApi) UpdateSysUserStu(rc *ctx.ReqCtx) {
func (u *UserApi) UpdateSysUserStu(rc *ginx.ReqCtx) {
var sysUser entity.SysUser
ginx.BindJsonAndValid(rc.GinCtx, &sysUser)
sysUser.CreateBy = rc.LoginAccount.UserName
@@ -413,7 +413,7 @@ func (u *UserApi) UpdateSysUserStu(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /system/user/sysuser/{userId} [delete]
func (u *UserApi) DeleteSysUser(rc *ctx.ReqCtx) {
func (u *UserApi) DeleteSysUser(rc *ginx.ReqCtx) {
userIds := rc.GinCtx.Param("userId")
us := utils.IdsStrToIdsIntGroup(userIds)
u.UserApp.Delete(us)
@@ -428,7 +428,7 @@ func (u *UserApi) DeleteSysUser(rc *ctx.ReqCtx) {
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
// @Router /system/dict/type/export [get]
func (u *UserApi) ExportUser(rc *ctx.ReqCtx) {
func (u *UserApi) ExportUser(rc *ginx.ReqCtx) {
filename := rc.GinCtx.Query("filename")
status := rc.GinCtx.Query("status")
userName := rc.GinCtx.Query("username")