Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
chejia-smart-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 b17c5d1f
authored
Apr 25, 2021
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
接口参数修改
1 parent
4ea322a3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
src/main/java/com/glsx/smart/controller/UserDeviceController.java
src/main/java/com/glsx/smart/service/SmartUserDeviceService.java
src/main/java/com/glsx/smart/service/impl/SmartUserDeviceServiceImpl.java
src/main/java/com/glsx/smart/controller/UserDeviceController.java
View file @
b17c5d1
...
@@ -92,13 +92,16 @@ public class UserDeviceController {
...
@@ -92,13 +92,16 @@ public class UserDeviceController {
/**
/**
* 获取用户 bindKey
* 获取用户 bindKey
*
*
* @param
username 用户名
* @param
token 用户 token
* @return 结果
* @return 结果
*/
*/
@RequestMapping
(
value
=
"/getUserBindKey"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/getUserBindKey"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
String
getUserBindKey
(
String
username
)
{
public
String
getUserBindKey
(
String
token
)
{
log
.
info
(
"$$$$ /userDevice/getUserBindKey param: {}"
,
username
);
log
.
info
(
"$$$$ /userDevice/getUserBindKey param: {}"
,
token
);
return
userDeviceService
.
getUserBindKey
(
username
);
if
(
StringUtils
.
isBlank
(
token
))
{
throw
BusinessException
.
create
(
ResultEnum
.
PARAM_ERROR
);
}
return
userDeviceService
.
getUserBindKey
(
token
);
}
}
/**
/**
...
...
src/main/java/com/glsx/smart/service/SmartUserDeviceService.java
View file @
b17c5d1
...
@@ -21,7 +21,7 @@ public interface SmartUserDeviceService {
...
@@ -21,7 +21,7 @@ public interface SmartUserDeviceService {
int
deleteDevice
(
SmartUserDevice
req
);
int
deleteDevice
(
SmartUserDevice
req
);
String
getUserBindKey
(
String
username
);
String
getUserBindKey
(
String
token
);
String
sendCommand
(
JSONObject
req
);
String
sendCommand
(
JSONObject
req
);
}
}
src/main/java/com/glsx/smart/service/impl/SmartUserDeviceServiceImpl.java
View file @
b17c5d1
...
@@ -101,9 +101,9 @@ public class SmartUserDeviceServiceImpl extends BaseService implements SmartUser
...
@@ -101,9 +101,9 @@ public class SmartUserDeviceServiceImpl extends BaseService implements SmartUser
}
}
@Override
@Override
public
String
getUserBindKey
(
String
username
)
{
public
String
getUserBindKey
(
String
token
)
{
JSONObject
reqObj
=
new
JSONObject
();
JSONObject
reqObj
=
new
JSONObject
();
reqObj
.
put
(
"
username"
,
username
);
reqObj
.
put
(
"
token"
,
token
);
String
url
=
remoteUrl
+
userBindKeyApi
;
String
url
=
remoteUrl
+
userBindKeyApi
;
log
.
info
(
"$$$$ getUserBindKey url = {}, req = {}"
,
url
,
reqObj
.
toJSONString
());
log
.
info
(
"$$$$ getUserBindKey url = {}, req = {}"
,
url
,
reqObj
.
toJSONString
());
String
respJson
=
HttpUtils
.
get
(
url
,
reqObj
);
String
respJson
=
HttpUtils
.
get
(
url
,
reqObj
);
...
...
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