feat: 일반 유저용 캔 리스트 조회 API 추가, GeoCountryFilter(GeoCountry.OTHER, GeoCountry.KR 구분용) 추가

This commit is contained in:
2025-10-01 22:29:39 +09:00
parent 3d852a8356
commit e45fe1bf10
5 changed files with 63 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
package kr.co.vividnext.sodalive.can
import kr.co.vividnext.sodalive.common.ApiResponse
import kr.co.vividnext.sodalive.common.GeoCountry
import kr.co.vividnext.sodalive.common.SodaException
import kr.co.vividnext.sodalive.member.Member
import org.springframework.data.domain.Pageable
@@ -9,13 +10,16 @@ import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController
import javax.servlet.http.HttpServletRequest
@RestController
@RequestMapping("/can")
class CanController(private val service: CanService) {
@GetMapping
fun getCans(): ApiResponse<List<CanResponse>> {
return ApiResponse.ok(service.getCans())
fun getCans(request: HttpServletRequest): ApiResponse<List<CanResponse>> {
val geoCountry = request.getAttribute("geoCountry") as? GeoCountry ?: GeoCountry.OTHER
println("geoCountry: $geoCountry")
return ApiResponse.ok(service.getCans(geoCountry))
}
@GetMapping("/status")