feat: 인앱 업데이트 체크 API 구현

- app_versions 테이블 마이그레이션 (시스템 레벨, tenant_id 없음)
- AppVersion 모델 (SoftDeletes)
- AppVersionService: getLatestVersion, downloadApk
- AppVersionController: GET /api/v1/app/version, GET /api/v1/app/download/{id}
- ApiKeyMiddleware 화이트리스트에 api/v1/app/* 추가
- app_releases 스토리지 디스크 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-30 19:53:09 +09:00
parent a41bf48dd8
commit 49d163ae0c
8 changed files with 199 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('app_versions', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('version_code')->unique()->comment('정수 비교용 버전 코드');
$table->string('version_name', 20)->comment('표시용 버전명 (예: 0.2)');
$table->string('platform', 10)->default('android')->comment('android/ios');
$table->text('release_notes')->nullable()->comment('변경사항');
$table->string('apk_path', 500)->nullable()->comment('스토리지 경로');
$table->unsignedBigInteger('apk_size')->nullable()->comment('파일 크기(bytes)');
$table->string('apk_original_name', 255)->nullable()->comment('원본 파일명');
$table->boolean('force_update')->default(false)->comment('강제 업데이트 여부');
$table->boolean('is_active')->default(true)->comment('활성 여부');
$table->unsignedInteger('download_count')->default(0)->comment('다운로드 수');
$table->timestamp('published_at')->nullable()->comment('배포일');
$table->unsignedBigInteger('created_by')->nullable()->comment('생성자');
$table->unsignedBigInteger('updated_by')->nullable()->comment('수정자');
$table->timestamps();
$table->softDeletes();
$table->index(['platform', 'is_active']);
});
}
public function down(): void
{
Schema::dropIfExists('app_versions');
}
};