Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
glsx-smart-message-channel
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 30ec5a2d
authored
Apr 22, 2021
by
111-PC\111
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]pulsar消费服务
1 parent
dc304367
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
src/main/java/cn/com/glsx/consumer/controller/NoticeController.java
src/main/java/cn/com/glsx/consumer/controller/NoticeController.java
View file @
30ec5a2
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment