infra:勉强启动成功,需要继续优化
This commit is contained in:
@@ -1,23 +1,28 @@
|
||||
package cn.iocoder.yudao.module.system.api.permission;
|
||||
|
||||
import cn.iocoder.yudao.module.system.api.permission.dto.DeptDataPermissionRespDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 权限 API 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Api(tags = "RPC 服务 - 权限")
|
||||
public interface PermissionApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/permission";
|
||||
|
||||
/**
|
||||
* 获得拥有多个角色的用户编号集合
|
||||
*
|
||||
* @param roleIds 角色编号集合
|
||||
* @return 用户编号集合
|
||||
*/
|
||||
@GetMapping(PREFIX + "/user-role-id-list-by-role-id")
|
||||
Set<Long> getUserRoleIdListByRoleIds(Collection<Long> roleIds);
|
||||
|
||||
/**
|
||||
@@ -27,7 +32,9 @@ public interface PermissionApi {
|
||||
* @param permissions 权限
|
||||
* @return 是否
|
||||
*/
|
||||
boolean hasAnyPermissions(Long userId, String... permissions);
|
||||
@GetMapping(PREFIX + "/has-any-permissions")
|
||||
boolean hasAnyPermissions(@RequestParam("userId") Long userId,
|
||||
@RequestParam("permissions") String... permissions);
|
||||
|
||||
/**
|
||||
* 判断是否有角色,任一一个即可
|
||||
@@ -36,7 +43,9 @@ public interface PermissionApi {
|
||||
* @param roles 角色数组
|
||||
* @return 是否
|
||||
*/
|
||||
boolean hasAnyRoles(Long userId, String... roles);
|
||||
@GetMapping(PREFIX + "/has-any-roles")
|
||||
boolean hasAnyRoles(@RequestParam("userId") Long userId,
|
||||
@RequestParam("roles") String... roles);
|
||||
|
||||
/**
|
||||
* 获得登陆用户的部门数据权限
|
||||
@@ -44,6 +53,7 @@ public interface PermissionApi {
|
||||
* @param userId 用户编号
|
||||
* @return 部门数据权限
|
||||
*/
|
||||
@GetMapping(PREFIX + "/get-dept-data-permission")
|
||||
DeptDataPermissionRespDTO getDeptDataPermission(Long userId);
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public interface AdminUserApi {
|
||||
* @param id 用户ID
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
@GetMapping("/get")
|
||||
@GetMapping(PREFIX + "/get")
|
||||
AdminUserRespDTO getUser(Long id);
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ public interface AdminUserApi {
|
||||
* @param ids 用户 ID 们
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@GetMapping(PREFIX + "/list")
|
||||
List<AdminUserRespDTO> getUsers(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
@@ -42,7 +42,7 @@ public interface AdminUserApi {
|
||||
* @param deptIds 部门数组
|
||||
* @return 用户数组
|
||||
*/
|
||||
@GetMapping("/list-by-dept-id")
|
||||
@GetMapping(PREFIX + "/list-by-dept-id")
|
||||
List<AdminUserRespDTO> getUsersByDeptIds(Collection<Long> deptIds);
|
||||
|
||||
/**
|
||||
@@ -51,7 +51,7 @@ public interface AdminUserApi {
|
||||
* @param postIds 岗位数组
|
||||
* @return 用户数组
|
||||
*/
|
||||
@GetMapping("/list-by-post-id")
|
||||
@GetMapping(PREFIX + "/list-by-post-id")
|
||||
List<AdminUserRespDTO> getUsersByPostIds(Collection<Long> postIds);
|
||||
|
||||
/**
|
||||
@@ -72,7 +72,7 @@ public interface AdminUserApi {
|
||||
*
|
||||
* @param ids 用户编号数组
|
||||
*/
|
||||
@GetMapping("/valid")
|
||||
@GetMapping(PREFIX + "/valid")
|
||||
void validUsers(Set<Long> ids);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user