1. update check-update api
This commit is contained in:
2026-04-03 21:55:08 +08:00
parent 0aa61bc6c0
commit 49b6afc4e9
2 changed files with 9 additions and 6 deletions

View File

@@ -15,14 +15,16 @@ public class CheckVersionResponse implements Serializable {
private Boolean isForceUpdate = Boolean.FALSE; private Boolean isForceUpdate = Boolean.FALSE;
private String updateVersion;
private String updateContent;
private String url; private String url;
private String qihooUrl; private String qihooUrl;
private String yingyongbaoUrl; private String yingyongbaoUrl;
private String updateContent;
private String webDownloadUrl; private String webDownloadUrl;
private String fallbackUrl; private String fallbackUrl;

View File

@@ -63,9 +63,12 @@ public class CommonReleaseVersionServiceImpl extends BaseServiceImpl<CommonRelea
.orderByDesc(CommonReleaseVersionEntity::getVersionCode) .orderByDesc(CommonReleaseVersionEntity::getVersionCode)
); );
if (!list.isEmpty()) { if (!list.isEmpty()) {
response.setNeedUpdate(Boolean.TRUE);
boolean f = false; boolean f = false;
int code = list.get(0).getVersionCode(); CommonReleaseVersionEntity newest = list.get(0);
response.setNeedUpdate(Boolean.TRUE);
response.setUpdateVersion(newest.getVersionName());
response.setUpdateContent(newest.getUpdateContent());
int code = newest.getVersionCode();
List<CommonReleaseVersionEntity> newestList = new ArrayList<>(); List<CommonReleaseVersionEntity> newestList = new ArrayList<>();
for (CommonReleaseVersionEntity entity : list) { for (CommonReleaseVersionEntity entity : list) {
if (!f && Objects.equals(entity.getIsForceUpdate(), 1)) { if (!f && Objects.equals(entity.getIsForceUpdate(), 1)) {
@@ -144,8 +147,6 @@ public class CommonReleaseVersionServiceImpl extends BaseServiceImpl<CommonRelea
entity.setIsForceUpdate(vo.getIsForceUpdate()); entity.setIsForceUpdate(vo.getIsForceUpdate());
entity.setUpdateContent(vo.getUpdateContent()); entity.setUpdateContent(vo.getUpdateContent());
entity.setDownloadUrl(vo.getDownloadUrl()); entity.setDownloadUrl(vo.getDownloadUrl());
entity.setDispatchUrl(vo.getDispatchUrl());
entity.setDispatchTargetVersion(vo.getDispatchTargetVersion());
// 使用 MapStruct 设置渠道和状态 // 使用 MapStruct 设置渠道和状态
return CommonReleaseVersionConvert.INSTANCE.copyForChannel(entity, AppMarketChannelEnum.OFFICIAL); return CommonReleaseVersionConvert.INSTANCE.copyForChannel(entity, AppMarketChannelEnum.OFFICIAL);
} }