...
|
...
|
@@ -16,7 +16,10 @@ import org.springframework.web.bind.annotation.RequestMapping; |
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -50,6 +53,33 @@ public class HostGroupCtrl { |
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@RequestMapping("/getAllTagsGroupByType")
|
|
|
@ResponseBody
|
|
|
public BaseResponse getAllTagsGroupByType() {
|
|
|
try{
|
|
|
List<HostGroup> list=hostGroupService.getAllGroups("");
|
|
|
|
|
|
Map<String,List<HostGroup>> map= new HashMap<String,List<HostGroup>>();
|
|
|
if(list!=null&&list.size()>0){
|
|
|
for(HostGroup tag:list){
|
|
|
if(map.keySet().contains(tag.getTagType())){
|
|
|
map.get(tag.getTagType()).add(tag);
|
|
|
}else{
|
|
|
List<HostGroup> ls=new ArrayList<HostGroup>();
|
|
|
ls.add(tag);
|
|
|
map.put(tag.getTagType(),ls);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return new BaseResponse<Map<String,List<HostGroup>>>(map);
|
|
|
}catch (Exception e){
|
|
|
log.error("getAllTagsGroupByType error",e);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/getHostGroups")
|
|
|
@ResponseBody
|
|
|
public BaseResponse<PageResponse<HostGroup>> getHostGroups(@RequestBody TagReq request) {
|
...
|
...
|
|