-
Notifications
You must be signed in to change notification settings - Fork 3
feat : 방어 전투 로그 조회할 수 있는 기능 추가, 성능 개선 #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
...ezcode/codetest/application/game/dto/response/encounter/DefenceBattleHistoryResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package org.ezcode.codetest.application.game.dto.response.encounter; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| import org.ezcode.codetest.domain.game.model.encounter.BattleHistory; | ||
|
|
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import lombok.Builder; | ||
|
|
||
| @Builder | ||
| @Schema(description = "캐릭터 방어 전투 결과 응답") | ||
| public record DefenceBattleHistoryResponse( | ||
|
|
||
| @Schema(description = "공격자 캐릭터 닉네임") | ||
| String attackerNickName, | ||
|
|
||
| @Schema(description = "플레이어 캐릭터 닉네임") | ||
| String PlayerNickName, | ||
|
|
||
| @Schema(description = "전투 로그") | ||
| String battleLog, | ||
|
|
||
| @Schema(description = "플레이어 승패 여부(이겼을시 true, 패배시 false)") | ||
| boolean isDefenderWin, | ||
|
|
||
| @Schema(description = "PVP 가 일어난 시점") | ||
| LocalDateTime battleCreatedAt | ||
|
|
||
| ) { | ||
| public static DefenceBattleHistoryResponse from(BattleHistory history) { | ||
| return DefenceBattleHistoryResponse.builder() | ||
| .attackerNickName(history.getAttacker().getName()) | ||
| .PlayerNickName(history.getDefender().getName()) | ||
| .battleLog(history.getBattleLog()) | ||
| .isDefenderWin(!history.getIsAttackerWin()) | ||
| .battleCreatedAt(history.getCreatedAt()) | ||
| .build(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
시간대 처리를 명시적으로 관리하세요.
LocalDateTime.now()는 시스템 시간대에 의존하므로 다국가 서비스에서 예상치 못한 결과를 초래할 수 있습니다. UTC 기준으로 시간을 처리하거나 애플리케이션의 표준 시간대를 명시적으로 사용하는 것을 권장합니다.추가로
java.time.ZoneOffsetimport가 필요합니다.🤖 Prompt for AI Agents