Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
smartDevices-platform-service
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 7130c016
authored
Apr 27, 2021
by
111-PC\111
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]aqara代码提交
1 parent
5df88c06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
src/main/java/cn/com/glsx/modules/service/AqaraDeviceService.java
src/main/java/cn/com/glsx/modules/service/AqaraDeviceService.java
View file @
7130c01
...
...
@@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -90,9 +91,11 @@ public class AqaraDeviceService extends BaseDeviceService {
if
(
StringUtils
.
isEmpty
(
token
)){
R
.
error
(
ResultEnum
.
PARAM_ERROR
.
getCode
(),
ResultEnum
.
PARAM_ERROR
.
getMessage
());
}
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
data
);
List
<
ResourceSubscribeInfo
>
resourceSubscribeInfos
=
JSONObject
.
parseArray
(
jsonObject
.
getString
(
"data"
),
ResourceSubscribeInfo
.
class
);
ResponseMsg
responseMsg
=
ResourceManager
.
subscriber
(
new
AiotConfig
(
clientId
,
null
,
token
,
null
,
domain
),
resourceSubscribeInfos
);
String
result
=
JSONObject
.
parseObject
(
data
).
getString
(
"data"
);
ResourceSubscribeInfo
resourceSubscribeInfo
=
JSONObject
.
parseObject
(
result
,
ResourceSubscribeInfo
.
class
);
List
<
ResourceSubscribeInfo
>
resourceSubscribeInfoList
=
new
ArrayList
<>();
resourceSubscribeInfoList
.
add
(
resourceSubscribeInfo
);
ResponseMsg
responseMsg
=
ResourceManager
.
subscriber
(
new
AiotConfig
(
clientId
,
null
,
token
,
null
,
domain
),
resourceSubscribeInfoList
);
if
(
responseMsg
!=
null
&&
Constants
.
AQARA_RETURN_SUCCESS_CODE
==
responseMsg
.
getCode
())
{
return
R
.
ok
(
JSONObject
.
toJSONString
(
responseMsg
));
}
...
...
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