mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 03:58:33 +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.UserRole;
|
||||||
import io.metersphere.system.domain.UserRoleRelation;
|
import io.metersphere.system.domain.UserRoleRelation;
|
||||||
import io.metersphere.system.domain.UserRoleRelationExample;
|
import io.metersphere.system.domain.UserRoleRelationExample;
|
||||||
|
import io.metersphere.system.mapper.UserRoleMapper;
|
||||||
import io.metersphere.system.mapper.UserRoleRelationMapper;
|
import io.metersphere.system.mapper.UserRoleRelationMapper;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -35,8 +35,7 @@ public class BaseUserRoleRelationService {
|
|||||||
@Resource
|
@Resource
|
||||||
protected BaseUserRoleRelationMapper baseUserRoleRelationMapper;
|
protected BaseUserRoleRelationMapper baseUserRoleRelationMapper;
|
||||||
@Resource
|
@Resource
|
||||||
@Lazy
|
protected UserRoleMapper userRoleMapper;
|
||||||
protected BaseUserRoleService baseUserRoleService;
|
|
||||||
@Resource
|
@Resource
|
||||||
private BaseUserService baseUserService;
|
private BaseUserService baseUserService;
|
||||||
|
|
||||||
@ -65,7 +64,7 @@ public class BaseUserRoleRelationService {
|
|||||||
|
|
||||||
public UserRole getUserRole(String id) {
|
public UserRole getUserRole(String id) {
|
||||||
UserRoleRelation userRoleRelation = userRoleRelationMapper.selectByPrimaryKey(id);
|
UserRoleRelation userRoleRelation = userRoleRelationMapper.selectByPrimaryKey(id);
|
||||||
return baseUserRoleService.get(userRoleRelation.getRoleId());
|
return userRoleMapper.selectByPrimaryKey(userRoleRelation.getRoleId());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void delete(String id) {
|
protected void delete(String id) {
|
||||||
@ -101,7 +100,7 @@ public class BaseUserRoleRelationService {
|
|||||||
public String getLogDetails(String id) {
|
public String getLogDetails(String id) {
|
||||||
UserRoleRelation userRoleRelation = userRoleRelationMapper.selectByPrimaryKey(id);
|
UserRoleRelation userRoleRelation = userRoleRelationMapper.selectByPrimaryKey(id);
|
||||||
if (userRoleRelation != null) {
|
if (userRoleRelation != null) {
|
||||||
UserRole userRole = baseUserRoleService.get(userRoleRelation.getRoleId());
|
UserRole userRole = userRoleMapper.selectByPrimaryKey(userRoleRelation.getRoleId());
|
||||||
return userRole == null ? null : userRole.getName();
|
return userRole == null ? null : userRole.getName();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user