-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/#921] 새벽 나스닥 종목 스케줄러 추가 #940
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
Open
MinguKang98
wants to merge
14
commits into
dev
Choose a base branch
from
feat/#921
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b74cf37
feat: KIS API 연동으로 해외주식(M7+ETF) 시세 조회 기능 추가
MinguKang98 fa8596e
feat: fetchAll() 반환 타입을 StockGroup 기반 Map으로 변경 및 종목 개별 상수화
MinguKang98 948300c
feat: 주식 카드뉴스 생성 기능 추가
MinguKang98 1e23f36
refactor: 클래스 네이밍 변경 및 분리
MinguKang98 5637137
feat: 나스닥 주식 카드 이미지를 1080×1080 인스타그램 스타일로 전면 개편
MinguKang98 f50e28f
feat: 나스닥 데일리 주식 카드 스케줄링 UseCase 추가 및 테스트 작성
MinguKang98 e2312a6
refactor: 나스닥 카드뉴스 생성 클래스 네이밍 변경 (StockCardGenerator -> NasdaqDailySt…
MinguKang98 b31d77b
feat: NYSE 휴장일 체크 기능 추가 및 나스닥 스케줄링 연결
MinguKang98 7a5be56
refactor: 카드뉴스 제목 변경 (NASDAQ DAILY > 일간 미국 지수)
MinguKang98 c364338
Merge remote-tracking branch 'origin/dev' into feat/#921
hun-ca d43beeb
refactor: lint 수행
hun-ca 159eed6
Merge remote-tracking branch 'origin/dev' into feat/#921
hun-ca 0bd2653
fix: NasdaqDailyStockCardGenerator의 ImageGeneratorUtils 참조를 CardImage…
hun-ca 11d543a
test: NasdaqDailyStockCardGenerator generateImage 테스트 추가
hun-ca 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,6 +75,42 @@ class InstagramUploader( | |
| } | ||
| } | ||
|
|
||
| // 단일 이미지 컨테이너 생성 (캐러셀 아님) | ||
| fun createSingleMediaContainer( | ||
| imageUrl: String, | ||
| caption: String, | ||
| ): String? { | ||
| val url = | ||
| "https://graph.instagram.com/$accountId/media" | ||
| .toHttpUrlOrNull() | ||
| ?.newBuilder() | ||
| ?.addQueryParameter("access_token", instagramTokenService.getLatestAccessToken()) | ||
| ?.addQueryParameter("image_url", imageUrl) | ||
| ?.addQueryParameter("caption", caption) | ||
| ?.build() | ||
|
|
||
| val request = | ||
| Request | ||
| .Builder() | ||
| .url(url!!) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| .post(RequestBody.create(null, "")) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| .build() | ||
|
|
||
| instagramOkHttpClient.newCall(request).execute().use { response -> | ||
| val responseBody = response.body?.string() | ||
| if (!response.isSuccessful) { | ||
| val errorResponse = parseErrorResponse(responseBody) | ||
| logErrorResponse("[SingleMedia] MediaContainer", response.code, errorResponse) | ||
| throw RuntimeException( | ||
| "[Instagram][SingleMedia] Creation of MediaContainer Failed: ${errorResponse?.error?.message ?: "Unknown error"}", | ||
| ) | ||
| } | ||
| DelayUtil.randomDelay(5, 10) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| return responseBody?.let { parseJsonForId(it).id } | ||
| } | ||
| } | ||
|
|
||
| // 2단계: 캐러셀용 부모 컨테이너 생성 | ||
| fun createParentMediaContainer( | ||
| imageUrls: List<String>, | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스케줄러 예외 처리 누락
nasdaqDailyStockScheduling()에 예외 처리가 없습니다.NasdaqDailyStockCardSchedulingUseCase.execute()는 이미지 생성 실패, S3 업로드 실패, Instagram 컨테이너 생성 실패 시RuntimeException을 발생시킵니다.refreshInstagramToken()(Line 44-51)과 달리 try-catch가 없어, 예외 발생 시 로깅이 누락되고 스케줄러 동작에 영향을 줄 수 있습니다.🛡️ 예외 처리 추가 제안
`@Scheduled`(cron = "\${scheduling.cron.nasdaq-daily-stock}", zone = "Asia/Seoul") fun nasdaqDailyStockScheduling() { - nasdaqDailyStockCardSchedulingUseCase.execute() + try { + nasdaqDailyStockCardSchedulingUseCase.execute() + } catch (e: Exception) { + log.error(e) { "나스닥 주식 카드 스케줄 실행 중 오류 발생: ${e.message}" } + } }🤖 Prompt for AI Agents