Commit 30ec5a2d by 111-PC\111

[+]pulsar消费服务

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