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 2c844654
authored
Apr 27, 2021
by
111-PC\111
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]aqara代码提交
1 parent
7130c016
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletions
src/main/java/cn/com/glsx/modules/controller/AqaraDeviceController.java
src/main/java/cn/com/glsx/modules/service/AqaraDeviceService.java
src/main/java/cn/com/glsx/modules/controller/AqaraDeviceController.java
View file @
2c84465
...
@@ -41,7 +41,14 @@ public class AqaraDeviceController {
...
@@ -41,7 +41,14 @@ public class AqaraDeviceController {
@RequestMapping
(
value
=
"/subscriber"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/subscriber"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
@ApiOperation
(
value
=
"订阅资源"
)
@ApiOperation
(
value
=
"订阅资源"
)
public
R
subscriber
(
@RequestBody
String
data
,
@RequestParam
(
required
=
false
)
String
token
){
public
R
subscriber
(
@RequestBody
String
data
,
String
token
){
return
aqaraDeviceService
.
subscriber
(
data
,
token
);
return
aqaraDeviceService
.
subscriber
(
data
,
token
);
}
}
@RequestMapping
(
value
=
"/unbind"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ApiOperation
(
value
=
"解绑设备"
)
public
R
unbind
(
String
deviceId
,
String
token
){
return
aqaraDeviceService
.
unbind
(
deviceId
,
token
);
}
}
}
src/main/java/cn/com/glsx/modules/service/AqaraDeviceService.java
View file @
2c84465
...
@@ -101,4 +101,12 @@ public class AqaraDeviceService extends BaseDeviceService {
...
@@ -101,4 +101,12 @@ public class AqaraDeviceService extends BaseDeviceService {
}
}
return
R
.
error
(
responseMsg
.
getMessage
());
return
R
.
error
(
responseMsg
.
getMessage
());
}
}
public
R
unbind
(
String
deviceId
,
String
token
)
{
ResponseMsg
responseMsg
=
DeviceManager
.
unbindDev
(
new
AiotConfig
(
clientId
,
null
,
token
,
null
,
domain
),
deviceId
,
null
);
if
(
responseMsg
!=
null
&&
Constants
.
AQARA_RETURN_SUCCESS_CODE
==
responseMsg
.
getCode
())
{
return
R
.
ok
(
JSONObject
.
toJSONString
(
responseMsg
));
}
return
R
.
error
(
responseMsg
.
getMessage
());
}
}
}
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