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 a8d20993
authored
Apr 25, 2021
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
2 parents
b17c5d1f
b1a30c57
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
16 deletions
src/main/java/com/glsx/smart/controller/UserRelationController.java
src/main/java/com/glsx/smart/service/impl/SmartUserRelationServiceImpl.java
src/main/java/com/glsx/smart/controller/UserRelationController.java
View file @
a8d2099
...
@@ -10,7 +10,6 @@ import com.glsx.smart.dao.entity.SmartUserRelation;
...
@@ -10,7 +10,6 @@ import com.glsx.smart.dao.entity.SmartUserRelation;
import
com.glsx.smart.service.SmartUserRelationService
;
import
com.glsx.smart.service.SmartUserRelationService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -31,15 +30,6 @@ import java.util.Map;
...
@@ -31,15 +30,6 @@ import java.util.Map;
@RequestMapping
(
"/user"
)
@RequestMapping
(
"/user"
)
public
class
UserRelationController
{
public
class
UserRelationController
{
@Value
(
"${device_remote_url}"
)
private
String
remoteUrl
;
@Value
(
"${tuya_user_sync}"
)
private
String
syncUser
;
@Value
(
"${device_remote_url}"
)
private
String
aqaraSyncUserUrl
;
@Autowired
@Autowired
private
RedisUtils
redisUtils
;
private
RedisUtils
redisUtils
;
...
@@ -82,6 +72,7 @@ public class UserRelationController {
...
@@ -82,6 +72,7 @@ public class UserRelationController {
SmartUserRelation
user
=
userRelationService
.
getSingle
(
request
);
SmartUserRelation
user
=
userRelationService
.
getSingle
(
request
);
//用户数据封装
//用户数据封装
request
.
setUserId
(
userRelation
.
getUserId
());
request
.
setUserId
(
userRelation
.
getUserId
());
request
.
setSource
(
userRelation
.
getSource
());
request
.
setName
(
userRelation
.
getName
());
request
.
setName
(
userRelation
.
getName
());
if
(
user
!=
null
){
if
(
user
!=
null
){
userRelationService
.
updateByPrimaryKeySelective
(
request
);
userRelationService
.
updateByPrimaryKeySelective
(
request
);
...
...
src/main/java/com/glsx/smart/service/impl/SmartUserRelationServiceImpl.java
View file @
a8d2099
...
@@ -37,10 +37,10 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
...
@@ -37,10 +37,10 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
private
String
remoteUrl
;
private
String
remoteUrl
;
@Value
(
"${tuya_user_sync}"
)
@Value
(
"${tuya_user_sync}"
)
private
String
s
yncUser
;
private
String
tuyaS
yncUser
;
@Value
(
"${
device_remote_url
}"
)
@Value
(
"${
aqara_user_sync
}"
)
private
String
aqaraSyncUser
Url
;
private
String
aqaraSyncUser
;
@Resource
@Resource
private
SmartUserChannelMapper
userChannelMapper
;
private
SmartUserChannelMapper
userChannelMapper
;
...
@@ -151,7 +151,7 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
...
@@ -151,7 +151,7 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
object
.
put
(
"password"
,
password
);
object
.
put
(
"password"
,
password
);
try
{
try
{
StringBuffer
syncUserUrl
=
new
StringBuffer
(
remoteUrl
);
StringBuffer
syncUserUrl
=
new
StringBuffer
(
remoteUrl
);
syncUserUrl
.
append
(
s
yncUser
);
syncUserUrl
.
append
(
tuyaS
yncUser
);
log
.
info
(
"请求注册涂鸦平台接口地址:{},参数:{}"
,
syncUserUrl
.
toString
(),
JSON
.
toJSONString
(
object
));
log
.
info
(
"请求注册涂鸦平台接口地址:{},参数:{}"
,
syncUserUrl
.
toString
(),
JSON
.
toJSONString
(
object
));
String
result
=
HttpUtils
.
post
(
syncUserUrl
.
toString
(),
JSON
.
toJSONString
(
object
));
String
result
=
HttpUtils
.
post
(
syncUserUrl
.
toString
(),
JSON
.
toJSONString
(
object
));
log
.
info
(
"注册涂鸦平台返回结果:{}"
,
result
);
log
.
info
(
"注册涂鸦平台返回结果:{}"
,
result
);
...
@@ -177,8 +177,10 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
...
@@ -177,8 +177,10 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
object
.
put
(
"account"
,
mobile
);
object
.
put
(
"account"
,
mobile
);
object
.
put
(
"password"
,
mobile
);
object
.
put
(
"password"
,
mobile
);
try
{
try
{
log
.
info
(
"请求绿米平台用户接口地址:{},参数:{}"
,
aqaraSyncUserUrl
,
JSON
.
toJSONString
(
object
));
StringBuffer
syncUserUrl
=
new
StringBuffer
(
remoteUrl
);
String
result
=
HttpUtils
.
post
(
aqaraSyncUserUrl
,
JSON
.
toJSONString
(
object
));
syncUserUrl
.
append
(
aqaraSyncUser
);
log
.
info
(
"请求绿米平台用户接口地址:{},参数:{}"
,
syncUserUrl
.
toString
(),
JSON
.
toJSONString
(
object
));
String
result
=
HttpUtils
.
post
(
syncUserUrl
.
toString
(),
JSON
.
toJSONString
(
object
));
log
.
info
(
"请求绿米平台用户返回结果:{}"
,
result
);
log
.
info
(
"请求绿米平台用户返回结果:{}"
,
result
);
if
(!
StringUtils
.
isEmpty
(
result
))
{
if
(!
StringUtils
.
isEmpty
(
result
))
{
JSONObject
json
=
JSON
.
parseObject
(
result
);
JSONObject
json
=
JSON
.
parseObject
(
result
);
...
...
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