-
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.
Browse files
Browse the repository at this point in the history
…-api [FEAT] 리뷰 내용 상세 조회 API
- Loading branch information
Showing
7 changed files
with
57 additions
and
2 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
16 changes: 16 additions & 0 deletions
16
.../java/com/example/growthookserver/api/review/dto/response/ReviewDetailGetResponseDto.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,16 @@ | ||
package com.example.growthookserver.api.review.dto.response; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor(staticName = "of") | ||
public class ReviewDetailGetResponseDto { | ||
private String actionPlan; | ||
private Boolean isScraped; | ||
private String content; | ||
private String reviewDate; | ||
} |
11 changes: 11 additions & 0 deletions
11
...ver/src/main/java/com/example/growthookserver/api/review/repository/ReviewRepository.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 |
---|---|---|
@@ -1,8 +1,19 @@ | ||
package com.example.growthookserver.api.review.repository; | ||
|
||
import com.example.growthookserver.api.cave.domain.Cave; | ||
import com.example.growthookserver.api.review.domain.Review; | ||
import com.example.growthookserver.common.exception.NotFoundException; | ||
import com.example.growthookserver.common.response.ErrorStatus; | ||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface ReviewRepository extends JpaRepository<Review, Long> { | ||
|
||
Optional<Review> findReviewByActionPlanId(Long actionPlanId); | ||
|
||
default Review findReviewByActionPlanIdOrThrow(Long actionPlanId) { | ||
return findReviewByActionPlanId(actionPlanId) | ||
.orElseThrow(() -> new NotFoundException(ErrorStatus.NOT_FOUND_REVIEW.getMessage())); | ||
} | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
...ookServer/src/main/java/com/example/growthookserver/api/review/service/ReviewService.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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package com.example.growthookserver.api.review.service; | ||
|
||
import com.example.growthookserver.api.review.dto.request.ReviewCreateRequestDto; | ||
import com.example.growthookserver.api.review.dto.response.ReviewDetailGetResponseDto; | ||
|
||
public interface ReviewService{ | ||
|
||
//* 액션 플랜별 리뷰 작성 | ||
void createReview(Long actionPlanId, ReviewCreateRequestDto reviewCreateRequestDto); | ||
|
||
//* 리뷰 내용 상세 조회 | ||
ReviewDetailGetResponseDto getReviewDetail(Long actionPlanId); | ||
} |
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