forked from fanruan/finekit
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
924 B
36 lines
924 B
5 years ago
|
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;
|
||
|
}
|
||
|
}
|