forked from fanruan/finekit
zed
5 years ago
4 changed files with 113 additions and 5 deletions
@ -0,0 +1,35 @@
|
||||
package com.fanruan.api.decision.role; |
||||
|
||||
import com.fr.decision.authority.data.CustomRole; |
||||
import com.fr.decision.webservice.utils.ControllerFactory; |
||||
|
||||
import javax.validation.constraints.NotNull; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author Zed |
||||
* @version 10.0 |
||||
* Created by Zed on 2020/4/30 |
||||
*/ |
||||
public class CustomRoleKit { |
||||
|
||||
/** |
||||
* 获取角色id |
||||
* |
||||
* @param userId 用户id |
||||
* @param keyword 搜索关键字 |
||||
* @return 角色id |
||||
* @throws Exception 异常 |
||||
*/ |
||||
public static List<String> getCustomRoleIds(@NotNull String userId, String keyword) throws Exception { |
||||
|
||||
List<String> result = new ArrayList<>(); |
||||
CustomRole[] roles = ControllerFactory.getInstance().getCustomRoleController(userId).getAllCustomRoles(userId, keyword); |
||||
for (CustomRole role : roles) { |
||||
result.add(role.getId()); |
||||
} |
||||
|
||||
return result; |
||||
} |
||||
} |
Loading…
Reference in new issue