앱 위젯에서 구분선 리사이즈 안되는 문제 수정
This commit is contained in:
@@ -57,12 +57,11 @@ public class MobileAppReleaseService {
|
||||
Instant updated = Files.getLastModifiedTime(file).toInstant();
|
||||
String base = normalizeBase(publicBaseUrl);
|
||||
String downloadUrl = base + "/api/mobile-app/download/android";
|
||||
String version = resolveApkVersion(file);
|
||||
return MobileAppReleaseInfoDto.builder()
|
||||
.available(true)
|
||||
.fileName(file.getFileName().toString())
|
||||
.version(configuredVersion != null && !configuredVersion.isBlank()
|
||||
? configuredVersion
|
||||
: DT_FMT.format(updated))
|
||||
.version(version)
|
||||
.sizeBytes(size)
|
||||
.updatedAt(DT_FMT.format(updated))
|
||||
.downloadUrl(downloadUrl)
|
||||
@@ -141,4 +140,29 @@ public class MobileAppReleaseService {
|
||||
}
|
||||
return publicBaseUrl.replaceAll("/+$", "");
|
||||
}
|
||||
|
||||
/** APK와 함께 기록된 .version sidecar → .env configuredVersion → 파일 수정 시각 */
|
||||
private String resolveApkVersion(Path apkFile) {
|
||||
String apkName = apkFile.getFileName().toString();
|
||||
Path sidecar = apkFile.getParent().resolve(
|
||||
apkName.replaceAll("(?i)\\.apk$", "") + ".version");
|
||||
try {
|
||||
if (Files.isRegularFile(sidecar)) {
|
||||
String fromFile = Files.readString(sidecar).trim();
|
||||
if (!fromFile.isBlank()) {
|
||||
return fromFile;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.warn("[mobile-app] read version sidecar failed: {}", e.getMessage());
|
||||
}
|
||||
if (configuredVersion != null && !configuredVersion.isBlank()) {
|
||||
return configuredVersion.trim();
|
||||
}
|
||||
try {
|
||||
return DT_FMT.format(Files.getLastModifiedTime(apkFile).toInstant());
|
||||
} catch (IOException e) {
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user