mirror of
https://github.com/henry4682/finance_app.git
synced 2026-07-16 00:10:00 +00:00
feat: 前端分離+功能api化
1. 新增資產管理CRUD、googleOAuth登入 2. 更改原記帳controller
This commit is contained in:
@@ -1,8 +1,30 @@
|
||||
<?php
|
||||
|
||||
use App\Console\Commands\RefreshAllAssetPrices;
|
||||
use Illuminate\Foundation\Inspiring;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Schedule;
|
||||
use App\Jobs\FetchAndParseGmailInvoices;
|
||||
use App\Models\User;
|
||||
|
||||
Artisan::command('inspire', function () {
|
||||
$this->comment(Inspiring::quote());
|
||||
})->purpose('Display an inspiring quote');
|
||||
|
||||
Schedule::command(RefreshAllAssetPrices::class)
|
||||
->weekdays()
|
||||
->at('14:00')
|
||||
->at('22:00');
|
||||
|
||||
Schedule::call(function () {
|
||||
// 找出所有有綁定 Google Refresh Token 的使用者
|
||||
$users = User::whereNotNull('google_refresh_token')->get();
|
||||
|
||||
foreach ($users as $user) {
|
||||
// 分別派發非同步任務去排隊抓信,不塞車
|
||||
FetchAndParseGmailInvoices::dispatch($user);
|
||||
}
|
||||
})
|
||||
->weekdays()
|
||||
->at('14:00')
|
||||
->at('22:00');
|
||||
|
||||
Reference in New Issue
Block a user