mirror of https://gitee.com/stylefeng/roses
parent
624ba3c15c
commit
ade9d3a43e
|
@ -83,4 +83,13 @@ public interface AppServiceApi {
|
|||
*/
|
||||
List<SysAppResult> getSortedApps();
|
||||
|
||||
/**
|
||||
* 按顺序获取app的编码和名称
|
||||
*
|
||||
* @param devopsFlag 是否包含运维平台的应用
|
||||
* @author fengshuonan
|
||||
* @date 2022/4/6 22:34
|
||||
*/
|
||||
List<SysAppResult> getSortedApps(Boolean devopsFlag);
|
||||
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ public interface MenuServiceApi {
|
|||
* @author fengshuonan
|
||||
* @date 2022/4/8 15:59
|
||||
*/
|
||||
List<IndexMenuInfo> buildAuthorities(Integer menuFrontType);
|
||||
List<IndexMenuInfo> buildAuthorities(Integer menuFrontType, Boolean devopsFlag);
|
||||
|
||||
/**
|
||||
* 获取角色绑定菜单和按钮权限的树
|
||||
|
|
|
@ -86,6 +86,22 @@ public class SysApp extends BaseEntity {
|
|||
@ChineseDescription("状态:1-启用,2-禁用")
|
||||
private Integer statusFlag;
|
||||
|
||||
/**
|
||||
* 排序-升序
|
||||
*/
|
||||
@TableField("app_sort")
|
||||
@ChineseDescription("排序-升序")
|
||||
private Integer appSort;
|
||||
|
||||
/**
|
||||
* 是否是devops应用:Y-是,N-否
|
||||
* <p>
|
||||
* devops应用为了在本地集成devops时,做筛选用
|
||||
*/
|
||||
@TableField(value = "devops_flag")
|
||||
@ChineseDescription("是否是devops应用:Y-是,N-否")
|
||||
private String devopsFlag;
|
||||
|
||||
/**
|
||||
* 是否删除:Y-已删除,N-未删除
|
||||
*/
|
||||
|
@ -93,10 +109,4 @@ public class SysApp extends BaseEntity {
|
|||
@ChineseDescription("是否删除:Y-已删除,N-未删除")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 排序-升序
|
||||
*/
|
||||
@TableField("app_sort")
|
||||
@ChineseDescription("排序-升序")
|
||||
private Integer appSort;
|
||||
}
|
||||
|
|
|
@ -265,6 +265,11 @@ public class SysAppServiceImpl extends ServiceImpl<SysAppMapper, SysApp> impleme
|
|||
|
||||
@Override
|
||||
public List<SysAppResult> getSortedApps() {
|
||||
return this.getSortedApps(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysAppResult> getSortedApps(Boolean devopsFlag) {
|
||||
LambdaQueryWrapper<SysApp> wrapper = this.createWrapper(new SysAppRequest());
|
||||
|
||||
// 只查询应用名称和应用编码
|
||||
|
@ -273,6 +278,11 @@ public class SysAppServiceImpl extends ServiceImpl<SysAppMapper, SysApp> impleme
|
|||
// 只查询启用的应用
|
||||
wrapper.eq(SysApp::getStatusFlag, StatusEnum.ENABLE.getCode());
|
||||
|
||||
// 是否查询运维平台的菜单
|
||||
if (devopsFlag != null && devopsFlag) {
|
||||
wrapper.eq(SysApp::getDevopsFlag, YesOrNotEnum.Y.getCode());
|
||||
}
|
||||
|
||||
List<SysApp> list = this.list(wrapper);
|
||||
|
||||
return list.stream().map(i -> {
|
||||
|
|
|
@ -658,10 +658,10 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<IndexMenuInfo> buildAuthorities(Integer menuFrontType) {
|
||||
public List<IndexMenuInfo> buildAuthorities(Integer menuFrontType, Boolean devopsFlag) {
|
||||
|
||||
// 不分离应用查询菜单
|
||||
List<SysAppResult> sortedApps = appServiceApi.getSortedApps();
|
||||
List<SysAppResult> sortedApps = appServiceApi.getSortedApps(devopsFlag);
|
||||
List<String> appCodes = sortedApps.stream().map(SysAppResult::getAppCode).collect(Collectors.toList());
|
||||
List<SysMenu> currentUserMenus = this.getCurrentUserMenus(appCodes, false, menuFrontType);
|
||||
|
||||
|
|
|
@ -198,8 +198,9 @@ public class LoginController {
|
|||
* @date 2022/4/8 15:31
|
||||
*/
|
||||
@GetResource(name = "新版Antdv3版本的用户信息获取", path = "/v3/userInfo", requiredPermission = false)
|
||||
public ResponseData<IndexUserInfoV3> userInfoV3(Integer menuFrontType) {
|
||||
return new SuccessResponseData<>(indexUserInfoService.userInfoV3(menuFrontType));
|
||||
public ResponseData<IndexUserInfoV3> userInfoV3(@RequestParam(value = "menuFrontType", required = false) Integer menuFrontType,
|
||||
@RequestParam(value = "devopsFlag", required = false) Boolean devopsFlag) {
|
||||
return new SuccessResponseData<>(indexUserInfoService.userInfoV3(menuFrontType, devopsFlag));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,9 +38,11 @@ public interface IndexUserInfoService {
|
|||
* 获取用户信息(新版Antdv3版本)
|
||||
*
|
||||
* @param menuFrontType 菜单类型:前台菜单还是后台菜单
|
||||
* @param devopsFlag 是否查询包含devops平台的菜单(可为空)
|
||||
* @return 用户信息和菜单信息
|
||||
* @author fengshuonan
|
||||
* @date 2022/4/8 15:31
|
||||
*/
|
||||
IndexUserInfoV3 userInfoV3(Integer menuFrontType);
|
||||
IndexUserInfoV3 userInfoV3(Integer menuFrontType, Boolean devopsFlag);
|
||||
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class IndexUserInfoServiceImpl implements IndexUserInfoService {
|
|||
private MenuServiceApi menuServiceApi;
|
||||
|
||||
@Override
|
||||
public IndexUserInfoV3 userInfoV3(Integer menuFrontType) {
|
||||
public IndexUserInfoV3 userInfoV3(Integer menuFrontType, Boolean devopsFlag) {
|
||||
|
||||
// 获取当前登录用户
|
||||
LoginUser loginUser = LoginContext.me().getLoginUser();
|
||||
|
@ -113,7 +113,7 @@ public class IndexUserInfoServiceImpl implements IndexUserInfoService {
|
|||
if (ObjectUtil.isEmpty(menuFrontType)) {
|
||||
menuFrontType = AntdvFrontTypeEnum.FRONT.getCode();
|
||||
}
|
||||
indexUserInfoV3.setAuthorities(menuServiceApi.buildAuthorities(menuFrontType));
|
||||
indexUserInfoV3.setAuthorities(menuServiceApi.buildAuthorities(menuFrontType, devopsFlag));
|
||||
|
||||
// 登录人的ws-url
|
||||
indexUserInfoV3.setWsUrl(loginUser.getWsUrl());
|
||||
|
|
Loading…
Reference in New Issue