|
@@ -79,6 +79,7 @@ public class ClientUpgradeServiceImpl extends ServiceImpl<ClientUpgradeMapper, C
|
|
|
String filePathName = buildPath(true, UploadFileEnum.UPGRADE.getTitle(), "release", platform) + fileName;
|
|
|
FilePathVo filePathVo = fileUploadService.uploadFile(file, UploadFileEnum.UPGRADE, filePathName, fileMd5);
|
|
|
clientUpgrade.setInstallPath(JSON.toJSONString(filePathVo));
|
|
|
+ clientUpgrade.setInstallUploadTime(System.currentTimeMillis());
|
|
|
} else if (ClientPackageEnum.UPGRADE.equals(type)) {
|
|
|
// 读取指定文件内容mainfest.josn
|
|
|
String mainfestContent = readMainfest(file.getInputStream());
|
|
@@ -135,13 +136,14 @@ public class ClientUpgradeServiceImpl extends ServiceImpl<ClientUpgradeMapper, C
|
|
|
for (String dataFileName : mainfest.getData()) {
|
|
|
uploadUpgradeZipFiles(version, build, zipReader, data, dataFileName);
|
|
|
}
|
|
|
+ clientUpgrade.setUpgradeUploadTime(System.currentTimeMillis());
|
|
|
} else {
|
|
|
throw ExceptionResultEnum.ERROR.exception("请选择正确的包类型");
|
|
|
}
|
|
|
// 保存或更新
|
|
|
this.saveOrUpdate(clientUpgrade);
|
|
|
} catch (IOException e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
+ throw ExceptionResultEnum.ERROR.exception(type.getName() + "上传失败:" + e.getMessage());
|
|
|
} finally {
|
|
|
if (parentDirVar != null) {
|
|
|
FileUtil.deleteFile(parentDirVar);
|
|
@@ -190,6 +192,8 @@ public class ClientUpgradeServiceImpl extends ServiceImpl<ClientUpgradeMapper, C
|
|
|
prefix = fileUploadService.filePreviewPrefix(clientUpgrade.getInstallPath());
|
|
|
String installUrl = JSON.parseObject(clientUpgrade.getInstallPath(), FilePathVo.class).getPath();
|
|
|
clientInstallResult.setUrl(installUrl);
|
|
|
+ clientInstallResult.setInstallUploadTime(clientUpgrade.getInstallUploadTime());
|
|
|
+ clientInstallResult.setFileName(installUrl.substring(installUrl.lastIndexOf(SystemConstant.ORG_SPLIT) + 1));
|
|
|
}
|
|
|
clientResult.setInstall(clientInstallResult);
|
|
|
if (StringUtils.isNotBlank(clientUpgrade.getMainfestPath())) {
|
|
@@ -201,6 +205,7 @@ public class ClientUpgradeServiceImpl extends ServiceImpl<ClientUpgradeMapper, C
|
|
|
clientUpgradeResult.setSupportMin(clientUpgrade.getSupportMin());
|
|
|
String indexUrl = JSON.parseObject(clientUpgrade.getMainfestPath(), FilePathVo.class).getPath();
|
|
|
clientUpgradeResult.setIndex(indexUrl);
|
|
|
+ clientUpgradeResult.setUpgradeUploadTime(clientUpgrade.getUpgradeUploadTime());
|
|
|
}
|
|
|
clientResult.setUpgrade(clientUpgradeResult);
|
|
|
clientResult.setPrefix(prefix);
|