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 81d07858
authored
Apr 19, 2021
by
周海宝
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'dev' into 'master'
Dev See merge request
!13
2 parents
61fecc4d
c90a7266
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
src/main/java/cn/com/glsx/modules/model/param/ResponseBody.java
src/main/java/cn/com/glsx/modules/service/DeviceService.java
src/main/java/cn/com/glsx/modules/service/SendRequestService.java
src/main/java/cn/com/glsx/modules/model/param/ResponseBody.java
View file @
81d0785
...
...
@@ -28,4 +28,15 @@ public class ResponseBody {
private
String
message
;
private
String
msg
;
@Override
public
String
toString
()
{
return
"ResponseBody{"
+
"success="
+
success
+
", result='"
+
result
+
'\''
+
", code="
+
code
+
", message='"
+
message
+
'\''
+
", msg='"
+
msg
+
'\''
+
'}'
;
}
}
src/main/java/cn/com/glsx/modules/service/DeviceService.java
View file @
81d0785
...
...
@@ -52,6 +52,7 @@ public class DeviceService {
}
public
R
getDevicesById
(
String
device_id
)
{
log
.
info
(
"开始查询{}"
,
device_id
);
ResponseBody
responseBody
=
sendRequestService
.
sendRequestGet
(
getDevicesByIdUrl
.
replace
(
"{device_id}"
,
device_id
));
if
(
responseBody
!=
null
&&
responseBody
.
isSuccess
())
{
String
result
=
responseBody
.
getResult
();
...
...
src/main/java/cn/com/glsx/modules/service/SendRequestService.java
View file @
81d0785
...
...
@@ -75,6 +75,7 @@ public class SendRequestService {
try
{
JSONObject
jsonObject
=
HttpUtil
.
sendGet
(
requesturl
,
null
,
headerParams
);
responseBody
=
JSON
.
toJavaObject
(
jsonObject
,
ResponseBody
.
class
);
log
.
info
(
"请求涂鸦数据{}"
,
responseBody
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
log
.
info
(
"请求用户信息接口异常,异常信息{}"
,
e
.
getMessage
());
...
...
@@ -99,6 +100,7 @@ public class SendRequestService {
try
{
JSONObject
jsonObject
=
HttpUtil
.
sendPut
(
requesturl
,
requestBody
,
headerParams
);
responseBody
=
JSON
.
toJavaObject
(
jsonObject
,
ResponseBody
.
class
);
log
.
info
(
"请求涂鸦数据{}"
,
responseBody
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
log
.
info
(
"请求用户信息接口异常,异常信息{}"
,
e
.
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