|
|
|
@ -7,6 +7,7 @@ import com.example.zxweb.dto.GuangZhaoChuanGanQiDTO;
|
|
|
|
|
import com.example.zxweb.dto.HuanJingJianCeDTO;
|
|
|
|
|
import com.example.zxweb.dto.KafkaConsumerDTO;
|
|
|
|
|
import com.example.zxweb.dto.KongQiZhiLiangChuanGanQiDTO;
|
|
|
|
|
import com.example.zxweb.utils.CacheManager;
|
|
|
|
|
import com.example.zxweb.utils.KafkaUtil;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
@ -35,6 +36,17 @@ import java.util.*;
|
|
|
|
|
public class KafkaController {
|
|
|
|
|
@Resource
|
|
|
|
|
private KafkaUtil kafkaUtil;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/test")
|
|
|
|
|
public Result<?> test(){
|
|
|
|
|
String test = (String) CacheManager.get("test");
|
|
|
|
|
if (StringUtils.isEmpty(test)) {
|
|
|
|
|
CacheManager.put("test","张三"+new Date().getTime());
|
|
|
|
|
}
|
|
|
|
|
return Result.OK(test);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/consumer/{topic}")
|
|
|
|
|
@ApiOperation(value = "consumer")
|
|
|
|
|
public Result<?> getConsumerData(@PathVariable String topic) {
|
|
|
|
|