This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: Parser -> Block 표현 변및 NotionDivider 추가 * feat: Notion Image로부터 url 파싱 로직 구현 * feat: Image url로부터 이미지 upload 요청을 처리하는 NotionImageUploader 구현 * feat: S3 Client 빈 설정 * feat: NotionImageUploadListener 구현 * feat: S3 업로드를 위한 `S3Uploader` 구현 * feat: Notion에서 다운받은 이미지를 업로드 요청하는 `NotionImageUploader` 구현 * feat: ImageUploader를 이용해 이미지 파일 업로드 구현 * refactor: 사용하지 않는 설정들 제거 * refactor: 의존성 분리를 위한 패키지 분리 - `NotionParser` -> `NotionParseService`
- Loading branch information
Showing
29 changed files
with
336 additions
and
122 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
8 changes: 8 additions & 0 deletions
8
backend/src/main/java/org/donggle/backend/application/client/FileHandlerClient.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,8 @@ | ||
package org.donggle.backend.application.client; | ||
|
||
import java.util.Optional; | ||
|
||
public interface FileHandlerClient { | ||
Optional<String> syncUpload(String url); | ||
|
||
} |
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
18 changes: 18 additions & 0 deletions
18
backend/src/main/java/org/donggle/backend/config/S3ClientConfig.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,18 @@ | ||
package org.donggle.backend.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import software.amazon.awssdk.auth.credentials.InstanceProfileCredentialsProvider; | ||
import software.amazon.awssdk.regions.Region; | ||
import software.amazon.awssdk.services.s3.S3Client; | ||
|
||
@Configuration | ||
public class S3ClientConfig { | ||
@Bean | ||
public S3Client s3Client() { | ||
return S3Client.builder() | ||
.credentialsProvider(InstanceProfileCredentialsProvider.create()) | ||
.region(Region.AP_NORTHEAST_2) | ||
.build(); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
backend/src/main/java/org/donggle/backend/domain/parser/notion/FileType.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,5 @@ | ||
package org.donggle.backend.domain.parser.notion; | ||
|
||
public enum FileType { | ||
FILE, EXTERNAL | ||
} |
26 changes: 0 additions & 26 deletions
26
backend/src/main/java/org/donggle/backend/domain/parser/notion/ImageParser.java
This file was deleted.
Oops, something went wrong.
8 changes: 4 additions & 4 deletions
8
.../domain/parser/notion/BookmarkParser.java → .../domain/parser/notion/NotionBookmark.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
8 changes: 4 additions & 4 deletions
8
...d/domain/parser/notion/CalloutParser.java → ...d/domain/parser/notion/NotionCallout.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
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
8 changes: 4 additions & 4 deletions
8
...ain/parser/notion/DefaultBlockParser.java → ...ain/parser/notion/NotionDefaultBlock.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
13 changes: 13 additions & 0 deletions
13
backend/src/main/java/org/donggle/backend/domain/parser/notion/NotionDivider.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,13 @@ | ||
package org.donggle.backend.domain.parser.notion; | ||
|
||
import org.donggle.backend.infrastructure.client.notion.dto.response.NotionBlockNodeResponse; | ||
|
||
public record NotionDivider() { | ||
public static NotionDivider from(final NotionBlockNodeResponse blockNode) { | ||
return new NotionDivider(); | ||
} | ||
|
||
public String parseRawText() { | ||
return "---"; | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
...d/domain/parser/notion/HeadingParser.java → ...d/domain/parser/notion/NotionHeading.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
Oops, something went wrong.