-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/#37 리뷰 관련 기능 구현(ocr제외) #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
fc729dc
2e3099b
93253f5
6d03bb1
532a1e9
84b8a2e
f693364
233485e
999d9e5
233fd66
19a216f
0985830
6adb5b7
6bc5713
3e68965
b0a2afe
a41398e
fc132dd
7fe95d4
0c33ec3
3e2ce01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| package com.campus.campus.domain.review.application.dto.request; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import com.campus.campus.domain.place.application.dto.response.SavedPlaceInfo; | ||
|
|
||
|
Comment on lines
+5
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: fd -t f ReviewRequest.javaRepository: our-campUS/our-campUS-BE Length of output: 192 🏁 Script executed: find . -type f -name "SavedPlaceInfo.java"Repository: our-campUS/our-campUS-BE Length of output: 159 🏁 Script executed: find . -type f -name "PlaceRequest.java"Repository: our-campUS/our-campUS-BE Length of output: 50 🏁 Script executed: cat -n src/main/java/com/campus/campus/domain/review/application/dto/request/ReviewRequest.javaRepository: our-campUS/our-campUS-BE Length of output: 1899 🏁 Script executed: cat -n src/main/java/com/campus/campus/domain/place/application/dto/response/SavedPlaceInfo.javaRepository: our-campUS/our-campUS-BE Length of output: 1418 요청 DTO가 응답 DTO(
🤖 Prompt for AI Agents |
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import jakarta.validation.Valid; | ||
| import jakarta.validation.constraints.DecimalMax; | ||
| import jakarta.validation.constraints.DecimalMin; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import jakarta.validation.constraints.Size; | ||
|
|
||
| public record ReviewRequest( | ||
|
|
||
| @NotNull | ||
| @Size(min = 10, message = "리뷰 내용은 최소 10자 이상이어야 합니다.") | ||
| @Schema(example = "아주 정말 맛있습니다. 저의 완전 짱 또간집. 꼭꼮꼬꼬꼭 가세요.") | ||
| String content, | ||
|
|
||
| @NotNull | ||
| @DecimalMin(value = "0.0", inclusive = true) | ||
| @DecimalMax(value = "5.0", inclusive = true) | ||
| @Schema(example = "3.5") | ||
| Double star, | ||
|
Comment on lines
+21
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -type f -name "ReviewRequest.java" | head -5Repository: our-campUS/our-campUS-BE Length of output: 192 🏁 Script executed: pwd && ls -la | head -20Repository: our-campUS/our-campUS-BE Length of output: 906 🏁 Script executed: find . -type f -name "ReviewRequest.java"Repository: our-campUS/our-campUS-BE Length of output: 158 🏁 Script executed: cat -n ./src/main/java/com/campus/campus/domain/review/application/dto/request/ReviewRequest.javaRepository: our-campUS/our-campUS-BE Length of output: 1899 🏁 Script executed: find . -type f -name "*Validator*.java" | head -20Repository: our-campUS/our-campUS-BE Length of output: 142 🏁 Script executed: find . -type f -name "*ReviewService*.java"Repository: our-campUS/our-campUS-BE Length of output: 154 🏁 Script executed: cat -n ./src/main/java/com/campus/campus/domain/review/application/service/ReviewService.javaRepository: our-campUS/our-campUS-BE Length of output: 12667 🏁 Script executed: find . -type f -name "Review.java" -path "*/domain/entity/*"Repository: our-campUS/our-campUS-BE Length of output: 141 🏁 Script executed: cat -n ./src/main/java/com/campus/campus/domain/review/domain/entity/Review.javaRepository: our-campUS/our-campUS-BE Length of output: 1942 🏁 Script executed: find . -type f -name "*ReviewTest*.java" -o -name "*ReviewRequest*.java" | grep -i testRepository: our-campUS/our-campUS-BE Length of output: 50 🏁 Script executed: rg "0\.5|granularity|decimal|star" --type java -i | head -30Repository: our-campUS/our-campUS-BE Length of output: 4196 🏁 Script executed: cat -n ./src/main/java/com/campus/campus/domain/review/presentation/ReviewController.java | grep -A 20 -B 20 "star"Repository: our-campUS/our-campUS-BE Length of output: 1631 🏁 Script executed: find . -type f \( -name "*.md" -o -name "*.yaml" -o -name "*.yml" \) | xargs grep -l "star\|rating" 2>/dev/null | head -5Repository: our-campUS/our-campUS-BE Length of output: 235 🏁 Script executed: grep -A 5 -B 5 "star\|rating" ./src/main/resources/application-dev.yml ./src/main/resources/application-local.yml ./src/main/resources/application-prod.ymlRepository: our-campUS/our-campUS-BE Length of output: 2156 🏁 Script executed: find . -type f -name "*.java" -path "*review*" -exec grep -l "comment\|javadoc\|documentation\|granularity\|unit\|step" {} \;Repository: our-campUS/our-campUS-BE Length of output: 50 🏁 Script executed: find . -path "*/test/*" -name "*Review*Test*.java" -o -path "*/test/*" -name "*Test*Review*.java"Repository: our-campUS/our-campUS-BE Length of output: 50
현재 코드는 0.0~5.0 범위 검증만 수행하며, 0.5 단위 강제 같은 세부 정책은 Bean Validation만으로는 처리되지 않습니다. 컨트롤러 예제에 "3.5"가 명시되어 있지만 실제로는 3.14 같은 임의의 값도 저장될 수 있습니다. 커스텀 🤖 Prompt for AI Agents |
||
|
|
||
| List<String> imageUrls, | ||
|
|
||
| @Schema(example = | ||
| """ | ||
| "placeName": "숙명여자대학교", | ||
| "placeKey": "string", | ||
| "address": "서울특별시 용산구 청파로47길 99", | ||
| "category": "교육,학문>대학교", | ||
| "link": "https://map.naver.com/v5/search/%EC%88%99%EB%AA%85%EC%97%AC%EC%9E%90%EB%8C%80%ED%95%99%EA%B5%90+%EC%A0%9C1%EC%BA%A0%ED%8D%BC%EC%8A%A4?c=37.545947,126.964578,15,0,0,0,dh", | ||
| "telephone": "010-1234-1234", | ||
| "coordinate": { | ||
| "latitude": 0.1, | ||
| "longitude": 0.1 | ||
| }, | ||
| "imgUrls": [ | ||
| "string" | ||
| ] | ||
| """, | ||
| description = "/search API에서 반환된 결과 중 하나를 선택") | ||
|
Comment on lines
+29
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -type f -name "ReviewRequest.java" | head -20Repository: our-campUS/our-campUS-BE Length of output: 158 🏁 Script executed: cat -n ./src/main/java/com/campus/campus/domain/review/application/dto/request/ReviewRequest.java | sed -n '20,50p'Repository: our-campUS/our-campUS-BE Length of output: 1120 🏁 Script executed: find . -type f -name "SavedPlaceInfo.java" | head -5Repository: our-campUS/our-campUS-BE Length of output: 159 🏁 Script executed: cat -n ./src/main/java/com/campus/campus/domain/place/application/dto/response/SavedPlaceInfo.javaRepository: our-campUS/our-campUS-BE Length of output: 1418
최상위 제안 수정 @Schema(example =
"""
- "placeName": "숙명여자대학교",
- "placeKey": "string",
- "address": "서울특별시 용산구 청파로47길 99",
- "category": "교육,학문>대학교",
- "link": "https://map.naver.com/v5/search/%EC%88%99%EB%AA%85%EC%97%AC%EC%9E%90%EB%8C%80%ED%95%99%EA%B5%90+%EC%A0%9C1%EC%BA%A0%ED%8D%BC%EC%8A%A4?c=37.545947,126.964578,15,0,0,0,dh",
- "telephone": "010-1234-1234",
- "coordinate": {
- "latitude": 0.1,
- "longitude": 0.1
- },
- "imgUrls": [
- "string"
- ]
+ {
+ "placeName": "숙명여자대학교",
+ "placeKey": "string",
+ "address": "서울특별시 용산구 청파로47길 99",
+ "category": "교육,학문>대학교",
+ "link": "https://map.naver.com/v5/search/%EC%88%99%EB%AA%85%EC%97%AC%EC%9E%90%EB%8C%80%ED%95%99%EA%B5%90+%EC%A0%9C1%EC%BA%A0%ED%8D%BC%EC%8A%A4?c=37.545947,126.964578,15,0,0,0,dh",
+ "telephone": "010-1234-1234",
+ "coordinate": { "latitude": 0.1, "longitude": 0.1 },
+ "imgUrls": ["string"]
+ }
""",
description = "/search API에서 반환된 결과 중 하나를 선택")🤖 Prompt for AI Agents |
||
| @NotNull | ||
| @Valid | ||
| SavedPlaceInfo place | ||
|
Comment on lines
+29
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Schema 예시 JSON 형식이 올바르지 않습니다.
📝 수정 제안 @Schema(example =
"""
- "placeName": "숙명여자대학교",
+ {
+ "placeName": "숙명여자대학교",
"placeKey": "string",
"address": "서울특별시 용산구 청파로47길 99",
"category": "교육,학문>대학교",
"link": "https://map.naver.com/v5/search/...",
"telephone": "010-1234-1234",
"coordinate": {
"latitude": 0.1,
"longitude": 0.1
},
"imgUrls": [
"string"
]
- """,
+ }
+ """,
description = "/search API에서 반환된 결과 중 하나를 선택")🤖 Prompt for AI Agents |
||
|
|
||
| ) { | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package com.campus.campus.domain.review.application.dto.response; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| public class CursorPageReviewResponse<ReviewResponse> { | ||
|
|
||
| private List<ReviewResponse> items; | ||
| private String nextCursorCreatedAt; | ||
| private Long nextCursorId; | ||
| private boolean hasNext; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package com.campus.campus.domain.review.application.dto.response; | ||
|
|
||
| import lombok.Builder; | ||
|
|
||
| @Builder | ||
| public record PlaceReviewRankResponse( | ||
| Long placeId, | ||
| String placeName, | ||
| String category, | ||
| String partnership, | ||
| String thumbnailUrl | ||
| // double distance | ||
| ) { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package com.campus.campus.domain.review.application.dto.response; | ||
|
|
||
| import lombok.Builder; | ||
|
|
||
| @Builder | ||
| public record RankingScope( | ||
| String scope, | ||
| long rank //n번째 리뷰 | ||
| ) { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package com.campus.campus.domain.review.application.dto.response; | ||
|
|
||
| import lombok.Builder; | ||
|
|
||
| @Builder | ||
| public record ReviewCreateResponse( | ||
| WriteReviewResponse review, | ||
| ReviewCreateResult result, | ||
| ReviewRankingResponse ranking | ||
|
|
||
| ) { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package com.campus.campus.domain.review.application.dto.response; | ||
|
|
||
| import lombok.Builder; | ||
|
|
||
| @Builder | ||
| public record ReviewCreateResult( | ||
| boolean isFirstReviewOfPlace, | ||
| int userReviewCountOfPlace | ||
| // int NumberOfUserStamp, | ||
| ) { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package com.campus.campus.domain.review.application.dto.response; | ||
|
|
||
| public record ReviewRankingResponse( | ||
| RankingScope major, | ||
| RankingScope college, | ||
| RankingScope school | ||
| ) { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package com.campus.campus.domain.review.application.dto.response; | ||
|
|
||
| import java.time.LocalDate; | ||
| import java.util.List; | ||
|
|
||
| import lombok.Builder; | ||
|
|
||
| @Builder | ||
| public record ReviewResponse( | ||
| Long id, | ||
| Long userId, | ||
| String userName, | ||
| LocalDate createDate, | ||
| Long placeId, | ||
| String content, | ||
| Double star, | ||
| List<String> imageUrls | ||
| ) { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package com.campus.campus.domain.review.application.dto.response; | ||
|
|
||
| import java.time.LocalDate; | ||
|
|
||
| import lombok.Builder; | ||
|
|
||
| @Builder | ||
| public record WriteReviewResponse( | ||
| Long id, | ||
| Long userId, | ||
| String userName, | ||
| LocalDate createDate, | ||
| Long placeId, | ||
| String content, | ||
| Double star, | ||
| String imageUrl | ||
| ) { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package com.campus.campus.domain.review.application.exception; | ||
|
|
||
| import org.springframework.http.HttpStatus; | ||
|
|
||
| import com.campus.campus.global.common.exception.ErrorCodeInterface; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| @AllArgsConstructor | ||
| public enum ErrorCode implements ErrorCodeInterface { | ||
|
|
||
| REVIEW_NOT_FOUND(2800, HttpStatus.NOT_FOUND, "리뷰를 찾을 수 없습니다."), | ||
| NOT_REVIEW_WRITER(2801, HttpStatus.FORBIDDEN, "작성자만 해당 작업을 수행할 수 있습니다."); | ||
|
|
||
| private final int code; | ||
| private final HttpStatus status; | ||
| private final String message; | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.campus.campus.domain.review.application.exception; | ||
|
|
||
| import com.campus.campus.global.common.exception.ApplicationException; | ||
|
|
||
| public class NotUserWriterException extends ApplicationException { | ||
| public NotUserWriterException() { | ||
| super(ErrorCode.NOT_REVIEW_WRITER); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.campus.campus.domain.review.application.exception; | ||
|
|
||
| import com.campus.campus.global.common.exception.ApplicationException; | ||
|
|
||
| public class ReviewNotFoundException extends ApplicationException { | ||
| public ReviewNotFoundException() { | ||
| super(ErrorCode.REVIEW_NOT_FOUND); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
카테고리 필터 누락 가능성 확인 필요
이 쿼리는
PARTNERSHIP카테고리로 필터링하지 않아EVENT게시물도 포함될 수 있습니다.findRandomActivePartnerships등 유사한 메서드들은p.category = :category조건을 사용합니다. 의도된 동작인지 확인해 주세요.🐛 카테고리 필터 추가 제안
WHERE scp.startDateTime <= :now AND scp.endDateTime >= :now + AND scp.category = com.campus.campus.domain.councilpost.domain.entity.PostCategory.PARTNERSHIP AND ( (sc.councilType = com.campus.campus.domain.council.domain.entity.CouncilType.MAJOR_COUNCIL🤖 Prompt for AI Agents