Commit 26779386 by guojuxing

gic版本修正:通过查询开放平台接口获取数据

parent d0e78905
......@@ -2,6 +2,7 @@ package com.gic.auth.service.outer.impl;
import java.util.*;
import com.gic.open.api.service.ServeApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
......@@ -50,6 +51,8 @@ public class MenuApiServiceImpl implements MenuApiService {
private MenuRoleService menuRoleService;
@Autowired
private AppTokenApiService appTokenApiService;
@Autowired
private ServeApiService serveApiService;
@Override
public ServiceResponse<List<MenuDTO>> listByMenuIdList(List<Integer> menuIdList) {
......@@ -632,18 +635,20 @@ public class MenuApiServiceImpl implements MenuApiService {
* 设置版本ID和版本名称字段值
* @param menuDTO 必须有project值
*/
private static void setMenuVersion(MenuDTO menuDTO) {
private void setMenuVersion(MenuDTO menuDTO) {
if (MenuProjectConstants.DEFAULT_PROJECT.equals(menuDTO.getProject())) {
menuDTO.setMenuVersion(SignConstants.UNDERLINE
+ menuDTO.getMenuVersion().replaceAll(SignConstants.COMMA, SignConstants.UNDERLINE)
+ SignConstants.UNDERLINE);
String[] menuVersionArr = menuDTO.getMenuVersion().split(SignConstants.UNDERLINE);
StringBuilder result = new StringBuilder();
Map<String, String> gicDefaultVersion = getGicDefaultVersion();
for (String str : menuVersionArr) {
if (StringUtils.isBlank(str)) {
continue;
}
result.append(GicVersionEnum.getMessageByCode(Integer.parseInt(str))).append(SignConstants.SLASH);
result.append(gicDefaultVersion.get(str)).append(SignConstants.SLASH);
}
String menuVersionStr = result.toString();
menuDTO.setMenuVersionName(menuVersionStr.substring(0, menuVersionStr.length() - 1));
......@@ -867,4 +872,25 @@ public class MenuApiServiceImpl implements MenuApiService {
}
return ServiceResponse.success(resultList);
}
/**
* 查询gic基础服务版本列表数据
* @Title: getGicDefaultVersion

* @Description:

 * @author guojuxing 

* @return java.util.Map<java.lang.String,java.lang.String>


 */
private Map<String, String> getGicDefaultVersion() {
Map<String, String> map = new HashMap<>(16);
ServiceResponse<List<ServePropDTO>> versionListResult = serveApiService.listServePropByGICDefaultAPP();
if (versionListResult.isSuccess()) {
List<ServePropDTO> versionList = versionListResult.getResult();
if (CollectionUtils.isNotEmpty(versionList)) {
for (ServePropDTO servePropDTO : versionList) {
map.put(servePropDTO.getCode(), servePropDTO.getName());
}
}
}
return map;
}
}
......@@ -32,6 +32,7 @@
<dubbo:reference interface="com.gic.open.api.service.ApplicationApiService" id="applicationApiService" timeout="6000" />
<!--应用市场应用列表-->
<dubbo:reference interface="com.gic.open.api.service.AppTokenApiService" id="appTokenApiService" timeout="6000" />
<dubbo:reference interface="com.gic.open.api.service.ServeApiService" id="serveApiService" timeout="60000" />
<!--审核员-->
<dubbo:service interface="com.gic.auth.service.AuditorApiService" ref="auditorApiService" timeout="6000" />
<dubbo:reference interface="com.gic.enterprise.service.ProjectItemApiService" id="projectItemApiService" timeout="6000" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment