-
Notifications
You must be signed in to change notification settings - Fork 0
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
Step2 진짜 누누 사칭 아님 #10
base: main
Are you sure you want to change the base?
Conversation
* initial commit * docs: 기능 요구사항 작성 * feat: DB 테이블 스키마 구현 * chore: H2 의존성 추가 * docs: DAO 관련 기능 요구사항 작성 * test: ascii 경고 억제 * feat: dao 구현 * fix: db 관련 설정 변경 * test: dao 테스트 작성 * feat: repository 구현 * test: repository 테스트 작성 * feat: 서비스 구현 * test: 서비스 테스트 작성 * feat: 컨트롤러 작성 * test: controller 테스트 작성 * docs: 문서 최신화 * docs: DB 테이블, API 문서화 * chore: validation 의존성 추가 * feat: 검증 로직 및 예외 처리 로직 추가 * refactor: race 메서드 반환 타입 변경 * feat: 이름 입력 시 공백 관련 검증 로직 추가 * refactor: selectDao와 insertDao를 빈에서 제거 * feat: Cars에서 도메인을 반환하는 기능 구현 * style: 코드 포맷팅 변경 * feat: Entity 구현 * chore: final 추가 * refactor: Repository와 DAO 메소드 반환 타입이 일관적이도록 변경 * refactor: Repository 반환 타입 변경으로 인한 코드 변경 * test: 불필요한 테스트 삭제 * fix: test 에 id 가 1로 하드코딩 되어있던 부분 수정 * fix: dto 패키지 수정 * refactor: 패키지 분리 * chore: 메서드 saveAll 에서 insertAll 로 변경 * refactor: repository 에서 gameId 만을 반환하도록 변경 * feat: exception 처리 방식 변경 --------- Co-authored-by: apptie <[email protected]>
domain module 을 진짜 pojo로 변경
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.
수고하셨습니다 누누 🫡
많이 배워갑니다 🔥
apply plugin: 'org.springframework.boot' | ||
apply plugin: 'io.spring.dependency-management' |
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.
버전 명시안하면 현재 루트 버전과 달라질수도 있지 않나요? (진짜 궁금)
} | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter-web' |
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.
이렇게하면 콘솔에도 웹 의존성이 들어가지 않나요? (진짜 궁금)
public class Main { | ||
|
||
public static void main(final String[] args) { | ||
//스프링이 시작하는 위치를 알려주기 위한 클래스 |
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.
무슨 의미인지 설명해주세요
|
||
public class CarEntity { | ||
|
||
private final CarId carId; |
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.
해당 엔티티의 식별을 위해서는 eqauls
, hashcode
를 재정의해줘야하지 않을까용?
CarId
에는 정의해두었는데, 여기는 없어서!
|
||
public class GameEntity { | ||
|
||
private final GameId gameId; |
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.
요기도 equals
, hashcode
있으면 더 좋겠네요 :)
|
||
public class WinnerEntity { | ||
|
||
private final WinnerId winnerId; |
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.
ditto
this.racingGameRepository = racingGameRepository; | ||
} | ||
|
||
@Transactional(readOnly = true) |
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.
Command
와 Query
분리했으면 클래스 레벨에 해당 어노테이션 붙이는건 어떨까요?
public class PlayGameRequest { | ||
|
||
@NotEmpty(message = "배열을 입력해주세요") | ||
private final List<@NotBlank(message = "공백은 입력할 수 없습니다. 입력 값 : ${validatedValue}") String> names; |
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.
이거 좋은데요 👍
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.
아 이렇게 쓰는거구나 나한테 왜 안알려줌 개고생하다 포기했네
} | ||
|
||
@DisplayName("게임을 진행하고, 결과를 조회한다") | ||
@TestFactory |
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.
그때 에러의 원인이 무엇이였나요? 🤔
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.
서울대를 가기 싫어서 서강대에 간 눈우 코드 잘 봣습니다.
역시 누누네요 시비를 걸고 싶은데 몰라서 못거네요
다음부터 이런식으로 하지마세요
} | ||
|
||
@Bean | ||
public CommandLineRunner commandLineRunner() { |
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.
요 클래스는 태어나서 처음보네요 뭐죠?
제가 찾아볼 수는 있지만 눈우의 메타인지를 위해 설명해주세요
@@ -0,0 +1,28 @@ | |||
package racingcar.service; |
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.
제가 잘 몰라서 그런데요 멀티모듈은 어렵네요 근데 domain이라는 모듈에 서비스와 레포지토리가 있는 이유가 뭐에요? 진짜 모르니깐 진짜 설명해주세요
private final GameId gameId; | ||
private final CarId carId; |
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.
id만 포장해주신 이유가 뭐에요?>
public class WinnerDao { | ||
|
||
private final InsertWinnerDao insertWinnerDao; | ||
private final SelectWinnerDao selectWinnerDao; | ||
|
||
public WinnerDao(final JdbcTemplate jdbcTemplate) { |
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.
이런 식으로다가 다 갖다 나누니깐 어때요 좋아요?> 싫어요?
() -> Assertions.assertThat(result).hasSize(1), | ||
() -> assertThat(result.get(0).getName()).isEqualTo("토미"), | ||
() -> assertThat(result.get(0).getPosition()).isSameAs(9), | ||
() -> assertThat(result.get(0).getCarId().getValue()).isNotNull() |
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.
허걱 얘만 스태틱임포트 안함
|
||
import org.springframework.jdbc.core.JdbcTemplate; | ||
|
||
public final class RepositoryFactory { |
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.
팩토리를 만든 이유는>?
() -> assertThat(result.get(1).getCars().get(1).getCarName()).isEqualTo("asdf"), | ||
() -> assertThat(result.get(1).getCars().get(1).getPosition()).isEqualTo(4), | ||
() -> assertThat(result.get(1).getCars().get(1).getCarId().getValue()).isEqualTo(4) | ||
); |
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.
아우 징그러워요
public class PlayGameRequest { | ||
|
||
@NotEmpty(message = "배열을 입력해주세요") | ||
private final List<@NotBlank(message = "공백은 입력할 수 없습니다. 입력 값 : ${validatedValue}") String> names; |
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.
아 이렇게 쓰는거구나 나한테 왜 안알려줌 개고생하다 포기했네
No description provided.