Commit 077576df by fz

1.请求类参数统一string接收,再转类型

1 parent 6f65d44e
......@@ -8,9 +8,9 @@ import lombok.Data;
@Data
public class SmartCarKeyAutoSenseRequest{
//智能车钥匙自动感应状态
private Integer autoSenseStatus;
private String autoSenseStatus;
private String sn;
private Long userId;
private String userId;
}
......@@ -16,5 +16,5 @@ public class SmartCarKeyCommandRequest{
private String keyCommond;
//用户id
private Long userId;
private String userId;
}
......@@ -12,5 +12,5 @@ public class SmartCarKeyNameRequest{
private String sn;
private Long userId;
private String userId;
}
......@@ -19,5 +19,5 @@ public class SmartCarKeyRegisterRequest{
//智能车钥匙MAC地址
private String smartLockMac;
private Long userId;
private String userId;
}
......@@ -9,5 +9,5 @@ import lombok.Data;
public class SmartCarKeyRequest{
private String sn;
private Long userId;
private String userId;
}
......@@ -9,5 +9,5 @@ import lombok.Data;
public class SmartCarKeyRmRequest {
private String sn;
private Long userId;
private String userId;
}
......@@ -46,7 +46,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
@Override
public R getLockingKey(SmartCarKeyRequest request) {
SmartCarKeyResponse response = new SmartCarKeyResponse();
SmartVehicleBlueKeyExample example = getExampleBysn(request.getUserId(),request.getSn());
SmartVehicleBlueKeyExample example = getExampleBysn(Long.valueOf(request.getUserId()),request.getSn());
List<SmartVehicleBlueKey> smartVehicleBlueKeys = smartVehicleBlueKeyService.selectByExample(example);
if(CollectionUtils.isEmpty(smartVehicleBlueKeys)){
......@@ -65,7 +65,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
//保存,crep用明文存储
newKey.setSn(request.getSn());
newKey.setUserId(request.getUserId());
newKey.setUserId(Long.valueOf(request.getUserId()));
newKey.setCrepCode(crep);
newKey.setCreateTime(new Date());
newKey.setAutoSenseStatus(0);
......@@ -113,7 +113,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
}
//更新,crep用明文存储
carkey.setSn(request.getSn());
carkey.setUserId(request.getUserId());
carkey.setUserId(Long.valueOf(request.getUserId()));
carkey.setCrepCode(crep);
carkey.setCreateTime(new Date());
carkey.setAutoSenseStatus(0);
......@@ -135,7 +135,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
public R removeLockingKey(SmartCarKeyRmRequest request) {
SmartVehicleBlueKey smartVehicleBlueKey = new SmartVehicleBlueKey();
smartVehicleBlueKey.setIsDelete(1);
smartVehicleBlueKeyService.updateByExampleSelective(smartVehicleBlueKey, getExampleBysn(request.getUserId(), request.getSn()));
smartVehicleBlueKeyService.updateByExampleSelective(smartVehicleBlueKey, getExampleBysn(Long.valueOf(request.getUserId()), request.getSn()));
return R.ok();
}
......@@ -144,7 +144,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
@Override
public R LogLockingKeyCommand(SmartCarKeyCommandRequest carKeyCommandRequest) {
SmartKeyCommandLog logData = new SmartKeyCommandLog();
logData.setUserId(carKeyCommandRequest.getUserId());
logData.setUserId(Long.valueOf(carKeyCommandRequest.getUserId()));
String crep = "";
try {
crep = aesEncryptUtils.decrypt(carKeyCommandRequest.getCrepCode());
......@@ -164,7 +164,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
public R setLockingKeyName(SmartCarKeyNameRequest request) {
SmartVehicleBlueKey smartVehicleBlueKey = new SmartVehicleBlueKey();
smartVehicleBlueKey.setKeyName(request.getKeyName());
smartVehicleBlueKeyService.updateByExampleSelective(smartVehicleBlueKey, getExampleBysn(request.getUserId(), request.getSn()));
smartVehicleBlueKeyService.updateByExampleSelective(smartVehicleBlueKey, getExampleBysn(Long.valueOf(request.getUserId()), request.getSn()));
return R.ok();
}
......@@ -172,8 +172,8 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
@Override
public R setLockingKeyAutoSense(SmartCarKeyAutoSenseRequest request) {
SmartVehicleBlueKey smartVehicleBlueKey = new SmartVehicleBlueKey();
smartVehicleBlueKey.setAutoSenseStatus(request.getAutoSenseStatus());
smartVehicleBlueKeyService.updateByExampleSelective(smartVehicleBlueKey, getExampleBysn(request.getUserId(), request.getSn()));
smartVehicleBlueKey.setAutoSenseStatus(Integer.valueOf(request.getAutoSenseStatus()));
smartVehicleBlueKeyService.updateByExampleSelective(smartVehicleBlueKey, getExampleBysn(Long.valueOf(request.getUserId()), request.getSn()));
return R.ok();
}
......@@ -198,7 +198,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
smartVehicleBlueKey.setCrepCode(crep);
smartVehicleBlueKey.setSecretKey(keySecret);
SmartVehicleBlueKeyExample example = new SmartVehicleBlueKeyExample();
example.createCriteria().andUserIdEqualTo(request.getUserId()).andCrepCodeEqualTo(crep).andIsDeleteEqualTo(0);
example.createCriteria().andUserIdEqualTo(Long.valueOf(request.getUserId())).andCrepCodeEqualTo(crep).andIsDeleteEqualTo(0);
smartVehicleBlueKeyService.updateByExampleSelective(smartVehicleBlueKey,example);
return R.ok();
......@@ -214,7 +214,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
//获取crep(雪花算法+userid)
private String getCrepCode(SmartCarKeyRequest request) {
long snowId = SnowFlake.nextId();
long userId = request.getUserId();
long userId = Long.parseLong(request.getUserId());
StringBuilder sb = new StringBuilder();
return sb.append(snowId).append(userId).toString();
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!