-
Notifications
You must be signed in to change notification settings - Fork 12
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
[백지현] 3차 과제 제출 #13
base: develop
Are you sure you want to change the base?
[백지현] 3차 과제 제출 #13
Conversation
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 lombok.RequiredArgsConstructor; | ||
|
||
@RestController | ||
@RequestMapping("/api/posts") | ||
@RequiredArgsConstructor | ||
public class PostController { | ||
|
||
private static final int PAGE_SIZE = 10; |
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 String title; | ||
private String name; | ||
|
||
public static PostSummary from(Post post) { |
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.
정적 팩토리 메소드👍
|
||
@Getter | ||
@AllArgsConstructor | ||
public class PostPageResponse { |
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.
java17부터 불변객체임을 증명해주고 효율적으로 코드를 짤 수 있는 record 클래스라는게 있어요!
한번 공부해보시면 좋을 것 같아요.
|
||
@Getter | ||
public class CreatePostRequest { | ||
private String title; |
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.
request에 Validation을 넣어주면 객체가 생성되는 단계에서 유효성 검사를 할 수 있어요!
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.
코드가 제 취향이랑 비슷하네요
고생하셨어요!
늦어서 죄송합니다ㅜ