-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[refactor] 동화 내용 API 리팩토링
- Loading branch information
Showing
11 changed files
with
223 additions
and
122 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,4 +47,4 @@ dependencies { | |
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} | ||
} |
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
21 changes: 21 additions & 0 deletions
21
BE/src/main/java/com/FTIsland/BE/book/content/dto/BookContentRequest.java
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.FTIsland.BE.book.content.dto; | ||
|
||
import lombok.*; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class BookContentRequest { | ||
private Integer bookId; // BookInfo에 title 있음. | ||
private String mainLan; | ||
private String subLan; | ||
|
||
@Builder | ||
public BookContentRequest(Integer bookId, String mainLan, String subLan){ | ||
this.bookId = bookId; | ||
this.mainLan = mainLan; | ||
this.subLan = subLan; | ||
} | ||
} | ||
|
||
|
||
|
47 changes: 47 additions & 0 deletions
47
BE/src/main/java/com/FTIsland/BE/book/content/dto/BookContentResponse.java
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.FTIsland.BE.book.content.dto; | ||
|
||
import com.FTIsland.BE.book.content.entity.BookContentEntity; | ||
import com.FTIsland.BE.dto.ContentVocaDTO; | ||
import lombok.*; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class BookContentResponse { | ||
private Integer bookId; //bookName도 추가? | ||
private Integer page; | ||
private String mainLan; | ||
private String subLan; | ||
private String korContents; | ||
private String mainContents; | ||
private String subContents; | ||
private List<ContentVocaDTO> vocaList; | ||
private String image; | ||
|
||
@Builder | ||
public BookContentResponse(Integer bookId, Integer page, String mainLan, String subLan, String korContents, String mainContents, String subContents, List<ContentVocaDTO> vocaList, String image){ | ||
this.bookId = bookId; | ||
this.page = page; | ||
this.mainLan = mainLan; | ||
this.subLan = subLan; | ||
this.korContents = korContents; | ||
this.mainContents = mainContents; | ||
this.subContents = subContents; | ||
this.vocaList = vocaList; | ||
this.image = image; | ||
} | ||
|
||
public BookContentEntity toBookContentEntity(){ | ||
return BookContentEntity.builder() | ||
.bookId(bookId) | ||
.page(page) | ||
.korContents(korContents) | ||
.image(image) | ||
.build(); | ||
} | ||
|
||
} | ||
|
||
|
||
|
38 changes: 38 additions & 0 deletions
38
BE/src/main/java/com/FTIsland/BE/book/content/entity/BookContentEntity.java
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.FTIsland.BE.book.content.entity; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@Entity | ||
@Getter | ||
@Table(name = "bookcontent") | ||
@NoArgsConstructor | ||
public class BookContentEntity { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Integer id; | ||
|
||
//@ManyToOne | ||
//@JoinColumn(name = "book_id") | ||
//private BookInfoEntity book; | ||
|
||
@Column | ||
private Integer bookId; | ||
|
||
@Column | ||
private Integer page; | ||
|
||
@Column | ||
private String korContents; | ||
|
||
@Column | ||
private String image; | ||
|
||
@Builder | ||
public BookContentEntity(Integer bookId, Integer page, String korContents, String image){ | ||
this.bookId = bookId; | ||
this.page = page; | ||
this.korContents = korContents; | ||
this.image = image; | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
.../BE/repository/BookContentRepository.java → ...ent/repository/BookContentRepository.java
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
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
Oops, something went wrong.