mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-17 04:25:06 +08:00
inf_config Service 的单元测试
This commit is contained in:
@ -17,7 +17,7 @@ public class InfConfigBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "参数分组", required = true, example = "biz")
|
||||
@NotEmpty(message = "参数分组不能为空")
|
||||
@Size(max = 100, message = "参数名称不能超过50个字符")
|
||||
@Size(max = 50, message = "参数名称不能超过50个字符")
|
||||
private String group;
|
||||
|
||||
@ApiModelProperty(value = "参数名称", required = true, example = "数据库名")
|
||||
|
@ -30,11 +30,11 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.dashboard.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.dashboard.modules.system.enums.SysErrorCodeConstants.*;
|
||||
import static java.util.Collections.singleton;
|
||||
|
||||
/**
|
||||
* Auth Service 实现类
|
||||
@ -155,7 +155,7 @@ public class SysAuthServiceImpl implements SysAuthService {
|
||||
* @return 角色编号数组
|
||||
*/
|
||||
private Set<Long> getUserRoleIds(Long userId) {
|
||||
return permissionService.listUserRoleIds(userId, Collections.singleton(CommonStatusEnum.ENABLE.getStatus()));
|
||||
return permissionService.getUserRoleIds(userId, singleton(CommonStatusEnum.ENABLE.getStatus()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,7 +42,7 @@ public interface SysPermissionService extends SecurityPermissionFrameworkService
|
||||
* @param roleStatuses 角色状态集合. 允许为空,为空时不过滤
|
||||
* @return 角色编号集合
|
||||
*/
|
||||
Set<Long> listUserRoleIds(Long userId, @Nullable Collection<Integer> roleStatuses);
|
||||
Set<Long> getUserRoleIds(Long userId, @Nullable Collection<Integer> roleStatuses);
|
||||
|
||||
/**
|
||||
* 获得角色拥有的菜单编号集合
|
||||
|
@ -151,7 +151,7 @@ public class SysPermissionServiceImpl implements SysPermissionService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Long> listUserRoleIds(Long userId, Collection<Integer> roleStatuses) {
|
||||
public Set<Long> getUserRoleIds(Long userId, Collection<Integer> roleStatuses) {
|
||||
List<SysUserRoleDO> userRoleList = userRoleMapper.selectListByUserId(userId);
|
||||
// 过滤角色状态
|
||||
if (CollectionUtil.isNotEmpty(roleStatuses)) {
|
||||
|
Reference in New Issue
Block a user