앱 위젯에서 구분선 리사이즈 안되는 문제 수정

This commit is contained in:
Macbook
2026-06-14 17:54:26 +09:00
parent 7f5e7b22d2
commit ead2ba6b3a
9 changed files with 229 additions and 65 deletions
@@ -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";
}
}
}