完成角色模块的改造

This commit is contained in:
YunaiV
2020-07-08 13:07:12 +08:00
parent eee0444e81
commit e4d3254869
14 changed files with 58 additions and 182 deletions

View File

@@ -0,0 +1,38 @@
### /role/create 成功
POST {{baseUrl}}/role/create
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer {{accessToken}}
name=测试角色
### /role/update 成功
POST {{baseUrl}}/role/update
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer {{accessToken}}
id=14&name=test
### /resource/delete 成功
POST {{baseUrl}}/role/delete
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer {{accessToken}}
roleId=14
### /role/get 成功
GET {{baseUrl}}/role/get?roleId=13
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer {{accessToken}}
### /role/list 成功
GET {{baseUrl}}/role/list?roleIds=1,13
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer {{accessToken}}
### /role/page 成功
GET {{baseUrl}}/role/page?pageNo=1&pageSize=10
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer {{accessToken}}
###

View File

@@ -7,6 +7,7 @@ import cn.iocoder.mall.managementweb.controller.permission.dto.RolePageDTO;
import cn.iocoder.mall.managementweb.controller.permission.dto.RoleUpdateDTO;
import cn.iocoder.mall.managementweb.controller.permission.vo.RoleVO;
import cn.iocoder.mall.managementweb.manager.permission.RoleManager;
import cn.iocoder.mall.security.admin.core.context.AdminSecurityContextHolder;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
@@ -34,7 +35,7 @@ public class RoleController {
@PostMapping("/create")
@ApiOperation("创建角色")
public CommonResult<Integer> createRole(@Valid RoleCreateDTO createDTO) {
return success(roleManager.createRole(createDTO));
return success(roleManager.createRole(createDTO, AdminSecurityContextHolder.getAdminId()));
}
@PostMapping("/update")
@@ -65,7 +66,7 @@ public class RoleController {
return success(roleManager.listRole(roleIds));
}
@GetMapping("/list")
@GetMapping("/page")
@ApiOperation("获得角色分页")
public CommonResult<PageResult<RoleVO>> pageRole(RolePageDTO pageDTO) {
return success(roleManager.pageRole(pageDTO));

View File

@@ -1,12 +1,13 @@
package cn.iocoder.mall.managementweb.controller.permission.dto;
import cn.iocoder.common.framework.vo.PageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel("角色分页 DTO")
@Data
public class RolePageDTO {
public class RolePageDTO extends PageParam {
@ApiModelProperty(value = "角色名", example = "管理", notes = "模糊匹配")
private String name;