-
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.
* fix: local profile에서 loki 비활성화 (#136) * [BSVR-194] 리뷰 등록 어드민 API + 관련 작업들 (#137) * feat: controller 추가 * feat: 어드민 리뷰 등록 서비스 코드 추가 * feat: 어드민 리뷰 생성 로직 수정 * fix: member, blockRow에서 발생하는 N+1 수정 * refactor: image, keyword 처리 로직을 클래스로 분리 * refactor: 클래스명 컨벤션에 맞게 level usecase 수정 * perf: value별 레벨 조회에 캐시 적용 * feat: content NotBlank 처리
- Loading branch information
Showing
30 changed files
with
364 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
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
49 changes: 49 additions & 0 deletions
49
...main/java/org/depromeet/spot/application/review/dto/request/CreateAdminReviewRequest.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,49 @@ | ||
package org.depromeet.spot.application.review.dto.request; | ||
|
||
import java.time.LocalDateTime; | ||
import java.time.format.DateTimeFormatter; | ||
import java.time.format.DateTimeParseException; | ||
import java.util.List; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
|
||
import org.depromeet.spot.common.exception.review.ReviewException.InvalidReviewDateTimeFormatException; | ||
import org.depromeet.spot.common.exception.review.ReviewException.InvalidReviewKeywordsException; | ||
import org.depromeet.spot.usecase.port.in.review.CreateReviewUsecase.CreateAdminReviewCommand; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
public record CreateAdminReviewRequest( | ||
Integer seatNumber, | ||
List<String> good, | ||
List<String> bad, | ||
@NotBlank String content, | ||
@NotNull String dateTime) { | ||
|
||
public CreateAdminReviewCommand toCommand(List<MultipartFile> images) { | ||
checkHasKeyword(); | ||
return CreateAdminReviewCommand.builder() | ||
.bad(bad) | ||
.good(good) | ||
.images(images) | ||
.content(content) | ||
.seatNumber(seatNumber) | ||
.dateTime(toLocalDateTime(dateTime)) | ||
.build(); | ||
} | ||
|
||
private void checkHasKeyword() { | ||
if ((this.good == null || good.isEmpty()) && (bad == null || bad.isEmpty())) { | ||
throw new InvalidReviewKeywordsException(); | ||
} | ||
} | ||
|
||
private LocalDateTime toLocalDateTime(String dateTimeStr) { | ||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); | ||
try { | ||
return LocalDateTime.parse(dateTimeStr, formatter); | ||
} catch (DateTimeParseException e) { | ||
throw new InvalidReviewDateTimeFormatException(); | ||
} | ||
} | ||
} |
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
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
11 changes: 0 additions & 11 deletions
11
usecase/src/main/java/org/depromeet/spot/usecase/port/in/member/LevelUsecase.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
usecase/src/main/java/org/depromeet/spot/usecase/port/in/member/ReadLevelUsecase.java
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
usecase/src/main/java/org/depromeet/spot/usecase/port/in/member/level/ReadLevelUsecase.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 org.depromeet.spot.usecase.port.in.member.level; | ||
|
||
import java.util.List; | ||
|
||
import org.depromeet.spot.domain.member.Level; | ||
|
||
public interface ReadLevelUsecase { | ||
|
||
Level findInitialLevel(); | ||
|
||
Level findByValue(int value); | ||
|
||
List<Level> findAllLevels(); | ||
|
||
Level findLevelUpDialogInfo(int nextLevel); | ||
} |
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
Oops, something went wrong.