Skip to content

Commit 8e4e337

Browse files
authored
Merge pull request #81 from team-gogo/fix/query-match-response-spec
2 parents 9c3699e + cb28667 commit 8e4e337

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
kotlin("jvm") version "1.9.25"
2+
kotlin("jvm") version "2.1.0"
33
kotlin("plugin.spring") version "1.9.25"
44
id("org.springframework.boot") version "3.4.1"
55
id("io.spring.dependency-management") version "1.1.7"

src/main/kotlin/gogo/gogostage/domain/match/root/application/MatchMapper.kt

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,24 @@ class MatchMapper(
3535

3636
val matchInfoList = matches.map { matchEntity ->
3737
val bettingInfo = bundleDto.bettings.find { it.matchId == matchEntity.id }
38+
val tempPointExpiredDate = matchEntity.endDate.plusMinutes(5)
3839
val resultInfo = bettingInfo?.result?.let {
3940
MatchResultInfoDto(
4041
victoryTeamId = matchEntity.matchResult!!.victoryTeam.id,
4142
aTeamScore = matchEntity.matchResult!!.aTeamScore,
4243
bTeamScore = matchEntity.matchResult!!.bTeamScore,
4344
isPredictionSuccess = it.isPredicted,
44-
earnedPoint = it.earnedPoint
45+
earnedPoint = it.earnedPoint,
46+
tempPointExpiredDate = tempPointExpiredDate,
4547
)
4648
} ?: matchEntity.matchResult?.let {
4749
MatchResultInfoDto(
4850
victoryTeamId = it.victoryTeam.id,
4951
aTeamScore = it.aTeamScore,
5052
bTeamScore = it.bTeamScore,
5153
isPredictionSuccess = null,
52-
earnedPoint = null
54+
earnedPoint = null,
55+
tempPointExpiredDate = tempPointExpiredDate,
5356
)
5457
}
5558

@@ -106,13 +109,25 @@ class MatchMapper(
106109
)
107110
}
108111

112+
val tempPointExpiredDate = match.endDate.plusMinutes(5)
113+
109114
val resultDto = bettingInfo?.result?.let {
110115
MatchResultInfoDto(
111116
victoryTeamId = match.matchResult!!.victoryTeam.id,
112117
aTeamScore = match.matchResult!!.aTeamScore,
113118
bTeamScore = match.matchResult!!.bTeamScore,
114119
isPredictionSuccess = it.isPredicted,
115-
earnedPoint = it.earnedPoint
120+
earnedPoint = it.earnedPoint,
121+
tempPointExpiredDate = tempPointExpiredDate
122+
)
123+
} ?: match.matchResult?.let {
124+
MatchResultInfoDto(
125+
victoryTeamId = it.victoryTeam.id,
126+
aTeamScore = it.aTeamScore,
127+
bTeamScore = it.bTeamScore,
128+
isPredictionSuccess = null,
129+
earnedPoint = null,
130+
tempPointExpiredDate = tempPointExpiredDate,
116131
)
117132
}
118133

src/main/kotlin/gogo/gogostage/domain/match/root/application/dto/MatchDto.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,6 @@ data class MatchResultInfoDto(
8484
val aTeamScore: Int,
8585
val bTeamScore: Int,
8686
val isPredictionSuccess: Boolean?,
87-
val earnedPoint: Long?
87+
val earnedPoint: Long?,
88+
val tempPointExpiredDate: LocalDateTime,
8889
)

0 commit comments

Comments
 (0)