Commit a8d20993 by tyfanchz

Merge remote-tracking branch 'origin/dev' into dev

2 parents b17c5d1f b1a30c57
...@@ -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);
......
...@@ -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 syncUser; private String tuyaSyncUser;
@Value("${device_remote_url}") @Value("${aqara_user_sync}")
private String aqaraSyncUserUrl; 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(syncUser); syncUserUrl.append(tuyaSyncUser);
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);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!