Compare commits
No commits in common. "4bf52c4404a5cd82262e46f02a52d2054b420fa1" and "07e9ae9d23f875d082f59b7d7aa7468897ad441a" have entirely different histories.
4bf52c4404
...
07e9ae9d23
|
|
@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.models.Role;
|
import com.electromagnetic.industry.software.manage.pojo.models.Role;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.req.RoleDTO;
|
import com.electromagnetic.industry.software.manage.pojo.req.RoleDTO;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.req.RolePageDTO;
|
import com.electromagnetic.industry.software.manage.pojo.req.RolePageDTO;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface RoleService extends IService<Role> {
|
public interface RoleService extends IService<Role> {
|
||||||
|
|
@ -48,10 +48,9 @@ public interface RoleService extends IService<Role> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有角色名
|
* 获取所有角色名
|
||||||
*
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<HashMap<String, String>> getAllRoleNames();
|
List<String> getAllRoleNames();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过角色名称查看角色权限
|
* 通过角色名称查看角色权限
|
||||||
|
|
|
||||||
|
|
@ -218,25 +218,15 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有角色名
|
* 获取所有角色名
|
||||||
*
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public List<HashMap<String, String>> getAllRoleNames() {
|
public List<String> getAllRoleNames() {
|
||||||
LambdaQueryWrapper<Role> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Role> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.select(Role::getRoleName)
|
queryWrapper.select(Role::getRoleName)
|
||||||
.eq(Role::getEffectFlag, EffectFlagEnum.EFFECT.code);
|
.eq(Role::getEffectFlag, EffectFlagEnum.EFFECT.code);
|
||||||
|
return this.listObjs(queryWrapper).stream().map(Object::toString).collect(Collectors.toList());
|
||||||
List<String> roleNames = this.listObjs(queryWrapper).stream().map(Object::toString).collect(Collectors.toList());
|
|
||||||
List<HashMap<String,String>> result = new ArrayList<>();
|
|
||||||
for (String roleName : roleNames) {
|
|
||||||
HashMap<String, String> map = new HashMap<>();
|
|
||||||
map.put("value", roleName);
|
|
||||||
map.put("label", roleName);
|
|
||||||
result.add(map);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue