單機版 v0.0.10 20250625

song_library_cache id 不正確問題
This commit is contained in:
allen.yan 2025-06-25 10:52:24 +08:00
parent 1588631f36
commit 9237edb228
7 changed files with 138 additions and 1 deletions

View File

@ -10,6 +10,10 @@ APP_LOCALE=zh-tw
APP_FALLBACK_LOCALE=zh-tw APP_FALLBACK_LOCALE=zh-tw
APP_FAKER_LOCALE=zh_TW APP_FAKER_LOCALE=zh_TW
FTP_HOST=192.168.11.16
FTP_USERNAME=svr
FTP_PASSWORD=svr
APP_MAINTENANCE_DRIVER=file APP_MAINTENANCE_DRIVER=file
# APP_MAINTENANCE_STORE=database # APP_MAINTENANCE_STORE=database

View File

@ -0,0 +1,30 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class CompareSongFiles extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'app:compare-song-files';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Execute the console command.
*/
public function handle()
{
//
}
}

View File

@ -0,0 +1,40 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
class TestFtpConnection extends Command
{
protected $signature = 'ftp:test';
protected $description = '測試 FTP 連線、上傳、下載、刪除';
public function handle()
{
$disk = Storage::disk('ftp_test');
$testFile = 'laravel_ftp_test.txt';
$testContent = '這是 Laravel 的 FTP 測試檔案';
// 嘗試上傳
$this->info("🔼 上傳中...");
if (!$disk->put($testFile, $testContent)) {
return $this->error("❌ 上傳失敗");
}
// 嘗試讀取
$this->info("📥 下載檢查...");
$content = $disk->get($testFile);
if ($content !== $testContent) {
return $this->error("❌ 檔案內容不符");
}
// 嘗試刪除
$this->info("🗑️ 刪除測試檔案...");
if (!$disk->delete($testFile)) {
return $this->error("❌ 刪除失敗");
}
$this->info("✅ FTP 測試成功!");
}
}

View File

@ -16,6 +16,7 @@ class SongLibraryCache extends Model
// 可寫入的欄位(可依需要擴充) // 可寫入的欄位(可依需要擴充)
protected $fillable = [ protected $fillable = [
'song_id',
'song_name', 'song_name',
'song_simplified', 'song_simplified',
'phonetic_abbr', 'phonetic_abbr',

View File

@ -11,6 +11,7 @@
"laravel/framework": "^12.0", "laravel/framework": "^12.0",
"laravel/sanctum": "^4.0", "laravel/sanctum": "^4.0",
"laravel/tinker": "^2.10.1", "laravel/tinker": "^2.10.1",
"league/flysystem-ftp": "^3.29",
"livewire/livewire": "^3.4", "livewire/livewire": "^3.4",
"livewire/volt": "^1.7.0", "livewire/volt": "^1.7.0",
"maatwebsite/excel": "^3.1", "maatwebsite/excel": "^3.1",

52
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "3d96136c4b2709b3558d30eafa66bcfc", "content-hash": "2cd258dd8d67caabf878279f2818cfbc",
"packages": [ "packages": [
{ {
"name": "brick/math", "name": "brick/math",
@ -2169,6 +2169,56 @@
}, },
"time": "2024-10-08T08:58:34+00:00" "time": "2024-10-08T08:58:34+00:00"
}, },
{
"name": "league/flysystem-ftp",
"version": "3.29.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem-ftp.git",
"reference": "17e8e422cb43a7fefa06ec8ddf36ee8ec936d138"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem-ftp/zipball/17e8e422cb43a7fefa06ec8ddf36ee8ec936d138",
"reference": "17e8e422cb43a7fefa06ec8ddf36ee8ec936d138",
"shasum": ""
},
"require": {
"ext-ftp": "*",
"league/flysystem": "^3.0.0",
"league/mime-type-detection": "^1.0.0",
"php": "^8.0.2"
},
"type": "library",
"autoload": {
"psr-4": {
"League\\Flysystem\\Ftp\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Frank de Jonge",
"email": "info@frankdejonge.nl"
}
],
"description": "FTP filesystem adapter for Flysystem.",
"keywords": [
"Flysystem",
"file",
"files",
"filesystem",
"ftp",
"ftpd"
],
"support": {
"source": "https://github.com/thephpleague/flysystem-ftp/tree/3.29.0"
},
"time": "2024-06-12T09:46:12+00:00"
},
{ {
"name": "league/flysystem-local", "name": "league/flysystem-local",
"version": "3.29.0", "version": "3.29.0",

View File

@ -60,6 +60,17 @@ return [
'report' => false, 'report' => false,
], ],
'ftp_test' => [
'driver' => 'ftp',
'host' => env('FTP_HOST', '192.168.11.16'),
'username' => env('FTP_USERNAME', 'your_username'),
'password' => env('FTP_PASSWORD', 'your_password'),
'port' => 21,
'root' => '/', // 或指定資料夾
'passive' => true,
'ssl' => false,
'timeout' => 30,
],
], ],
/* /*