Created
July 18, 2020 07:59
-
-
Save jeyraof/99808bdb3538a40f7a9d1b92e58b313e to your computer and use it in GitHub Desktop.
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
enum class Provider(val service: String) { | |
KAKAO("kakao"), | |
APPLE("apple") | |
} | |
@RestController | |
class TestController { | |
@PostMapping("/test") | |
fun testFunc( | |
@RequestParam provider: Provider, | |
@RequestParam(required = false) oauth_access_token: String?, | |
@RequestParam(required = false) authorization_code: String? | |
) { | |
val isSupportService: Boolean = when (provider) { | |
KAKAO -> oauth_access_token != null | |
APPLE -> authorization_code != null | |
} | |
if (!isSupportService) throw NotSupportedException() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
정도로 타협..