@NoArgsConstructor //기본 생성자 추가
@AllArgsConstructor //모든 필드 값을 파라미터로 받는 생성자 추가
@Getter
public class AddArticleRequest {
//private String id;
private String title;
private String content;
public Article toEntity(String author){ //생성자를 사용해 객체 생성
return Article.builder()
.title(title)
.content(content)
.author(author) //여기서 에러남
.build();
}
}
Cannot resolve method 'author' in 'ArticleBuilder'
No candidates found for method call Article.builder() .title(title) .content(content) .author(author).
'공부 > Spring' 카테고리의 다른 글
스프링 부트 3 백엔드 개발자 되기_25 (0) | 2023.09.07 |
---|---|
스프링 부트 3 백엔드 개발자 되기_24 (0) | 2023.09.06 |
스프링 부트 3 백엔드 개발자 되기_22 (0) | 2023.09.04 |
스프링 부트 3 백엔드 개발자 되기_21 (0) | 2023.09.03 |
스프링 부트 3 백엔드 개발자 되기_20 (0) | 2023.09.01 |