Skip to content

뉴젯 웰컴 뉴스레터 전송 기능 오류 수정#139

Open
Gyu-won wants to merge 4 commits intodevfrom
Fix/issue-#136
Open

뉴젯 웰컴 뉴스레터 전송 기능 오류 수정#139
Gyu-won wants to merge 4 commits intodevfrom
Fix/issue-#136

Conversation

@Gyu-won
Copy link
Contributor

@Gyu-won Gyu-won commented Sep 22, 2025

개요

  • 뉴젯 웰컴 뉴스레터 전송 기능 오류 수정

배경

  • dev 환경에서 웰컴 뉴스레터 수신 테스트를 위한 PR

변경된 점

  • 뉴젯 뉴스레터 id 환경변수화
  • 뉴젯 뉴스레터 db 저장
  • 불필욯나 코드 제거

관련 이슈

close #136

@Gyu-won Gyu-won self-assigned this Sep 22, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issues with the Newzet welcome newsletter functionality by refactoring the storage architecture and improving configuration management.

  • Refactored S3Service to a more flexible StorageService supporting both AWS S3 and Supabase storage
  • Made newsletter ID configurable via environment variables instead of hardcoded values
  • Replaced hardcoded content paths and image URLs with dynamic database values

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/test/java/com/newzet/api/config/S3TestConfig.java Added Supabase test configuration properties alongside existing AWS S3 config
src/test/java/com/newzet/api/common/storage/StorageServiceTest.java New comprehensive test suite for the StorageService with both AWS and Supabase scenarios
src/test/java/com/newzet/api/common/s3/S3ServiceTest.java Removed old S3Service test file
src/main/resources/application.yml Added Supabase storage configuration and newsletter ID configuration
src/main/java/com/newzet/api/welcome/orchestrator/WelcomeOrchestrator.java Updated to use configurable newsletter ID and dynamic image URLs from database
src/main/java/com/newzet/api/welcome/api/WelcomeApi.java Added @RequireAuth annotation for authentication
src/main/java/com/newzet/api/config/storage/StorageConfig.java New unified storage configuration supporting both AWS S3 and Supabase
src/main/java/com/newzet/api/config/s3/S3Config.java Removed old S3-only configuration
src/main/java/com/newzet/api/common/storage/StorageService.java New service supporting multiple storage backends with conditional logic
src/main/java/com/newzet/api/common/s3/S3Service.java Removed old S3-only service
src/main/java/com/newzet/api/article/orchestrator/ArticleOrchestrator.java Updated to use new StorageService with storage type detection
src/main/java/com/newzet/api/article/domain/Article.java Added isSaveInStorage() method to determine storage type based on file extension

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

private static final String WELCOME_MAIL_URL = "newzet_content/welcome_letter";
private static final String WELCOME_MAIL_IMAGE_URL = "https://newzet-lib.s3.ap-northeast-2.amazonaws.com/newsletter-image/trend_issue/nz_logo.webp";

private static final String WELCOME_MAIL_URL = "welcome_letter";
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WELCOME_MAIL_URL was changed from 'newzet_content/welcome_letter' to just 'welcome_letter', removing the directory prefix. Ensure this path change aligns with the actual storage structure.

Suggested change
private static final String WELCOME_MAIL_URL = "welcome_letter";
private static final String WELCOME_MAIL_URL = "newzet_content/welcome_letter";

Copilot uses AI. Check for mistakes.
Comment on lines +105 to +107
public boolean isSaveInStorage() {
return contentUrl.endsWith(".html");
}
Copy link

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic for determining storage type based on file extension '.html' seems fragile. Consider using a more explicit field or enum to indicate storage type rather than inferring from file extension.

Copilot uses AI. Check for mistakes.
@Gyu-won Gyu-won requested a review from GitJIHO September 22, 2025 13:54
…strator.java


import 오류 수정

Co-authored-by: Copilot <[email protected]>
Copy link
Member

@GitJIHO GitJIHO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 👍
dev에 머지후에 환경변수로 인한 서버 실행오류만 일어나지 않는다면 문제없을 것 같네요!

@GitJIHO
Copy link
Member

GitJIHO commented Sep 22, 2025

CI 터지는 부분이 배치처리 관련 부분인데 환경변수 때문이 아닌가 싶네요 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Supabase storage 조회 구현

4 participants