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

p.111에 나오는 PostsApiController.java의 update메소드 인자 PostsUpdateRequestDto #15

Closed
MorrisHong opened this issue Dec 5, 2019 · 7 comments

Comments

@MorrisHong
Copy link

MorrisHong commented Dec 5, 2019

@PutMapping("/api/v1/posts/{id}
public Long update(@PathVariable Long id, @RequestBody **PostsUpdateRequestDto** requestDto) {
   ...
}

책에는 PostsUpdateRequestDto소스코드가 없는 거 같아요.. 제가 못찾은 걸까요 ㅠ

** Posts 클래스의 update메소드도 구현부분이 없습니다. 나중에 확인 편하게 하시라고 본문에 추가합니다

@MorrisHong
Copy link
Author

그리고 책에 Posts클래스의 update 메소드가 호출하는 것만 있고 구현코드는 없는 거 같은데.. 맞나요?

@gaeul-kim
Copy link

@Getter
public class PostsUpdateRequestDto {
    private String title;
    private String content;

    @Builder
    public PostsUpdateRequestDto(String title, String content) {
        this.title = title;
        this.content = content;
    }
}
public void update(String title, String content) {
    this.title = title;
    this.content = content;
}

@MorrisHong
Copy link
Author

@hello-sangsik 혹시 책에서 찾으신건가요?

@jojoldu
Copy link
Owner

jojoldu commented Dec 5, 2019

@gracelove91 님 제보 감사합니다 말씀하신대로 코드가 누락되었습니다ㅠ 3쇄에 바로 반영하겠습니다!

@gaeul-kim
Copy link

gaeul-kim commented Dec 6, 2019

@hello-sangsik 혹시 책에서 찾으신건가요?

저도 찾질 못해서 직접 작성했습니다ㅎㅎ

@tommy8808
Copy link

PostsUpdateRequestDto 클래스에
@NoArgsConstructor 어노테이션도 붙여주셔야 될 것 같습니다.

@jojoldu
Copy link
Owner

jojoldu commented Dec 28, 2019

@tommy8808 앗 제보 감사합니다 :)

@jojoldu jojoldu closed this as completed Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants