-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#7 - Feat: 1번 회원이 1번 해시태그 키워드를 선택하여 도서 1, 2번 글을 도서로 등록하는 Product Init…
…Data 추가
- Loading branch information
Showing
4 changed files
with
15 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,16 +5,21 @@ | |
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", "작가", "[email protected]")); | ||
// 일반 회원 | ||
Member member2 = memberService.join(new JoinForm("user2", "1234", null, "[email protected]")); | ||
|
||
// 글 작성 | ||
postService.write(member1, new WriteForm("제목1", "안녕하세요1", "<ul><li><p>안녕하세요1</p></li></ul>","#판타지 #소설 #판타지 #SF")); | ||
postService.write(member1, new WriteForm("제목2", "안녕하세요2", "<ul><li><p>안녕하세요2</p></li></ul>", null)); | ||
postService.write(member1, new WriteForm("제목2", "안녕하세요2", "<ul><li><p>안녕하세요2</p></li></ul>", "#판타지 #로맨스")); | ||
|
||
// 1번 회원이 1번(판타지) 글 키워드 선택 -> 1, 2번 글 도서 등록 | ||
productService.create(member1, new ProductForm("해리포터", "판타지 소설입니다.", 10000, 1L, "#판타지 #소설")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters