-
Notifications
You must be signed in to change notification settings - Fork 0
version 2.17.0 #345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
version 2.17.0 #345
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
0584b9f
[Fix] 부동산학과 공지 조회 hostPrefix 호환 (#332)
jiyun921 f6ed4da
Fix : Github Actions Docker Engine 29.x 업데이트 대응 (testcontainers 2.0.2…
rlagkswn00 adb0778
Fix : 공지사항 알림 전송 시 ID 추가 간 NPE 발생 문제 수정 (#341)
rlagkswn00 8c2e5d6
Feat: Storage 업로드, Presigned 조회, 삭제 기능 구현 (#339)
rlagkswn00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
18 changes: 18 additions & 0 deletions
18
src/main/java/com/kustacks/kuring/common/exception/InfrastructureException.java
This file contains hidden or 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,18 @@ | ||
| package com.kustacks.kuring.common.exception; | ||
|
|
||
| import com.kustacks.kuring.common.exception.code.ErrorCode; | ||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| public class InfrastructureException extends RuntimeException { | ||
| private final ErrorCode errorCode; | ||
|
|
||
| public InfrastructureException(ErrorCode errorCode) { | ||
| this.errorCode = errorCode; | ||
| } | ||
|
|
||
| public InfrastructureException(ErrorCode errorCode, Exception e) { | ||
| super(e); | ||
| this.errorCode = errorCode; | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
src/main/java/com/kustacks/kuring/common/properties/CloudStorageProperties.java
This file contains hidden or 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 com.kustacks.kuring.common.properties; | ||
|
|
||
| import jakarta.validation.constraints.*; | ||
| import org.springframework.boot.context.properties.ConfigurationProperties; | ||
| import org.springframework.validation.annotation.Validated; | ||
|
|
||
| @Validated | ||
| @ConfigurationProperties(prefix = "cloud.storage") | ||
| public record CloudStorageProperties( | ||
| @NotBlank String region, | ||
| String endpoint, // OCI인 경우에만 사용. | ||
| @NotBlank String bucket, | ||
| @NotNull Credentials credentials | ||
| ) { | ||
| public record Credentials( | ||
| @NotBlank String accessKey, | ||
| @NotBlank String secretKey | ||
| ) { | ||
|
|
||
| } | ||
| } |
81 changes: 81 additions & 0 deletions
81
src/main/java/com/kustacks/kuring/config/CloudStorageConfig.java
This file contains hidden or 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,81 @@ | ||
| package com.kustacks.kuring.config; | ||
|
|
||
| import com.kustacks.kuring.common.properties.CloudStorageProperties; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.context.annotation.Profile; | ||
| import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; | ||
| import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; | ||
| import software.amazon.awssdk.regions.Region; | ||
| import software.amazon.awssdk.services.s3.S3Client; | ||
| import software.amazon.awssdk.services.s3.S3ClientBuilder; | ||
| import software.amazon.awssdk.services.s3.S3Configuration; | ||
| import software.amazon.awssdk.services.s3.presigner.S3Presigner; | ||
|
|
||
| import java.net.URI; | ||
|
|
||
| /** | ||
| * Local, Test환경 에서는 사용하지 않는다. | ||
| * Prod, Dev환경에서 사용한다. | ||
| * Prod : AWS S3 서비스 이용 | ||
| * Dev : OCI Storage 서비스 이용. | ||
| * 서비스 사용은 S3기술로 호환가능. Presigned 기술도 V4지원. | ||
| */ | ||
| @Configuration | ||
| @RequiredArgsConstructor | ||
| public class CloudStorageConfig { | ||
|
|
||
| private final CloudStorageProperties properties; | ||
|
|
||
| @Bean | ||
| @Profile("prod") | ||
| public S3Client awsS3Client() { | ||
| return defaultS3ClientBuilder() | ||
| .build(); | ||
| } | ||
|
|
||
| @Bean | ||
| @Profile("prod") | ||
| public S3Presigner awsS3Presigner() { | ||
| return defaultS3PresignerBuilder() | ||
| .build(); | ||
| } | ||
|
|
||
| @Bean | ||
| @Profile("dev") | ||
| public S3Client oracleStorageClient() { | ||
| return defaultS3ClientBuilder() | ||
| .endpointOverride(URI.create(properties.endpoint())) //OCI는 엔드포인트를 강제 지정한다. | ||
| .forcePathStyle(true) // 강제로 PathStyle 지정. | ||
| .build(); | ||
| } | ||
rlagkswn00 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| @Bean | ||
| @Profile("dev") | ||
| public S3Presigner oracleS3Presigner() { | ||
| return defaultS3PresignerBuilder() | ||
| .endpointOverride(URI.create(properties.endpoint())) | ||
| .serviceConfiguration(S3Configuration.builder() | ||
| .pathStyleAccessEnabled(true) | ||
| .build()) | ||
| .build(); | ||
| } | ||
|
|
||
| private S3ClientBuilder defaultS3ClientBuilder() { | ||
| return S3Client.builder() | ||
| .region(Region.of(properties.region())) | ||
| .credentialsProvider(staticCredentialsProvider()); | ||
| } | ||
|
|
||
| private S3Presigner.Builder defaultS3PresignerBuilder() { | ||
| return S3Presigner.builder() | ||
| .region(Region.of(properties.region())) | ||
| .credentialsProvider(staticCredentialsProvider()); | ||
| } | ||
|
|
||
| private StaticCredentialsProvider staticCredentialsProvider() { | ||
| return StaticCredentialsProvider | ||
| .create(AwsBasicCredentials.create(properties.credentials().accessKey(), properties.credentials().secretKey())); | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.