-
Notifications
You must be signed in to change notification settings - Fork 1
[LNK-67] global common 코틀린 마이그레이션 #86
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
The head ref may contain hidden characters: "refactor/LNK-67-Leenk-global-common-\uCF54\uD2C0\uB9B0-\uB9C8\uC774\uADF8\uB808\uC774\uC158"
Changes from 11 commits
11a4468
03f29f2
5808d2a
6dee780
1f03a72
ba619ba
5dcf1bc
72427bb
21c328f
7c31ce9
5699430
023da48
1c9186f
765b01c
dacd658
c0aa312
14eea48
127aaf4
cdcf2f3
f5ff38d
d7614be
064ce29
e376b90
d1b9f70
78f273e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package leets.leenk.global.common.controller | ||
|
|
||
| import io.swagger.v3.oas.annotations.Hidden | ||
| import org.springframework.http.ResponseEntity | ||
| import org.springframework.web.bind.annotation.GetMapping | ||
| import org.springframework.web.bind.annotation.RestController | ||
|
|
||
| @Hidden | ||
| @RestController | ||
| class StatusCheckController { | ||
| @GetMapping("/health-check") | ||
| fun checkHealthStatus(): ResponseEntity<String> = ResponseEntity.ok<String>("OK") | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package leets.leenk.global.common.dto | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude | ||
| import io.swagger.v3.oas.annotations.media.Schema | ||
|
|
||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| data class CommonPageableResponse( | ||
| @field:Schema(description = "페이지 번호 (0부터 시작)", example = "0") | ||
| val pageNumber: Int, | ||
| @field:Schema(description = "페이지 크기", example = "10") | ||
| val pageSize: Int, | ||
| @field:Schema(description = "현재 페이지의 요소 개수", example = "10") | ||
| val numberOfElements: Int, | ||
| @field:Schema(description = "다음 페이지 존재 여부", example = "true") | ||
| val hasNext: Boolean, | ||
| @field:Schema(description = "현재 페이지의 요소가 비어 있는지의 여부", example = "false") | ||
| val empty: Boolean, | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package leets.leenk.global.common.dto | ||
|
|
||
| import org.springframework.data.domain.Page | ||
| import org.springframework.data.domain.Slice | ||
|
|
||
| object PageableMapperUtil { | ||
| @JvmStatic | ||
| fun from(slice: Slice<*>): CommonPageableResponse = | ||
| CommonPageableResponse( | ||
| pageNumber = slice.number, | ||
| pageSize = slice.size, | ||
| numberOfElements = slice.numberOfElements, | ||
| hasNext = slice.hasNext(), | ||
| empty = slice.isEmpty, | ||
| ) | ||
|
|
||
| @JvmStatic | ||
| fun from(page: Page<*>): CommonPageableResponse = | ||
| CommonPageableResponse( | ||
| pageNumber = page.number, | ||
| pageSize = page.size, | ||
| numberOfElements = page.numberOfElements, | ||
| hasNext = page.hasNext(), | ||
| empty = page.isEmpty, | ||
| ) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package leets.leenk.global.common.exception | ||
|
|
||
| abstract class BaseException | ||
| @JvmOverloads | ||
| constructor( | ||
| val errorCode: ErrorCodeInterface, | ||
| message: String? = null, | ||
| ) : RuntimeException(message ?: errorCode.message) |
Uh oh!
There was an error while loading. Please reload this page.