master
fst1996 2023-11-30 15:18:09 +08:00
parent 7e909132f1
commit 5b87af6999
3 changed files with 7 additions and 7 deletions

View File

@ -12,20 +12,20 @@ public class GetTopicReq {
/** /**
* VIN * VIN
*/ */
private String vin; private String vehicleVin;
/** /**
* *
*/ */
private String timeString; private String timestamp;
/** /**
* *
*/ */
private String userName; private String username;
/** /**
* *
*/ */
private String randomStr; private String nonce;
} }

View File

@ -36,11 +36,11 @@ public class TopLineServiceImpl extends ServiceImpl<TopicCarMapper, TopicCar> i
@Override @Override
public String getTopic(GetTopicReq getTopicReq) { public String getTopic(GetTopicReq getTopicReq) {
try { try {
if (StringUtils.isEmpty(getTopicReq.getVin())){ if (StringUtils.isEmpty(getTopicReq.getVehicleVin())){
throw new ServiceException("车辆vin不能为空"); throw new ServiceException("车辆vin不能为空");
} }
//根据车辆vinId查询车辆信息 //根据车辆vinId查询车辆信息
TopicCar topicCar = carMapper.selectById(getTopicReq.getVin()); TopicCar topicCar = carMapper.selectById(getTopicReq.getVehicleVin());
if (StringUtils.isEmpty(new TopicCar[]{topicCar})){ if (StringUtils.isEmpty(new TopicCar[]{topicCar})){
throw new ServiceException("车辆信息不存在"); throw new ServiceException("车辆信息不存在");
} }

View File

@ -14,7 +14,7 @@ public class Md5Util {
public static String md5(GetTopicReq getTopicReq) { public static String md5(GetTopicReq getTopicReq) {
try { try {
java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5"); java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5");
String str = getTopicReq.getTimeString() + getTopicReq.getUserName() + getTopicReq.getRandomStr() + getTopicReq.getVin(); String str = getTopicReq.getTimestamp() + getTopicReq.getUsername() + getTopicReq.getNonce() + getTopicReq.getVehicleVin();
byte[] array = md.digest(str.getBytes()); byte[] array = md.digest(str.getBytes());
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
for (int i = 0; i < array.length; ++i) { for (int i = 0; i < array.length; ++i) {