Authored by qinchao

修复

... ... @@ -177,6 +177,17 @@ public class HostInfoServiceImpl implements IHostInfoService {
@Override
public BaseResponse<Integer> saveHostInfo(HostInfo req) {
int result=0;
//保证tags以逗号结尾
String newTags=req.getTags();
if(newTags!=null){
newTags = newTags.trim();
if(newTags.length()>0&&!newTags.endsWith(",")){
newTags += ",";
}
req.setTags(newTags);
}
if(req.getId()>0){
result=hostInfoMapper.updateByPrimaryKey(req);
}else{
... ...
... ... @@ -326,7 +326,7 @@ public class Pch5SwitchCtrl {
List<HostInfo> ls=hostInfoService.getHostInfosByTagList(Arrays.asList(const_tags_for_nginx_node_az2.split(",")));
if(ls!=null){
for(HostInfo hostInfo:ls){
if(!newTags.endsWith(",")){
if(newTags!=null&&newTags.length()>0&&!newTags.endsWith(",")){
newTags += ",";
}
hostInfo.setTags(newTags);
... ...