mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-01 19:49:10 +08:00
refactor(系统设置): 优化BaseUserRoleRelationService依赖关系
This commit is contained in:
parent
5b5fa2ab30
commit
e3141a7a95
@ -6,11 +6,11 @@ import io.metersphere.sdk.mapper.BaseUserRoleRelationMapper;
|
||||
import io.metersphere.system.domain.UserRole;
|
||||
import io.metersphere.system.domain.UserRoleRelation;
|
||||
import io.metersphere.system.domain.UserRoleRelationExample;
|
||||
import io.metersphere.system.mapper.UserRoleMapper;
|
||||
import io.metersphere.system.mapper.UserRoleRelationMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -35,8 +35,7 @@ public class BaseUserRoleRelationService {
|
||||
@Resource
|
||||
protected BaseUserRoleRelationMapper baseUserRoleRelationMapper;
|
||||
@Resource
|
||||
@Lazy
|
||||
protected BaseUserRoleService baseUserRoleService;
|
||||
protected UserRoleMapper userRoleMapper;
|
||||
@Resource
|
||||
private BaseUserService baseUserService;
|
||||
|
||||
@ -65,7 +64,7 @@ public class BaseUserRoleRelationService {
|
||||
|
||||
public UserRole getUserRole(String id) {
|
||||
UserRoleRelation userRoleRelation = userRoleRelationMapper.selectByPrimaryKey(id);
|
||||
return baseUserRoleService.get(userRoleRelation.getRoleId());
|
||||
return userRoleMapper.selectByPrimaryKey(userRoleRelation.getRoleId());
|
||||
}
|
||||
|
||||
protected void delete(String id) {
|
||||
@ -101,7 +100,7 @@ public class BaseUserRoleRelationService {
|
||||
public String getLogDetails(String id) {
|
||||
UserRoleRelation userRoleRelation = userRoleRelationMapper.selectByPrimaryKey(id);
|
||||
if (userRoleRelation != null) {
|
||||
UserRole userRole = baseUserRoleService.get(userRoleRelation.getRoleId());
|
||||
UserRole userRole = userRoleMapper.selectByPrimaryKey(userRoleRelation.getRoleId());
|
||||
return userRole == null ? null : userRole.getName();
|
||||
}
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user