diff --git a/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/base/initData/DevInitData.java b/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/base/initData/DevInitData.java index 2fab546..808c896 100644 --- a/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/base/initData/DevInitData.java +++ b/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/base/initData/DevInitData.java @@ -2,6 +2,7 @@ import com.example.mutbooks.app.member.service.MemberService; import com.example.mutbooks.app.post.service.PostService; +import com.example.mutbooks.app.product.service.ProductService; import org.springframework.boot.CommandLineRunner; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -11,9 +12,9 @@ @Profile("dev") public class DevInitData implements InitDataBefore { @Bean - CommandLineRunner initData(MemberService memberService, PostService postService) { + CommandLineRunner initData(MemberService memberService, PostService postService, ProductService productService) { return args -> { - before(memberService, postService); + before(memberService, postService, productService); }; } } \ No newline at end of file diff --git a/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/base/initData/InitDataBefore.java b/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/base/initData/InitDataBefore.java index 8926753..13f0286 100644 --- a/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/base/initData/InitDataBefore.java +++ b/2Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/base/initData/InitDataBefore.java @@ -5,9 +5,11 @@ import com.example.mutbooks.app.member.service.MemberService; import com.example.mutbooks.app.post.form.WriteForm; import com.example.mutbooks.app.post.service.PostService; +import com.example.mutbooks.app.product.form.ProductForm; +import com.example.mutbooks.app.product.service.ProductService; public interface InitDataBefore { - default void before(MemberService memberService, PostService postService) { + default void before(MemberService memberService, PostService postService, ProductService productService) { // 작가 회원 Member member1 = memberService.join(new JoinForm("user1", "1234", "작가", "user1@test.com")); // 일반 회원 @@ -15,6 +17,9 @@ default void before(MemberService memberService, PostService postService) { // 글 작성 postService.write(member1, new WriteForm("제목1", "안녕하세요1", "
안녕하세요1
안녕하세요2
안녕하세요2