From 66c2b2c8cdc50bdf4f0dab22f2bf16ecd8aa282e Mon Sep 17 00:00:00 2001 From: solley Date: Thu, 20 Jan 2022 09:10:48 +0800 Subject: [PATCH] =?UTF-8?q?add(API):=20=E6=B7=BB=E5=8A=A0=E6=8F=90?= =?UTF-8?q?=E5=87=BA=E5=AE=A2=E6=88=B7=E7=AB=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/compiler.xml | 4 ++-- .../monkey/mmq/web/controller/ApiController.java | 13 ++++++++++++- ...5292e21_2a71_46d6_b121_0882c2a1c42a_00000000.tmp | 1 + ...5292e21_2a71_46d6_b121_0882c2a1c42a_00000001.tmp | 1 + ...5d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000001.tmp | 1 + ...5d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000002.tmp | 1 + ...5d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000003.tmp | 1 + ...8bb9a31_589f_4f58_9d02_9dea13a6b634_00000004.tmp | 1 + ...8bb9a31_589f_4f58_9d02_9dea13a6b634_00000005.tmp | 1 + ...9c060d3_6ed9_4ca3_ba74_5c2ce4c25a0f_00000000.tmp | 1 + 10 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 work/Tomcat/localhost/ROOT/upload_05292e21_2a71_46d6_b121_0882c2a1c42a_00000000.tmp create mode 100644 work/Tomcat/localhost/ROOT/upload_05292e21_2a71_46d6_b121_0882c2a1c42a_00000001.tmp create mode 100644 work/Tomcat/localhost/ROOT/upload_15d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000001.tmp create mode 100644 work/Tomcat/localhost/ROOT/upload_15d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000002.tmp create mode 100644 work/Tomcat/localhost/ROOT/upload_15d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000003.tmp create mode 100644 work/Tomcat/localhost/ROOT/upload_98bb9a31_589f_4f58_9d02_9dea13a6b634_00000004.tmp create mode 100644 work/Tomcat/localhost/ROOT/upload_98bb9a31_589f_4f58_9d02_9dea13a6b634_00000005.tmp create mode 100644 work/Tomcat/localhost/ROOT/upload_99c060d3_6ed9_4ca3_ba74_5c2ce4c25a0f_00000000.tmp diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 093f78f..c5fc5f6 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -6,13 +6,13 @@ - + - + diff --git a/mmq-web/src/main/java/org/monkey/mmq/web/controller/ApiController.java b/mmq-web/src/main/java/org/monkey/mmq/web/controller/ApiController.java index cb48598..ea41460 100644 --- a/mmq-web/src/main/java/org/monkey/mmq/web/controller/ApiController.java +++ b/mmq-web/src/main/java/org/monkey/mmq/web/controller/ApiController.java @@ -2,6 +2,7 @@ import io.netty.util.internal.StringUtil; import org.monkey.mmq.core.consistency.model.ResponsePage; +import org.monkey.mmq.core.consistency.model.RestResultUtils; import org.monkey.mmq.metadata.message.ClientMateData; import org.monkey.mmq.metadata.subscribe.SubscribeMateData; import org.monkey.mmq.service.SessionStoreService; @@ -67,8 +68,18 @@ public Object getClients(@RequestParam int pageNo, @RequestParam int pageSize, datas.size(), datas.size() / pageSize, datas.stream().filter(x -> x.getClientId().contains(clientId) - && x.getAddress().contains(address) && x.getUser().equals(user)) + && x.getAddress().contains(address) && x.getUser().contains(user)) .skip((pageNo - 1) * pageSize).limit(pageSize).collect(Collectors.toList())); } + /** + * reject connect client. + */ + @BasicApi + @GetMapping("/rejectClient") + public Object rejectClient(@RequestParam String clientId, HttpServletRequest request) { + sessionStoreService.rejectClient(clientId); + return RestResultUtils.success(); + } + } diff --git a/work/Tomcat/localhost/ROOT/upload_05292e21_2a71_46d6_b121_0882c2a1c42a_00000000.tmp b/work/Tomcat/localhost/ROOT/upload_05292e21_2a71_46d6_b121_0882c2a1c42a_00000000.tmp new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/work/Tomcat/localhost/ROOT/upload_05292e21_2a71_46d6_b121_0882c2a1c42a_00000000.tmp @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/work/Tomcat/localhost/ROOT/upload_05292e21_2a71_46d6_b121_0882c2a1c42a_00000001.tmp b/work/Tomcat/localhost/ROOT/upload_05292e21_2a71_46d6_b121_0882c2a1c42a_00000001.tmp new file mode 100644 index 0000000..9a03714 --- /dev/null +++ b/work/Tomcat/localhost/ROOT/upload_05292e21_2a71_46d6_b121_0882c2a1c42a_00000001.tmp @@ -0,0 +1 @@ +10 \ No newline at end of file diff --git a/work/Tomcat/localhost/ROOT/upload_15d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000001.tmp b/work/Tomcat/localhost/ROOT/upload_15d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000001.tmp new file mode 100644 index 0000000..3e7e38c --- /dev/null +++ b/work/Tomcat/localhost/ROOT/upload_15d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000001.tmp @@ -0,0 +1 @@ +paho1640921025845000001 \ No newline at end of file diff --git a/work/Tomcat/localhost/ROOT/upload_15d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000002.tmp b/work/Tomcat/localhost/ROOT/upload_15d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000002.tmp new file mode 100644 index 0000000..3e7e38c --- /dev/null +++ b/work/Tomcat/localhost/ROOT/upload_15d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000002.tmp @@ -0,0 +1 @@ +paho1640921025845000001 \ No newline at end of file diff --git a/work/Tomcat/localhost/ROOT/upload_15d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000003.tmp b/work/Tomcat/localhost/ROOT/upload_15d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000003.tmp new file mode 100644 index 0000000..3e7e38c --- /dev/null +++ b/work/Tomcat/localhost/ROOT/upload_15d13a7b_1be2_4f8a_9950_5ec8ca58aea0_00000003.tmp @@ -0,0 +1 @@ +paho1640921025845000001 \ No newline at end of file diff --git a/work/Tomcat/localhost/ROOT/upload_98bb9a31_589f_4f58_9d02_9dea13a6b634_00000004.tmp b/work/Tomcat/localhost/ROOT/upload_98bb9a31_589f_4f58_9d02_9dea13a6b634_00000004.tmp new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/work/Tomcat/localhost/ROOT/upload_98bb9a31_589f_4f58_9d02_9dea13a6b634_00000004.tmp @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/work/Tomcat/localhost/ROOT/upload_98bb9a31_589f_4f58_9d02_9dea13a6b634_00000005.tmp b/work/Tomcat/localhost/ROOT/upload_98bb9a31_589f_4f58_9d02_9dea13a6b634_00000005.tmp new file mode 100644 index 0000000..9a03714 --- /dev/null +++ b/work/Tomcat/localhost/ROOT/upload_98bb9a31_589f_4f58_9d02_9dea13a6b634_00000005.tmp @@ -0,0 +1 @@ +10 \ No newline at end of file diff --git a/work/Tomcat/localhost/ROOT/upload_99c060d3_6ed9_4ca3_ba74_5c2ce4c25a0f_00000000.tmp b/work/Tomcat/localhost/ROOT/upload_99c060d3_6ed9_4ca3_ba74_5c2ce4c25a0f_00000000.tmp new file mode 100644 index 0000000..3e7e38c --- /dev/null +++ b/work/Tomcat/localhost/ROOT/upload_99c060d3_6ed9_4ca3_ba74_5c2ce4c25a0f_00000000.tmp @@ -0,0 +1 @@ +paho1640921025845000001 \ No newline at end of file