Skip to content
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

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

qormoon
Copy link

@qormoon qormoon commented Nov 27, 2024

늦어서 죄송합니다ㅜ

Copy link
Member

@gikhoon gikhoon left a 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;
Copy link
Member

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) {
Copy link
Member

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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

java17부터 불변객체임을 증명해주고 효율적으로 코드를 짤 수 있는 record 클래스라는게 있어요!
한번 공부해보시면 좋을 것 같아요.

레퍼런스: https://s7won.tistory.com/2


@Getter
public class CreatePostRequest {
private String title;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request에 Validation을 넣어주면 객체가 생성되는 단계에서 유효성 검사를 할 수 있어요!

Copy link
Member

@yooooonshine yooooonshine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드가 제 취향이랑 비슷하네요
고생하셨어요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants