-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
imp: add dev resource and refac authResource
- Loading branch information
1 parent
4c6e9f1
commit 2485189
Showing
5 changed files
with
34 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,3 +63,7 @@ class SpringDocConfig( | |
) | ||
} | ||
} | ||
|
||
object SwaggerTag { | ||
const val DEV_TAG = "Dev Resource, 테스트용 API" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 8 additions & 7 deletions
15
...nlab/domain/user/resource/UserResource.kt → ...b/domain/user/resource/DevUserResource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
package com.hero.alignlab.domain.user.resource | ||
|
||
import com.hero.alignlab.domain.auth.model.AuthUser | ||
import com.hero.alignlab.config.swagger.SwaggerTag.DEV_TAG | ||
import com.hero.alignlab.domain.user.application.UserService | ||
import com.hero.alignlab.extension.wrapOk | ||
import io.swagger.v3.oas.annotations.Operation | ||
import io.swagger.v3.oas.annotations.tags.Tag | ||
import org.springframework.http.MediaType | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
import org.springframework.web.bind.annotation.RestController | ||
|
||
@Tag(name = "사용자 관리") | ||
@Tag(name = DEV_TAG) | ||
@RestController | ||
@RequestMapping(produces = [MediaType.APPLICATION_JSON_VALUE]) | ||
class UserResource( | ||
class DevUserResource( | ||
private val userService: UserService, | ||
) { | ||
@Operation(summary = "토큰 기반으로 유저 정보를 조회") | ||
@GetMapping("/api/v1/users/me") | ||
@Operation(summary = "유저 정보 조회") | ||
@GetMapping("/api/dev/v1/users/{id}") | ||
suspend fun getUserInfo( | ||
user: AuthUser | ||
) = userService.getUserInfo(user).wrapOk() | ||
@PathVariable id: Long, | ||
) = userService.getUserInfo(id).wrapOk() | ||
} |