Authored by qinchao

重绘关键切换拓扑图

... ... @@ -25,6 +25,8 @@ public interface HostInfoMapper {
List<HostInfo> selectHostInfosByTag(@Param("tag") String tag);
List<HostInfo> selectHostInfosByTagList(@Param("tagsList") List<String> tagList);
List<HostInfo> selectHostInfosByTagAndCloudType(@Param("tag") String tag,@Param("cloudType") int cloudType);
HostInfo selectByHostIp(@Param("hostIp") String hostIp);
... ...
... ... @@ -189,6 +189,16 @@
where instr(tags, LOWER(#{tag})) &gt; 0
</select>
<select id="selectHostInfosByTagList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from host_info
where 1=1 and
<foreach item="item" index="index" collection="tagsList" separator="and">
instr(tags, #{item}) &gt; 0
</foreach>
</select>
<select id="selectHostInfosByTagAndCloudType" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
... ...
... ... @@ -39,7 +39,6 @@ public class NginxSwitchCtrl {
HostInfoMapper hostInfoMapper;
/**
* 废弃
* 查看nginx配置
*
* @return 2016年5月12日下午1:49:48
... ... @@ -49,6 +48,14 @@ public class NginxSwitchCtrl {
public BaseResponse viewNginxConf() {
try{
Map<String, List<Map<String, Object>>> map = new HashMap<>();
List<HostInfo> grayServerHosts=hostInfoMapper.selectHostInfosByTagList(Arrays.asList(new String[]{"灰度","gateway"}));
//获取灰度机器的server。ip
List<Map<String, Object>> grayHosts=new ArrayList<>();
Map<String, Object> tmpmap=new HashMap<String, Object>();
tmpmap.put("grayServerHosts", grayServerHosts);
grayHosts.add(tmpmap);
map.put("grayServerHosts", grayHosts);
if ("test".equals(env)) {
List<Map<String, Object>> awsList = localTest("aws");
List<Map<String, Object>> qcloudList = localTest("qq");
... ...