728x90
Parameter 1 of constructor in com.example.spring_subject.service.CommentService required a bean of type 'com.example.spring_subject.dto.CommentResponseDto' that could not be found.
Action:
Consider defining a bean of type 'com.example.spring_subject.dto.CommentResponseDto' in your configuration.
//CommentService.java
private final CommentResponseDto commentResponseDto;
제거함..
Dto는 안되는 거..?
private final로 의존성 주입하는 건데
스프링에서 관리하는 빈만 의존성 주입 가능
Dto는 빈이 아니라서 의존성 주입안됨
controller는 @Restcontroller로
repository는 JpaRepository로 상속받으면서 빈 된다고