bug fix: return param

This commit is contained in:
myh 2023-12-03 23:45:35 +08:00
parent e168925d5c
commit a17444abdb

View File

@ -1,9 +1,10 @@
package com.example.springdemo.service;
package com.example.springdemo.serviceImpl;
import com.example.springdemo.dao.RolesPermissionsRepository;
import com.example.springdemo.dao.RolesRepository;
import com.example.springdemo.entities.RBAC.Roles;
import com.example.springdemo.entities.Users;
import com.example.springdemo.service.RolesService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -49,7 +50,7 @@ public class RolesServiceImpl implements RolesService {
//检查角色与权限的关联关系是否存在
private boolean checkRolesPermissionsIfExist(Long roleId) {
return rolesPermissionsRepository.findByRolesId(roleId).isPresent();
return !rolesPermissionsRepository.findByRolesId(roleId).isEmpty();
}
@Override
@ -78,7 +79,7 @@ public class RolesServiceImpl implements RolesService {
}
@Override
public Users getUserRoleById(Long userId) {
return null;
public List<Optional<Roles>> getUserRoleById(Long userId) {
return List.of();
}
}