This repository has been archived by the owner on May 19, 2024. It is now read-only.
-
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.
- Loading branch information
1 parent
aa5789c
commit b49a51d
Showing
4 changed files
with
45 additions
and
10 deletions.
There are no files selected for viewing
16 changes: 11 additions & 5 deletions
16
bootstrap/http/src/main/kotlin/com/studentcenter/weave/bootstrap/adapter/api/AuthApi.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,30 +1,36 @@ | ||
package com.studentcenter.weave.bootstrap.adapter.api | ||
|
||
import com.studentcenter.weave.bootstrap.adapter.dto.RefreshLoginTokenResponse | ||
import com.studentcenter.weave.bootstrap.adapter.dto.RefreshTokenRequest | ||
import com.studentcenter.weave.bootstrap.adapter.dto.SocialLoginRequest | ||
import com.studentcenter.weave.bootstrap.adapter.dto.SocialLoginResponse | ||
import com.studentcenter.weave.domain.enum.SocialLoginProvider | ||
import io.swagger.v3.oas.annotations.Operation | ||
import io.swagger.v3.oas.annotations.tags.Tag | ||
import org.springframework.http.HttpStatus | ||
import org.springframework.web.bind.annotation.* | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import org.springframework.web.bind.annotation.PostMapping | ||
import org.springframework.web.bind.annotation.RequestBody | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
import org.springframework.web.bind.annotation.ResponseStatus | ||
|
||
@Tag(name = "Auth", description = "Auth API") | ||
@RequestMapping("/api/auth", produces = ["application/json;charset=utf-8"]) | ||
interface AuthApi { | ||
|
||
@Operation(summary = "Social Login") | ||
@GetMapping("/login/oauth2/code/{provider}") | ||
@PostMapping("/login/{provider}") | ||
@ResponseStatus(HttpStatus.OK) | ||
fun socialLogin( | ||
@PathVariable provider: SocialLoginProvider, | ||
@RequestParam code: String | ||
@RequestBody request: SocialLoginRequest, | ||
): SocialLoginResponse | ||
|
||
@Operation(summary = "Refresh Login Token") | ||
@GetMapping("/login/refresh") | ||
@PostMapping("/refresh") | ||
@ResponseStatus(HttpStatus.OK) | ||
fun refreshLoginToken( | ||
@RequestParam refreshToken: String | ||
@RequestBody request: RefreshTokenRequest, | ||
): RefreshLoginTokenResponse | ||
|
||
} |
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
12 changes: 12 additions & 0 deletions
12
...http/src/main/kotlin/com/studentcenter/weave/bootstrap/adapter/dto/RefreshTokenRequest.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.studentcenter.weave.bootstrap.adapter.dto | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
@Schema( | ||
name = "Refresh Token Request", | ||
description = "Refresh Token 요청" | ||
) | ||
data class RefreshTokenRequest( | ||
@Schema(description = "Refresh Token") | ||
val refreshToken: String, | ||
) |
12 changes: 12 additions & 0 deletions
12
.../http/src/main/kotlin/com/studentcenter/weave/bootstrap/adapter/dto/SocialLoginRequest.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.studentcenter.weave.bootstrap.adapter.dto | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema | ||
|
||
@Schema( | ||
name = "Social Login Request", | ||
description = "소셜 로그인 요청" | ||
) | ||
data class SocialLoginRequest( | ||
@Schema(description = "OpenId Connect Id Token") | ||
val idToken: String, | ||
) |