-
Notifications
You must be signed in to change notification settings - Fork 3
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
🚀 좋아요 요청 및 취소 기능 작성 #55
Conversation
📑 Jacoco 테스트 결과
|
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.
깔끔하게 작성해주셔서 보기 편했던 것 같습니다! 몇 개 코맨트만 남겨놓았습니다!
|
||
@ParameterizedTest | ||
@NullSource | ||
@DisplayName("post가 null 인 경우 좋아요 객체를 생성 시 예외가 발생한다.") |
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에 post가 아니라 user가 들어가야하는 것 같습니다!
} | ||
|
||
private WeatherDto weatherDtoGenerator() { | ||
return new WeatherDto(0.0, -10.0, 10.0, 1, 1); |
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.
weatherDtoGenerator() 중복 줄이기에 좋은 것 같습니다👍
post 테스트 부분도 개선해보도록 하겠습니다!
혹시 저는 저 WeatherDto를 상수로 놓았는데 혹시 이 방법은 어떻게 생각하시나요? 수정 제안이 아니라 의견이 궁금해서 여쭤봅니다!
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.
앗 코드랑 같이 보여드릴 걸 그랬네요! 지금 수정 중인 코드에서 작성한 코드입니다!
static final TemperatureArrangeDto TEMPERATURE_ARRANGE_DTO = new TemperatureArrangeDto(-10.0, 10.0);
static final TemperatureArrange TEMPERATURE_ARRANGE = TemperatureArrange.from(TEMPERATURE_ARRANGE_DTO);
저는 이런 방식으로 작성을 해놓았습니다!
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.
지금은 WeatherDto가 TemperatureArrangeDto로 이름이 변경되었습니다!
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.
괜찮은 방법인 것 같아 도입하고 push 했습니다!
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.
앗!!!!!! 이따가 이야기 나눠보죠,,전 중원님 방식도 괜찮은 것 같아서,,, 제 방식만 공유해본 것이엇는데 수정한다면 제가 맞추겠습니다!
📑 Jacoco 테스트 결과
|
📑 Jacoco 테스트 결과
|
📑 Jacoco 테스트 결과
|
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.
고생하셨습니다! 스타일만 조금 수정하면 좋을 것 같아요
|
||
private final LikeService likeService; | ||
|
||
@PostMapping("") |
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.
mapping이 별도로 필요 없으면 안쓰는 것도 좋을 것 같아요
@PostMapping("") | |
@PostMapping |
import jakarta.validation.constraints.NotNull; | ||
|
||
public record LikeRequest( | ||
@Min(value = 1) |
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.
@Positive
를 쓰는 것도 좋을 것 같아요
|
||
@Transactional | ||
public LikeResponse requestLike(Long userId, Long postId) { | ||
|
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.
여기 개행은 없어도 될 것 같아요!
static Faker faker = new Faker(); | ||
static final WeatherDto weatherDto = new WeatherDto(0.0, -10.0, 10.0, 1, 1); |
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.
통일성을 위해 faker에도 final 키워드 쓰는 것도 좋을 것 같아요
|
||
|
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.
개행을 한 줄만 해줘도 좋을 것 같아요
📑 Jacoco 테스트 결과
|
✅ 요구사항
🚀 주요 변경사항
💡 기타사항