Authored by jack.xue

add queue query

@@ -12,4 +12,6 @@ public class QueryRequest extends PageRequest { @@ -12,4 +12,6 @@ public class QueryRequest extends PageRequest {
12 String moId; 12 String moId;
13 13
14 String moType; 14 String moType;
  15 +
  16 + String queueKey;
15 } 17 }
@@ -97,15 +97,29 @@ public class RabbitmqService { @@ -97,15 +97,29 @@ public class RabbitmqService {
97 @RequestMapping(value = "/queue", method = RequestMethod.POST) 97 @RequestMapping(value = "/queue", method = RequestMethod.POST)
98 public BaseResponse queryQueue(@RequestBody QueryRequest request) { 98 public BaseResponse queryQueue(@RequestBody QueryRequest request) {
99 99
100 - DEBUG.info("Query the queues of mo {}",request.getMoId()); 100 + DEBUG.info("Query the queues of mo {}", request.getMoId());
101 101
102 BaseResponse<PageResponse<QueueInfo>> baseResponse = new BaseResponse(); 102 BaseResponse<PageResponse<QueueInfo>> baseResponse = new BaseResponse();
103 103
104 QueueView oneView = InterVar.queueViewMaps.get(Integer.parseInt(request.getMoId())); 104 QueueView oneView = InterVar.queueViewMaps.get(Integer.parseInt(request.getMoId()));
105 105
106 if (null != oneView) { 106 if (null != oneView) {
  107 + List<QueueInfo> queuesList = new ArrayList<>();
107 108
108 - List<QueueInfo> queuesList = oneView.getQueueView(); 109 + if (StringUtils.isBlank(request.getQueueKey())) {
  110 +
  111 + queuesList = oneView.getQueueView();
  112 +
  113 + } else {
  114 +
  115 + for (QueueInfo queueInfo : oneView.getQueueView()) {
  116 +
  117 + if (queueInfo.getName().toLowerCase().contains(request.getQueueKey().toLowerCase())) {
  118 +
  119 + queuesList.add(queueInfo);
  120 + }
  121 + }
  122 + }
109 123
110 List<QueueInfo> selectedList = new ArrayList<>(); 124 List<QueueInfo> selectedList = new ArrayList<>();
111 125