forked from rongchao/epmet-cloud-rizhao
23 changed files with 368 additions and 44 deletions
@ -0,0 +1,26 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 权限配置-操作默认范围form dto |
|||
*/ |
|||
@Data |
|||
public class AccessConfigOpeDefaultScopesFormDTO { |
|||
|
|||
public interface ListOpeDefaultScopesGroup {} |
|||
public interface SaveOpeDefaultScopesGroup {} |
|||
|
|||
@NotBlank(message = "角色Key不能为空", groups = { ListOpeDefaultScopesGroup.class, SaveOpeDefaultScopesGroup.class }) |
|||
private String roleKey; |
|||
|
|||
@NotBlank(message = "操作Key不能为空", groups = { ListOpeDefaultScopesGroup.class, SaveOpeDefaultScopesGroup.class }) |
|||
private String operationKey; |
|||
|
|||
private List<String> scopeKeys; |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 角色默认操作权限列表from DTO |
|||
*/ |
|||
@Data |
|||
public class AccessConfigRoleDefaultOpesFormDTO { |
|||
|
|||
@NotBlank(message = "角色Key不能为空") |
|||
private String roleKey; |
|||
|
|||
private List<String> operationKeys; |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 权限配置-操作的默认范围result dto |
|||
*/ |
|||
@Data |
|||
public class AccessConfigOpeDefaultScopesResultDTO { |
|||
private String scopeKey; |
|||
private String scopeName; |
|||
private String scopeIndex; |
|||
private String operationKey; |
|||
private String roleKey; |
|||
private Boolean assigned; |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.RoleDTO; |
|||
import com.epmet.dto.result.GovStaffRoleResultDTO; |
|||
import com.epmet.dto.result.GovStaffRoleTemplateDTO; |
|||
import com.epmet.service.GovStaffRoleService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
@RequestMapping("govstaffrole") |
|||
@RestController |
|||
public class GovStaffRoleController { |
|||
|
|||
@Autowired |
|||
private GovStaffRoleService govStaffRoleService; |
|||
|
|||
/** |
|||
* 根据客户ID查询该客户的角色列表 |
|||
* @param customerId |
|||
* @return |
|||
*/ |
|||
@PostMapping("rolesbycustomer/{customerId}") |
|||
public Result listGovStaffRolesByCustomer(@PathVariable("customerId") String customerId) { |
|||
List<GovStaffRoleResultDTO> roleEntities = govStaffRoleService.listRolesByCustomer(customerId); |
|||
return new Result().ok(roleEntities); |
|||
} |
|||
|
|||
/** |
|||
* 查询角色模板列表 |
|||
* @return |
|||
*/ |
|||
@PostMapping("roletemplates") |
|||
public Result listGovStaffRoleTemplates() { |
|||
List<GovStaffRoleTemplateDTO> roleTemplates = govStaffRoleService.listRoleTemplates(); |
|||
return new Result().ok(roleTemplates); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue