-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262 from sopt-makers/feat/#261_T-10856
#261_T-10856 [feat] /token API 구현
- Loading branch information
Showing
14 changed files
with
515 additions
and
95 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
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
21 changes: 21 additions & 0 deletions
21
...tion-api/src/main/java/org/sopt/makers/operation/auth/dto/request/AccessTokenRequest.java
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,21 @@ | ||
package org.sopt.makers.operation.auth.dto.request; | ||
|
||
public record AccessTokenRequest( | ||
String grantType, | ||
String clientId, | ||
String redirectUri, | ||
String code, | ||
String refreshToken | ||
) { | ||
public boolean isNullGrantType() { | ||
return grantType == null; | ||
} | ||
|
||
public boolean isNullCode() { | ||
return code == null; | ||
} | ||
|
||
public boolean isNullRefreshToken() { | ||
return refreshToken == null; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
operation-api/src/main/java/org/sopt/makers/operation/auth/dto/response/TokenResponse.java
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,9 @@ | ||
package org.sopt.makers.operation.auth.dto.response; | ||
|
||
public record TokenResponse(String tokenType, String accessToken, String refreshToken) { | ||
private static final String BEARER_TOKEN_TYPE = "Bearer"; | ||
|
||
public static TokenResponse of(String accessToken, String refreshToken) { | ||
return new TokenResponse(BEARER_TOKEN_TYPE, accessToken, refreshToken); | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
...on-api/src/main/java/org/sopt/makers/operation/common/config/ConcurrentHashMapConfig.java
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,14 @@ | ||
package org.sopt.makers.operation.common.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
@Configuration | ||
public class ConcurrentHashMapConfig { | ||
@Bean | ||
public ConcurrentHashMap<String, String> registerConcurrentHashMap() { | ||
return new ConcurrentHashMap<>(); | ||
} | ||
} |
Oops, something went wrong.