Skip to content

Commit

Permalink
[feat #157] 버전 체크 api (#158)
Browse files Browse the repository at this point in the history
* feat : 버전 체크 api

* feat : 버전 체크 api security filter 제외 적용
  • Loading branch information
dlswns2480 authored Sep 10, 2024
1 parent a3b4974 commit 118c9fe
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class SecurityConfig(
"/api-docs/**",
"/v3/api-docs/**",
"/actuator/prometheus",
"/api/v1/version"
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class CustomAuthenticationFilter(
"/api-docs/**",
"/v3/api-docs/**",
"/actuator/prometheus",
"/api/v1/version"
)
val path = request.requestURI
val shouldNotFilter =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.pokit.version

import com.pokit.version.dto.VersionCheckResponse
import io.swagger.v3.oas.annotations.Operation
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/api/v1/version")
class VersionController {

companion object {
private const val RECENT_VERSION = "1.0.1"
}

@GetMapping
@Operation(summary = "최신 버전 체크 api")
fun checkVersion() = ResponseEntity.ok(VersionCheckResponse(RECENT_VERSION))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.pokit.version.dto

data class VersionCheckResponse(
val recentVersion: String
)

0 comments on commit 118c9fe

Please sign in to comment.