Skip to content

Commit

Permalink
topic主页添加查看消费者弹框
Browse files Browse the repository at this point in the history
  • Loading branch information
iamazy committed Oct 12, 2020
1 parent 7d44bfe commit 85b960e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ protected Consumer fillConsumer(Consumer consumer) {
if (application != null) {
app.setId(application.getId());
app.setName(application.getName());
consumer.setOwner(application.getOwner());
}
return consumer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@
<route inherit="delete"
path="/v1/producer/delete/:id" handlers="producer#delete render"
errors="error"/>
<route inherit="post"
path="/v1/producer/query-by-topic" handlers="producer#query-by-topic render"
errors="error"/>

<!-- producerConfig -->
<route inherit="post"
Expand All @@ -335,6 +338,9 @@
errors="error"/>
<route inherit="delete"
path="/v1/consumer/delete/:id" handlers="consumer#delete render"/>
<route inherit="post"
path="/v1/consumer/queryByTopic" handlers="consumer#queryByTopic render"
errors="error"/>

<route inherit="get"
path="/v1/consumer/findAllSubscribeGroups" handlers="consumer#findAllSubscribeGroups render"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,20 @@ public Response delete(@QueryParam(Constants.ID) String id) throws Exception {
return Responses.success();
}

@Path("queryByTopic")
public Response queryByTopic(@Body QConsumer qConsumer) throws Exception {
if (qConsumer.getTopic() == null || qConsumer.getTopic().getCode() == null) {
return Responses.error(Response.HTTP_BAD_REQUEST, "Empty topic!");
}
String namespace = null;
String topic = qConsumer.getTopic().getCode();
if (null != qConsumer.getTopic().getNamespace()) {
namespace = qConsumer.getTopic().getNamespace().getCode();
}
List<Consumer> consumers = service.findByTopic(topic, namespace);
return Responses.success(consumers);
}

@Path("configAddOrUpdate")
public Response configAddOrUpdate(@Body ConsumerConfig config) throws Exception {
if (config != null) {
Expand Down

0 comments on commit 85b960e

Please sign in to comment.