-
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.
#46 - Feat: OpenBankingAccessToken 엔티티 설계, 오픈뱅킹 토큰 발급 후 저장
- Loading branch information
Showing
4 changed files
with
88 additions
and
9 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
26 changes: 26 additions & 0 deletions
26
...oks/src/main/java/com/example/mutbooks/app/openBanking/entity/OpenBankingAccessToken.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,26 @@ | ||
package com.example.mutbooks.app.openBanking.entity; | ||
|
||
import com.example.mutbooks.app.base.entity.BaseEntity; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import java.time.LocalDateTime; | ||
|
||
@Entity | ||
@Getter | ||
@Setter | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
public class OpenBankingAccessToken extends BaseEntity { | ||
@Column(nullable = false, length = 400) // 디폴트 길이는 255인데 토큰은 최대 400자이므로 꼭 설정해야함 | ||
private String accessToken; // 오픈뱅킹에서 발행된 Access Token | ||
private String tokenType; // Access Token 유형(고정값: Bearer) | ||
private String expiresIn; // Access Token 만료 기간(초) | ||
private LocalDateTime expireAt; // Access Token 만료일시 | ||
private String scope; // Access Token 권한 범위(고정값: oob) | ||
private String clientUseCode; // 이용기관코드 | ||
} |
12 changes: 12 additions & 0 deletions
12
.../src/main/java/com/example/mutbooks/app/openBanking/repository/OpenBankingRepository.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,12 @@ | ||
package com.example.mutbooks.app.openBanking.repository; | ||
|
||
import com.example.mutbooks.app.openBanking.entity.OpenBankingAccessToken; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.Optional; | ||
|
||
public interface OpenBankingRepository extends JpaRepository<OpenBankingAccessToken, Long> { | ||
// 만료기한이 현재일시 이후인 accessToken 1개 조회 | ||
Optional<OpenBankingAccessToken> findFirstByExpireAtAfter(LocalDateTime dateTime); | ||
} |
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