topic search

This commit is contained in:
许晓东
2021-09-09 19:53:02 +08:00
parent f4413107d7
commit 966f22da44
8 changed files with 103 additions and 39 deletions

View File

@@ -1,9 +1,11 @@
package com.xuxd.kafka.console.controller;
import com.xuxd.kafka.console.beans.enums.TopicType;
import com.xuxd.kafka.console.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
@@ -20,7 +22,7 @@ public class TopicController {
private TopicService topicService;
@GetMapping("/list")
public Object getTopicList() {
return topicService.getTopicList();
public Object getTopicList(@RequestParam(required = false) String topic, @RequestParam String type) {
return topicService.getTopicList(topic, TopicType.valueOf(type.toUpperCase()));
}
}