【更新】更新

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

@@ -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")