-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 싱글 조회 로직 구현 * feat: 싱글 조회 관련 로직 테스트 추가 * feat: 싱글 조회 adoc 파일에 추가
- Loading branch information
1 parent
e9e206a
commit e44252a
Showing
13 changed files
with
195 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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 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
10 changes: 10 additions & 0 deletions
10
...ain/java/online/partyrun/partyrunbattleservice/domain/single/dto/RunningTimeResponse.java
This file contains 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,10 @@ | ||
package online.partyrun.partyrunbattleservice.domain.single.dto; | ||
|
||
import online.partyrun.partyrunbattleservice.domain.single.entity.RunningTime; | ||
|
||
public record RunningTimeResponse(int hours, int minutes, int seconds) { | ||
|
||
public RunningTimeResponse(RunningTime runningTime) { | ||
this(runningTime.getHours(), runningTime.getMinutes(), runningTime.getSeconds()); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/online/partyrun/partyrunbattleservice/domain/single/dto/SingleResponse.java
This file contains 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,13 @@ | ||
package online.partyrun.partyrunbattleservice.domain.single.dto; | ||
|
||
import online.partyrun.partyrunbattleservice.domain.runner.dto.RunnerRecordResponse; | ||
import online.partyrun.partyrunbattleservice.domain.single.entity.Single; | ||
|
||
import java.util.List; | ||
|
||
public record SingleResponse(RunningTimeResponse runningTime, List<RunnerRecordResponse> records) { | ||
|
||
public SingleResponse(Single single) { | ||
this(new RunningTimeResponse(single.getRunningTime()), single.getRunnerRecords().stream().map(RunnerRecordResponse::new).toList()); | ||
} | ||
} |
This file contains 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
9 changes: 9 additions & 0 deletions
9
...e/partyrun/partyrunbattleservice/domain/single/exception/InvalidSingleOwnerException.java
This file contains 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,9 @@ | ||
package online.partyrun.partyrunbattleservice.domain.single.exception; | ||
|
||
import online.partyrun.partyrunbattleservice.global.exception.BadRequestException; | ||
|
||
public class InvalidSingleOwnerException extends BadRequestException { | ||
public InvalidSingleOwnerException(String singleId, String runnerId) { | ||
super(String.format("%s 러너는 %s 싱글 기록의 주인이 아닙니다.", runnerId, singleId)); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...nline/partyrun/partyrunbattleservice/domain/single/exception/SingleNotFoundException.java
This file contains 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,10 @@ | ||
package online.partyrun.partyrunbattleservice.domain.single.exception; | ||
|
||
import online.partyrun.partyrunbattleservice.global.exception.NotFoundException; | ||
|
||
public class SingleNotFoundException extends NotFoundException { | ||
|
||
public SingleNotFoundException(String singleId) { | ||
super(String.format("%s 의 싱글 기록은 존재하지 않습니다.", singleId)); | ||
} | ||
} |
This file contains 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 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 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 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 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
13 changes: 13 additions & 0 deletions
13
src/test/java/online/partyrun/partyrunbattleservice/global/ServiceTest.java
This file contains 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,13 @@ | ||
package online.partyrun.partyrunbattleservice.global; | ||
|
||
import online.partyrun.partyrunbattleservice.domain.battle.config.TestApplicationContextConfig; | ||
import online.partyrun.partyrunbattleservice.domain.battle.config.TestTimeConfig; | ||
import online.partyrun.testmanager.redis.EnableRedisTest; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.context.annotation.Import; | ||
|
||
@SpringBootTest | ||
@EnableRedisTest | ||
@Import({TestApplicationContextConfig.class, TestTimeConfig.class}) | ||
public abstract class ServiceTest { | ||
} |