Skip to content

Commit

Permalink
feat: 관심사 목록 조회 api (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimin3263 authored Aug 5, 2024
1 parent 7adaad0 commit a59f8ad
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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/**",
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/**",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -59,4 +61,11 @@ class UserController(
.toResponse()
.wrapOk()
}

@GetMapping("/interests")
@Operation(summary = "관심사 목록 조회 API")
fun getInterests(): ResponseEntity<List<InterestTypeResponse>> =
InterestType.values()
.map { InterestTypeResponse(it.name, it.kor) }
.wrapOk()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.pokit.user.dto.response

data class InterestTypeResponse(
val code: String,
val description: String
)
7 changes: 4 additions & 3 deletions domain/src/main/kotlin/com/pokit/user/model/InterestType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a59f8ad

Please sign in to comment.