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;
import com.glsx.smart.service.SmartUserRelationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
......@@ -31,15 +30,6 @@ import java.util.Map;
@RequestMapping("/user")
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
private RedisUtils redisUtils;
......@@ -82,6 +72,7 @@ public class UserRelationController {
SmartUserRelation user = userRelationService.getSingle(request);
//用户数据封装
request.setUserId(userRelation.getUserId());
request.setSource(userRelation.getSource());
request.setName(userRelation.getName());
if(user != null){
userRelationService.updateByPrimaryKeySelective(request);
......
......@@ -37,10 +37,10 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
private String remoteUrl;
@Value("${tuya_user_sync}")
private String syncUser;
private String tuyaSyncUser;
@Value("${device_remote_url}")
private String aqaraSyncUserUrl;
@Value("${aqara_user_sync}")
private String aqaraSyncUser;
@Resource
private SmartUserChannelMapper userChannelMapper;
......@@ -151,7 +151,7 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
object.put("password", password);
try {
StringBuffer syncUserUrl = new StringBuffer(remoteUrl);
syncUserUrl.append(syncUser);
syncUserUrl.append(tuyaSyncUser);
log.info("请求注册涂鸦平台接口地址:{},参数:{}", syncUserUrl.toString(), JSON.toJSONString(object));
String result = HttpUtils.post(syncUserUrl.toString(), JSON.toJSONString(object));
log.info("注册涂鸦平台返回结果:{}", result);
......@@ -177,8 +177,10 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
object.put("account", mobile);
object.put("password", mobile);
try {
log.info("请求绿米平台用户接口地址:{},参数:{}", aqaraSyncUserUrl, JSON.toJSONString(object));
String result = HttpUtils.post(aqaraSyncUserUrl, JSON.toJSONString(object));
StringBuffer syncUserUrl = new StringBuffer(remoteUrl);
syncUserUrl.append(aqaraSyncUser);
log.info("请求绿米平台用户接口地址:{},参数:{}", syncUserUrl.toString(), JSON.toJSONString(object));
String result = HttpUtils.post(syncUserUrl.toString(), JSON.toJSONString(object));
log.info("请求绿米平台用户返回结果:{}", result);
if (!StringUtils.isEmpty(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!