Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
kotlin("jvm") version "1.9.25"
kotlin("jvm") version "2.1.0"
kotlin("plugin.spring") version "1.9.25"
id("org.springframework.boot") version "3.4.1"
id("io.spring.dependency-management") version "1.1.7"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,24 @@ class MatchMapper(

val matchInfoList = matches.map { matchEntity ->
val bettingInfo = bundleDto.bettings.find { it.matchId == matchEntity.id }
val tempPointExpiredDate = matchEntity.endDate.plusMinutes(5)
val resultInfo = bettingInfo?.result?.let {
MatchResultInfoDto(
victoryTeamId = matchEntity.matchResult!!.victoryTeam.id,
aTeamScore = matchEntity.matchResult!!.aTeamScore,
bTeamScore = matchEntity.matchResult!!.bTeamScore,
isPredictionSuccess = it.isPredicted,
earnedPoint = it.earnedPoint
earnedPoint = it.earnedPoint,
tempPointExpiredDate = tempPointExpiredDate,
)
} ?: matchEntity.matchResult?.let {
MatchResultInfoDto(
victoryTeamId = it.victoryTeam.id,
aTeamScore = it.aTeamScore,
bTeamScore = it.bTeamScore,
isPredictionSuccess = null,
earnedPoint = null
earnedPoint = null,
tempPointExpiredDate = tempPointExpiredDate,
)
}

Expand Down Expand Up @@ -106,13 +109,25 @@ class MatchMapper(
)
}

val tempPointExpiredDate = match.endDate.plusMinutes(5)

val resultDto = bettingInfo?.result?.let {
MatchResultInfoDto(
victoryTeamId = match.matchResult!!.victoryTeam.id,
aTeamScore = match.matchResult!!.aTeamScore,
bTeamScore = match.matchResult!!.bTeamScore,
isPredictionSuccess = it.isPredicted,
earnedPoint = it.earnedPoint
earnedPoint = it.earnedPoint,
tempPointExpiredDate = tempPointExpiredDate
)
} ?: match.matchResult?.let {
MatchResultInfoDto(
victoryTeamId = it.victoryTeam.id,
aTeamScore = it.aTeamScore,
bTeamScore = it.bTeamScore,
isPredictionSuccess = null,
earnedPoint = null,
tempPointExpiredDate = tempPointExpiredDate,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@ data class MatchResultInfoDto(
val aTeamScore: Int,
val bTeamScore: Int,
val isPredictionSuccess: Boolean?,
val earnedPoint: Long?
val earnedPoint: Long?,
val tempPointExpiredDate: LocalDateTime,
)