Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # app/Models/DevTools/ApiBookmark.php # app/Models/DevTools/ApiEnvironment.php # app/Models/DevTools/ApiHistory.php # app/Models/DevTools/ApiTemplate.php # config/api-explorer.php # resources/views/dev-tools/api-explorer/index.blade.php # resources/views/dev-tools/api-explorer/partials/request-panel.blade.php
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('api_bookmarks', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained()->onDelete('cascade')->comment('사용자 ID');
|
||||
$table->string('endpoint', 500)->comment('API 엔드포인트');
|
||||
$table->string('method', 10)->comment('HTTP 메서드');
|
||||
$table->string('display_name', 100)->nullable()->comment('표시명');
|
||||
$table->integer('display_order')->default(0)->comment('표시 순서');
|
||||
$table->string('color', 20)->nullable()->comment('색상 코드');
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['user_id', 'endpoint', 'method'], 'api_bookmarks_unique');
|
||||
$table->index('user_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('api_bookmarks');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('api_templates', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained()->onDelete('cascade')->comment('사용자 ID');
|
||||
$table->string('endpoint', 500)->comment('API 엔드포인트');
|
||||
$table->string('method', 10)->comment('HTTP 메서드');
|
||||
$table->string('name', 100)->comment('템플릿명');
|
||||
$table->text('description')->nullable()->comment('설명');
|
||||
$table->json('headers')->nullable()->comment('헤더 (JSON)');
|
||||
$table->json('path_params')->nullable()->comment('경로 파라미터 (JSON)');
|
||||
$table->json('query_params')->nullable()->comment('쿼리 파라미터 (JSON)');
|
||||
$table->json('body')->nullable()->comment('요청 본문 (JSON)');
|
||||
$table->boolean('is_shared')->default(false)->comment('공유 여부');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['user_id', 'endpoint', 'method'], 'api_templates_user_endpoint');
|
||||
$table->index('is_shared');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('api_templates');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('api_histories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained()->onDelete('cascade')->comment('사용자 ID');
|
||||
$table->string('endpoint', 500)->comment('API 엔드포인트');
|
||||
$table->string('method', 10)->comment('HTTP 메서드');
|
||||
$table->json('request_headers')->nullable()->comment('요청 헤더 (JSON)');
|
||||
$table->json('request_body')->nullable()->comment('요청 본문 (JSON)');
|
||||
$table->integer('response_status')->comment('응답 상태 코드');
|
||||
$table->json('response_headers')->nullable()->comment('응답 헤더 (JSON)');
|
||||
$table->longText('response_body')->nullable()->comment('응답 본문');
|
||||
$table->integer('duration_ms')->comment('소요 시간 (ms)');
|
||||
$table->string('environment', 50)->comment('환경명');
|
||||
$table->timestamp('created_at')->useCurrent()->comment('생성일시');
|
||||
|
||||
$table->index(['user_id', 'created_at'], 'api_histories_user_created');
|
||||
$table->index(['endpoint', 'method'], 'api_histories_endpoint_method');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('api_histories');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('api_environments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->constrained()->onDelete('cascade')->comment('사용자 ID');
|
||||
$table->string('name', 50)->comment('환경명');
|
||||
$table->string('base_url', 500)->comment('기본 URL');
|
||||
$table->string('api_key', 500)->nullable()->comment('API Key (암호화 저장)');
|
||||
$table->text('auth_token')->nullable()->comment('인증 토큰 (암호화 저장)');
|
||||
$table->json('variables')->nullable()->comment('환경 변수 (JSON)');
|
||||
$table->boolean('is_default')->default(false)->comment('기본 환경 여부');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('user_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('api_environments');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user