-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #283 from linglong67/feature/review-file-upload
[feat] 리뷰 + 파일 기능 추가 및 리팩토링
- Loading branch information
Showing
30 changed files
with
641 additions
and
180 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 |
---|---|---|
|
@@ -13,3 +13,5 @@ spring: | |
server: | ||
port: 8082 | ||
|
||
module: | ||
name: admin |
4 changes: 4 additions & 0 deletions
4
module-api/src/main/java/com/kernel360/file/repository/FileRepository.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,4 @@ | ||
package com.kernel360.file.repository; | ||
|
||
public interface FileRepository extends FileRepositoryJpa { | ||
} |
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
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
75 changes: 0 additions & 75 deletions
75
module-api/src/main/java/com/kernel360/review/dto/ReviewDto.java
This file was deleted.
Oops, something went wrong.
75 changes: 75 additions & 0 deletions
75
module-api/src/main/java/com/kernel360/review/dto/ReviewRequestDto.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,75 @@ | ||
package com.kernel360.review.dto; | ||
|
||
import com.kernel360.member.entity.Member; | ||
import com.kernel360.product.entity.Product; | ||
import com.kernel360.review.entity.Review; | ||
|
||
import java.math.BigDecimal; | ||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
/** | ||
* DTO for {@link ReviewRequestDto} | ||
*/ | ||
public record ReviewRequestDto(Long reviewNo, | ||
Long productNo, | ||
Long memberNo, | ||
BigDecimal starRating, | ||
String title, | ||
String contents, | ||
LocalDate createdAt, | ||
String createdBy, | ||
LocalDate modifiedAt, | ||
String modifiedBy, | ||
List<String> files) { | ||
|
||
public static ReviewRequestDto of( | ||
Long reviewNo, | ||
Long productNo, | ||
Long memberNo, | ||
BigDecimal starRating, | ||
String title, | ||
String contents, | ||
LocalDate createdAt, | ||
String createdBy, | ||
LocalDate modifiedAt, | ||
String modifiedBy, | ||
List<String> files | ||
) { | ||
return new ReviewRequestDto( | ||
reviewNo, | ||
productNo, | ||
memberNo, | ||
starRating, | ||
title, | ||
contents, | ||
createdAt, | ||
createdBy, | ||
modifiedAt, | ||
modifiedBy, | ||
files | ||
); | ||
} | ||
|
||
public Review toEntity() { | ||
return Review.of( | ||
reviewNo, | ||
Product.of(productNo), | ||
Member.of(memberNo), | ||
starRating, | ||
title, | ||
contents, | ||
true | ||
); | ||
} | ||
|
||
public Review toEntityForUpdate() { | ||
return Review.of( | ||
reviewNo, | ||
starRating, | ||
title, | ||
contents, | ||
true | ||
); | ||
} | ||
} |
Oops, something went wrong.