Skip to content

Commit

Permalink
Merge pull request #8 from fuuuuj1/develop
Browse files Browse the repository at this point in the history
Bref を使用してLaravelアプリケーションのデプロイ
  • Loading branch information
fuuuuj1 committed Feb 23, 2024
2 parents b885921 + 2ef7369 commit 8ff6c4f
Show file tree
Hide file tree
Showing 6 changed files with 1,021 additions and 82 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -17,3 +17,5 @@ yarn-error.log
/.fleet
/.idea
/.vscode
environment.yml
.serverless
7 changes: 5 additions & 2 deletions app/Console/Commands/ArticleSummaryNotice.php
Expand Up @@ -72,12 +72,15 @@ public function handle()
try {
// chatGPT apiを使用して記事を要約する
$response = $this->openai_service->fetch($content);
// 時折、文字化けにより通知失敗するので、後続処理を進めるために、try-catchにて処理
Notification::route('slack', config('services.slack.channel'))
->notify(new NewsDispatch($response));
} catch (\Throwable $th) {
$this->error($th->getMessage());
// TODO: Error が発生した場合は専用のcountをインクリメント
// 最後に例外発生のcountを元にSlack通知を行う
continue;
}
Notification::route('slack', config('services.slack.channel'))
->notify(new NewsDispatch($response));
}
$this->info('記事の要約処理を終了');
}
Expand Down
2 changes: 1 addition & 1 deletion app/Notifications/NewsDispatch.php
Expand Up @@ -84,7 +84,7 @@ public function toSlack(): SlackMessage
$text .= '• ' . $value . "\n";
}
// 要約をコードブロックで表示
$section->text("```$text```")->markdown();
$section->text($text)->markdown();
})
->dividerBlock()
->sectionBlock(function (SectionBlock $section) {
Expand Down
2 changes: 2 additions & 0 deletions composer.json
Expand Up @@ -6,6 +6,8 @@
"license": "MIT",
"require": {
"php": "^8.1",
"bref/bref": "^2.1",
"bref/laravel-bridge": "^2.2",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.3",
Expand Down

0 comments on commit 8ff6c4f

Please sign in to comment.