|
@@ -62,11 +62,11 @@ public class FileUpdateInfoServiceImpl implements FileUpdateInfoService {
|
|
|
// 如果文件存在,计算本地文件的 MD5 值
|
|
|
String fileMd5 = DigestUtils.md5Hex(new FileInputStream(file));
|
|
|
fileUpdateInfo.setFileMd5(fileMd5);
|
|
|
- fileUpdateInfo.setUpdateStatus("待检查文件版本");
|
|
|
+ fileUpdateInfo.setUpdateStatus(0);
|
|
|
} else {
|
|
|
// 如果文件不存在,设置状态为“待更新”
|
|
|
fileUpdateInfo.setFileMd5(null);
|
|
|
- fileUpdateInfo.setUpdateStatus("待更新");
|
|
|
+ fileUpdateInfo.setUpdateStatus(1);
|
|
|
}
|
|
|
|
|
|
fileUpdateInfo.setVersion("v1.0.0"); // 初始化版本号
|
|
@@ -91,7 +91,7 @@ public class FileUpdateInfoServiceImpl implements FileUpdateInfoService {
|
|
|
if (!localFile.exists()) {
|
|
|
// 如果本地文件不存在,设置状态为“待更新”
|
|
|
fileUpdateInfo.setRemoteMd5(remoteFileMd5);
|
|
|
- fileUpdateInfo.setUpdateStatus("版本待检测");
|
|
|
+ fileUpdateInfo.setUpdateStatus(0);
|
|
|
fileUpdateInfoMapper.updateById(fileUpdateInfo);
|
|
|
return true;
|
|
|
} else {
|
|
@@ -99,7 +99,7 @@ public class FileUpdateInfoServiceImpl implements FileUpdateInfoService {
|
|
|
String localFileMd5 = DigestUtils.md5Hex(new FileInputStream(localFile));
|
|
|
boolean isUpdateRequired = !localFileMd5.equals(remoteFileMd5);
|
|
|
fileUpdateInfo.setRemoteMd5(remoteFileMd5);
|
|
|
- fileUpdateInfo.setUpdateStatus(isUpdateRequired ? "有新版本需更新" : "无需更新");
|
|
|
+ fileUpdateInfo.setUpdateStatus(isUpdateRequired ? 1 : 0);
|
|
|
fileUpdateInfoMapper.updateById(fileUpdateInfo);
|
|
|
return isUpdateRequired;
|
|
|
}
|
|
@@ -143,7 +143,7 @@ public class FileUpdateInfoServiceImpl implements FileUpdateInfoService {
|
|
|
fileUpdateInfo.setFileMd5(newFileMd5);
|
|
|
fileUpdateInfo.setCreateTime(fileUpdateInfo.getCreateTime());
|
|
|
fileUpdateInfo.setUpdateTime(LocalDateTime.now());
|
|
|
- fileUpdateInfo.setUpdateStatus("已是最新版本");
|
|
|
+ fileUpdateInfo.setUpdateStatus(0);
|
|
|
|
|
|
// 递增版本号
|
|
|
String currentVersion = fileUpdateInfo.getVersion();
|