master
parent
7e909132f1
commit
5b87af6999
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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("车辆信息不存在");
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue