v1.0.76 #88

Merged
timi merged 2 commits from dev into master 2026-11-17 08:40:25 +00:00
2 changed files with 22 additions and 2 deletions
+1 -1
View File
@@ -11,7 +11,7 @@
<groupId>com.imyeyu.timiserverapi</groupId> <groupId>com.imyeyu.timiserverapi</groupId>
<artifactId>TimiServerAPI</artifactId> <artifactId>TimiServerAPI</artifactId>
<version>1.0.75</version> <version>1.0.76</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>TimiServerAPI</name> <name>TimiServerAPI</name>
<description>imyeyu.com API</description> <description>imyeyu.com API</description>
@@ -114,8 +114,11 @@ public class AppVersionService {
return new AppUpdateNotesResponse(null, Collections.emptyList()); return new AppUpdateNotesResponse(null, Collections.emptyList());
} }
AppRelease target = resolveChannelRelease(product, req); AppRelease target = resolveChannelRelease(product, req);
// 原生包更新走安装包,与热更日志无关 // 安装包不属于更新日志:通道指向原生包时,改用最新发布的热更包做上界
if (target == null || target.getKind() == AppRelease.Kind.NATIVE) { if (target == null || target.getKind() == AppRelease.Kind.NATIVE) {
target = latestPublishedBundle(product);
}
if (target == null) {
return new AppUpdateNotesResponse(null, Collections.emptyList()); return new AppUpdateNotesResponse(null, Collections.emptyList());
} }
// 当前版本不低于通道版本:已是最新,或回滚后反而超前 // 当前版本不低于通道版本:已是最新,或回滚后反而超前
@@ -269,6 +272,23 @@ public class AppVersionService {
return latest; return latest;
} }
/// 取最近一次发布的热更包
///
/// 通道指向原生包时,更新日志没有「通道版本」可用,改用这里兜底。
/// 日志是「这个产品最近发了什么」,与设备能不能装无关,所以不套灰度与兼容区间
///
/// @param product 产品
/// @return 版本最高的已发布热更包,没有则返回 null
private AppRelease latestPublishedBundle(AppProduct product) {
AppRelease latest = null;
for (AppRelease item : releaseMapper.selectPublished(product.getId(), AppRelease.Kind.BUNDLE)) {
if (latest == null || 0 < compareVersion(item.getVersionName(), latest.getVersionName())) {
latest = item;
}
}
return latest;
}
/// 判断设备是否命中灰度 /// 判断设备是否命中灰度
/// ///
/// @param grayPermille 灰度比例,万分比 /// @param grayPermille 灰度比例,万分比