-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: 반환 날짜 형식 변경 * feat: 검색 정렬 옵션 추가 * fix: String 필드 Enum으로 변경 * style: 코드 포멧팅 * chore: 미사용 import 삭제 * style: 코드 포멧팅 * chore: 코드 블럭 처리 * chore: historys -> histories으로 변경 * chore: 정적 메소드 네이밍 변경 * style: 코드 개행 * style: 코드 개행 * fix: 로깅 어노테이션으로 변경 * Revert "fix: 로깅 어노테이션으로 변경" This reverts commit 7c1ecb2. * chore: 리뷰 반영 * style: 코드 포멧팅
- Loading branch information
1 parent
14d9d8e
commit 885875d
Showing
9 changed files
with
102 additions
and
63 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
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
34 changes: 26 additions & 8 deletions
34
...n/history/dto/AdminHistorysCondition.java → .../history/dto/AdminHistoriesCondition.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,38 +1,56 @@ | ||
package in.koreatech.koin.admin.history.dto; | ||
|
||
import static com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy; | ||
import static in.koreatech.koin.global.model.Criteria.*; | ||
import static in.koreatech.koin.global.model.Criteria.Sort.CREATED_AT_ASC; | ||
import static in.koreatech.koin.global.model.Criteria.Sort.CREATED_AT_DESC; | ||
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.NOT_REQUIRED; | ||
import static org.springframework.data.domain.Sort.Direction; | ||
|
||
import java.util.Objects; | ||
|
||
import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
|
||
import in.koreatech.koin.global.model.Criteria; | ||
import in.koreatech.koin.admin.history.enums.DomainType; | ||
import in.koreatech.koin.admin.history.enums.HttpMethodType; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@JsonNaming(value = SnakeCaseStrategy.class) | ||
public record AdminHistorysCondition( | ||
public record AdminHistoriesCondition( | ||
@Schema(description = "페이지", example = "1", defaultValue = "1", requiredMode = NOT_REQUIRED) | ||
Integer page, | ||
|
||
@Schema(description = "페이지당 조회할 최대 개수", example = "10", defaultValue = "10", requiredMode = NOT_REQUIRED) | ||
Integer limit, | ||
|
||
@Schema(description = "HTTP 메소드", example = "POST", requiredMode = NOT_REQUIRED) | ||
String requestMethod, | ||
HttpMethodType requestMethod, | ||
|
||
@Schema(description = "도메인 이름", example = "NOTICE", requiredMode = NOT_REQUIRED) | ||
String domainName, | ||
DomainType domainName, | ||
|
||
@Schema(description = "특정 엔티티 id", requiredMode = NOT_REQUIRED) | ||
Integer domainId | ||
Integer domainId, | ||
|
||
@Schema(description = "정렬 기준", requiredMode = NOT_REQUIRED) | ||
Sort sort | ||
) { | ||
public AdminHistorysCondition { | ||
public AdminHistoriesCondition { | ||
if (Objects.isNull(page)) { | ||
page = Criteria.DEFAULT_PAGE; | ||
page = DEFAULT_PAGE; | ||
} | ||
if (Objects.isNull(limit)) { | ||
limit = Criteria.DEFAULT_LIMIT; | ||
limit = DEFAULT_LIMIT; | ||
} | ||
if (Objects.isNull(sort)) { | ||
sort = CREATED_AT_DESC; | ||
} | ||
} | ||
|
||
public Direction getSortDir() { | ||
if (sort == CREATED_AT_ASC) { | ||
return Direction.ASC; | ||
} | ||
return Direction.DESC; | ||
} | ||
} |
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.