refactor: fix types for new Kotlin compiler

This commit is contained in:
Gauthier Roebroeck 2025-07-15 12:22:45 +08:00
parent aa80ef83a7
commit 34c7d8b39b
2 changed files with 3 additions and 3 deletions

View file

@ -36,7 +36,7 @@ class AnnouncementController(
Caffeine Caffeine
.newBuilder() .newBuilder()
.expireAfterAccess(1, TimeUnit.DAYS) .expireAfterAccess(1, TimeUnit.DAYS)
.build<String, JsonFeedDto>() .build<String, JsonFeedDto?>()
@GetMapping @GetMapping
@PreAuthorize("hasRole('ADMIN')") @PreAuthorize("hasRole('ADMIN')")

View file

@ -58,7 +58,7 @@ class ReleaseController(
} }
?: throw ResponseStatusException(HttpStatus.NOT_FOUND) ?: throw ResponseStatusException(HttpStatus.NOT_FOUND)
fun fetchGitHubReleases(): List<GithubReleaseDto>? { fun fetchGitHubReleases(): List<GithubReleaseDto> {
val response = val response =
webClient webClient
.get() .get()
@ -67,6 +67,6 @@ class ReleaseController(
}.retrieve() }.retrieve()
.toEntity(object : ParameterizedTypeReference<List<GithubReleaseDto>>() {}) .toEntity(object : ParameterizedTypeReference<List<GithubReleaseDto>>() {})
.block() .block()
return response?.body return response?.body ?: emptyList()
} }
} }