Commit 30ec5a2d by 111-PC\111

[+]pulsar消费服务

1 parent dc304367
......@@ -5,11 +5,14 @@ import cn.com.glsx.consumer.entity.AqaraEvent;
import cn.com.glsx.consumer.service.DeviceEventService;
import cn.com.glsx.consumer.service.InfoService;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @author zhouhaibao
......@@ -21,13 +24,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
public class NoticeController {
@Autowired
private InfoService infoService;
@Autowired
private DeviceEventService deviceEventService;
@RequestMapping("/deviceinfo")
public String deviceStatusInfo(@RequestBody String requestBody){
@RequestMapping(value = "/deviceInfo",method = RequestMethod.POST)
@ResponseBody
public String deviceInfo(@RequestBody String requestBody){
// 解密请求体信息
try {
log.info("消息内容{}",requestBody);
......@@ -38,7 +39,10 @@ public class NoticeController {
}else if(Contants.MSG_TYPE_DEIVCE.equals(aqaraEvent.getMsgType())){
deviceEventService.processDevMessage(aqaraEvent);
}
return "glsxtest";
JSONObject jsonObject=new JSONObject();
jsonObject.put("code",0);
jsonObject.put("result","glsxtest");
return jsonObject.toJSONString();
}catch (Exception e){
e.printStackTrace();
return null;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!