-
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.
* refactor: LogData 및 Log 필드 타입 변경 - apiKey에 대한 필드 타입을 UUID에서 byte[]로 변경했습니다. - 이에 따라 Log 필드 타입도 String에서 UUID로 변경했습니다. * feat: UUID to byte[], byte[] to UUID 로직 추가 - UUID Convertor에 위 두개 로직을 추가했습니다. - 이에 따른 테스트를 추가했습니다. * refactor: findLogsByAppKey 메서드 로직 수정 - DB 엔티티 필드 타입 변경을 지원하기 위해 UUID to Byte[] 로직을 추가했습니다. - 이에 따른 테스트를 수정했습니다. * refactor: ResponseEntity Wrap 제거 - ResponseEntity로 감싸는 형태를 제거했습니다. * feat: CursorPaginationResult 구현 - CursorPaginationResult 구현 * feat: body로 처리하기 위한 LogCursorRequest 구현 - LogCursorRequest 구현
- Loading branch information
Showing
12 changed files
with
160 additions
and
24 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
logbat_view/src/main/java/info/logbat_view/common/payload/CursorPaginationResult.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,29 @@ | ||
package info.logbat_view.common.payload; | ||
|
||
import info.logbat_view.domain.log.presentation.payload.response.LogCommonResponse; | ||
import java.util.List; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class CursorPaginationResult { | ||
|
||
private final List<LogCommonResponse> data; | ||
private final Integer size; | ||
private final Long nextCursor; | ||
private final Boolean hasNext; | ||
|
||
private CursorPaginationResult(List<LogCommonResponse> data, Integer size, Long nextCursor, | ||
Boolean hasNext) { | ||
this.data = data; | ||
this.size = size; | ||
this.nextCursor = nextCursor; | ||
this.hasNext = hasNext; | ||
} | ||
|
||
public static CursorPaginationResult of(List<LogCommonResponse> data, int size) { | ||
boolean hasNext = data.size() > size; | ||
List<LogCommonResponse> subList = hasNext ? data.subList(0, size) : data; | ||
Long nextCursor = subList.get(subList.size() - 1).id(); | ||
return new CursorPaginationResult(subList, subList.size(), nextCursor, hasNext); | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
.../main/java/info/logbat_view/domain/log/presentation/payload/request/LogCursorRequest.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,14 @@ | ||
package info.logbat_view.domain.log.presentation.payload.request; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public record LogCursorRequest(Long cursor, Integer size) { | ||
|
||
@JsonCreator | ||
public LogCursorRequest(@JsonProperty("cursor") Long cursor, | ||
@JsonProperty("size") Integer size) { | ||
this.cursor = cursor == null ? -1 : cursor; | ||
this.size = size == null ? 10 : size; | ||
} | ||
} |
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