1.添加自定义注解
2.rocketMQ缓存数据统一放置文件夹中
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.njcn.access.controller;
|
||||
|
||||
import com.njcn.access.enums.AccessEnum;
|
||||
import com.njcn.access.param.DevAccessParam;
|
||||
import com.njcn.access.service.ICsDeviceService;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
@@ -8,9 +7,9 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||
import com.njcn.csdevice.enums.DeviceOperate;
|
||||
import com.njcn.web.advice.DeviceLog;
|
||||
import com.njcn.web.annotation.ReturnMsg;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -37,13 +36,12 @@ public class CsDeviceController extends BaseController {
|
||||
|
||||
private final ICsDeviceService csDeviceService;
|
||||
|
||||
private final EquipmentFeignClient equipmentFeignClient;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/register")
|
||||
@ApiOperation("直连设备状态判断")
|
||||
@ApiImplicitParam(name = "nDid", value = "设备识别码", required = true)
|
||||
@DeviceLog(operateType = DeviceOperate.JUDGE_ONLINE)
|
||||
@ReturnMsg
|
||||
public HttpResult<String> devRegister(@RequestParam String nDid){
|
||||
csDeviceService.devRegister(nDid);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, "设备MQTT通讯状态!");
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
//package com.njcn.access.controller;
|
||||
//
|
||||
//import com.njcn.access.pojo.param.MessageParam;
|
||||
//import com.njcn.web.controller.BaseController;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import io.swagger.annotations.ApiParam;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.apache.kafka.clients.consumer.ConsumerRecord;
|
||||
//import org.springframework.kafka.annotation.KafkaListener;
|
||||
//import org.springframework.kafka.core.KafkaTemplate;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//import org.springframework.web.bind.annotation.PostMapping;
|
||||
//import org.springframework.web.bind.annotation.RequestBody;
|
||||
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||
//import org.springframework.web.bind.annotation.RestController;
|
||||
//
|
||||
//import javax.annotation.Resource;
|
||||
//import javax.validation.Valid;
|
||||
//
|
||||
///**
|
||||
// * 类的介绍:
|
||||
// *
|
||||
// * @author xuyang
|
||||
// * @version 1.0.0
|
||||
// * @createTime 2023/4/18 13:53
|
||||
// */
|
||||
//@Slf4j
|
||||
//@RestController
|
||||
//@RequestMapping("/test")
|
||||
//@Api(value = "TestController", tags = {"测试 API"})
|
||||
//public class KafkaController extends BaseController {
|
||||
//
|
||||
// @Resource
|
||||
// private KafkaTemplate<String, String> kafkaTemplate;
|
||||
//
|
||||
// @PostMapping("/kafka/sendMessage")
|
||||
// @ApiOperation(value = "发送kafka告警消息")
|
||||
// public void sendKafkaMessage(@Valid @ApiParam("参数") @RequestBody MessageParam param) {
|
||||
// kafkaTemplate.send(param.getTopic(), param.getMessage());
|
||||
// }
|
||||
//
|
||||
// @Component
|
||||
// public class KafkaConsumer {
|
||||
// // 消费监听
|
||||
// @KafkaListener(topics = {"topic2"})
|
||||
// public void onMessage1(ConsumerRecord<?, ?> record){
|
||||
// // 消费的哪个topic、partition的消息,打印出消息内容
|
||||
// System.out.println("简单消费:"+record.topic()+"-"+record.partition()+"-"+record.value());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
Reference in New Issue
Block a user