From a59f8ad14d1545dd9306779dd16fcdbc16e8190b Mon Sep 17 00:00:00 2001 From: Jimin Lim <50178026+jimin3263@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:10:15 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B4=80=EC=8B=AC=EC=82=AC=20=EB=AA=A9?= =?UTF-8?q?=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20api=20(#69)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/kotlin/com/pokit/auth/config/SecurityConfig.kt | 3 ++- .../com/pokit/auth/filter/CustomAuthenticationFilter.kt | 1 + .../src/main/kotlin/com/pokit/user/UserController.kt | 9 +++++++++ .../com/pokit/user/dto/response/InterestTypeResponse.kt | 6 ++++++ .../src/main/kotlin/com/pokit/user/model/InterestType.kt | 7 ++++--- 5 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 adapters/in-web/src/main/kotlin/com/pokit/user/dto/response/InterestTypeResponse.kt diff --git a/adapters/in-web/src/main/kotlin/com/pokit/auth/config/SecurityConfig.kt b/adapters/in-web/src/main/kotlin/com/pokit/auth/config/SecurityConfig.kt index 007fa323..84736ebc 100644 --- a/adapters/in-web/src/main/kotlin/com/pokit/auth/config/SecurityConfig.kt +++ b/adapters/in-web/src/main/kotlin/com/pokit/auth/config/SecurityConfig.kt @@ -19,13 +19,14 @@ class SecurityConfig( companion object { private val WHITE_LIST = arrayOf( "/api/v1/auth/signin", + "/api/v1/user/interests", "/swagger-ui/index.html#/", "/swagger", "/swagger-ui.html", "/swagger-ui/**", "/api-docs", "/api-docs/**", - "/v3/api-docs/**" + "/v3/api-docs/**", ) } diff --git a/adapters/in-web/src/main/kotlin/com/pokit/auth/filter/CustomAuthenticationFilter.kt b/adapters/in-web/src/main/kotlin/com/pokit/auth/filter/CustomAuthenticationFilter.kt index 7b020e69..6c4e66b1 100644 --- a/adapters/in-web/src/main/kotlin/com/pokit/auth/filter/CustomAuthenticationFilter.kt +++ b/adapters/in-web/src/main/kotlin/com/pokit/auth/filter/CustomAuthenticationFilter.kt @@ -28,6 +28,7 @@ class CustomAuthenticationFilter( override fun shouldNotFilter(request: HttpServletRequest): Boolean { val excludePath = arrayOf( "/api/v1/auth/signin", + "/api/v1/user/interests", "/swagger-ui/index.html#/", "/swagger", "/swagger-ui.html", "/swagger-ui/**", diff --git a/adapters/in-web/src/main/kotlin/com/pokit/user/UserController.kt b/adapters/in-web/src/main/kotlin/com/pokit/user/UserController.kt index 974aea16..266771cc 100644 --- a/adapters/in-web/src/main/kotlin/com/pokit/user/UserController.kt +++ b/adapters/in-web/src/main/kotlin/com/pokit/user/UserController.kt @@ -8,9 +8,11 @@ import com.pokit.user.dto.request.ApiSignUpRequest import com.pokit.user.dto.request.ApiUpdateNicknameRequest import com.pokit.user.dto.request.toDto import com.pokit.user.dto.response.CheckDuplicateNicknameResponse +import com.pokit.user.dto.response.InterestTypeResponse import com.pokit.user.dto.response.UserResponse import com.pokit.user.dto.response.toResponse import com.pokit.user.exception.UserErrorCode +import com.pokit.user.model.InterestType import com.pokit.user.port.`in`.UserUseCase import io.swagger.v3.oas.annotations.Operation import jakarta.validation.Valid @@ -59,4 +61,11 @@ class UserController( .toResponse() .wrapOk() } + + @GetMapping("/interests") + @Operation(summary = "관심사 목록 조회 API") + fun getInterests(): ResponseEntity> = + InterestType.values() + .map { InterestTypeResponse(it.name, it.kor) } + .wrapOk() } diff --git a/adapters/in-web/src/main/kotlin/com/pokit/user/dto/response/InterestTypeResponse.kt b/adapters/in-web/src/main/kotlin/com/pokit/user/dto/response/InterestTypeResponse.kt new file mode 100644 index 00000000..7a3473ea --- /dev/null +++ b/adapters/in-web/src/main/kotlin/com/pokit/user/dto/response/InterestTypeResponse.kt @@ -0,0 +1,6 @@ +package com.pokit.user.dto.response + +data class InterestTypeResponse( + val code: String, + val description: String +) diff --git a/domain/src/main/kotlin/com/pokit/user/model/InterestType.kt b/domain/src/main/kotlin/com/pokit/user/model/InterestType.kt index dc83ffdc..f6eb2775 100644 --- a/domain/src/main/kotlin/com/pokit/user/model/InterestType.kt +++ b/domain/src/main/kotlin/com/pokit/user/model/InterestType.kt @@ -10,16 +10,17 @@ enum class InterestType( OFFICE("문구/오피스"), FASHION("패션"), TRAVEL("여행"), - ECONOMIY("경제/시사"), + ECONOMY("경제/시사"), MOVIE_DRAMA("영화/드라마"), RESTAURANT("맛집"), INTERIOR("인테리어"), IT("IT"), DESIGN("디자인"), - SELF_DEVELOPMENT("자기계발"), + SELF_IMPROVEMENT("자기계발"), HUMOR("유머"), MUSIC("음악"), - EMPLOYMENT_INFORMATION("취업정보"); + JOB_INFO("취업정보") + ; companion object { fun of(input: String): InterestType {