feat: DB 연결 오버라이딩 및 대시보드 통계 위젯 추가

- DB 연결: 로컬/Docker 환경 오버라이딩 설정 (.env)
- 테넌트 위젯: redirect 버그 수정 (TenantSelectorWidget)
- 통계 위젯: 사용자/제품/자재/주문 카드 추가 (StatsOverviewWidget)
- 리소스 한국어화: Product, Material 모델 레이블 추가
- 대시보드: 위젯 등록 및 캐시 최적화

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-30 23:31:14 +09:00
parent d94ab59fd1
commit bf8036a64b
81 changed files with 22632 additions and 102 deletions

View File

@@ -0,0 +1,227 @@
<?php
namespace App\Http\Controllers\Api\V1\Design;
use App\Helpers\ApiResponse;
use App\Http\Controllers\Controller;
use App\Services\ModelParameterService;
use App\Http\Requests\Api\V1\Design\ModelParameterFormRequest;
use App\Http\Requests\Api\V1\ModelParameter\IndexModelParameterRequest;
/**
* @OA\Tag(name="Model Parameters", description="Model parameter management APIs")
*/
class ModelParameterController extends Controller
{
public function __construct(
protected ModelParameterService $service
) {}
/**
* @OA\Get(
* path="/v1/design/models/{modelId}/parameters",
* summary="Get model parameters",
* description="Retrieve all parameters for a specific model",
* security={{"ApiKeyAuth": {}}, {"BearerAuth": {}}},
* tags={"Model Parameters"},
* @OA\Parameter(
* name="modelId",
* description="Model ID",
* in="path",
* required=true,
* @OA\Schema(type="integer", example=1)
* ),
* @OA\Parameter(
* name="page",
* description="Page number for pagination",
* in="query",
* required=false,
* @OA\Schema(type="integer", example=1)
* ),
* @OA\Parameter(
* name="per_page",
* description="Items per page",
* in="query",
* required=false,
* @OA\Schema(type="integer", example=20)
* ),
* @OA\Parameter(
* name="search",
* description="Search by parameter name or label",
* in="query",
* required=false,
* @OA\Schema(type="string", example="width")
* ),
* @OA\Parameter(
* name="type",
* description="Filter by parameter type",
* in="query",
* required=false,
* @OA\Schema(type="string", enum={"INPUT", "OUTPUT"}, example="INPUT")
* ),
* @OA\Response(
* response=200,
* description="Model parameters retrieved successfully",
* @OA\JsonContent(
* allOf={
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
* @OA\Property(
* property="data",
* @OA\Property(
* property="data",
* type="array",
* @OA\Items(ref="#/components/schemas/ModelParameterResource")
* ),
* @OA\Property(property="current_page", type="integer", example=1),
* @OA\Property(property="last_page", type="integer", example=3),
* @OA\Property(property="per_page", type="integer", example=20),
* @OA\Property(property="total", type="integer", example=45)
* )
* )
* }
* )
* ),
* @OA\Response(ref="#/components/responses/ErrorResponse", response=400),
* @OA\Response(ref="#/components/responses/UnauthorizedResponse", response=401),
* @OA\Response(ref="#/components/responses/NotFoundResponse", response=404)
* )
*/
public function index(IndexModelParameterRequest $request, int $modelId)
{
return ApiResponse::handle(function () use ($request, $modelId) {
return $this->service->getModelParameters($modelId, $request->validated());
}, __('message.fetched'));
}
/**
* @OA\Post(
* path="/v1/design/models/{modelId}/parameters",
* summary="Create model parameter",
* description="Create a new parameter for a specific model",
* security={{"ApiKeyAuth": {}}, {"BearerAuth": {}}},
* tags={"Model Parameters"},
* @OA\Parameter(
* name="modelId",
* description="Model ID",
* in="path",
* required=true,
* @OA\Schema(type="integer", example=1)
* ),
* @OA\RequestBody(
* required=true,
* @OA\JsonContent(ref="#/components/schemas/CreateModelParameterRequest")
* ),
* @OA\Response(
* response=201,
* description="Model parameter created successfully",
* @OA\JsonContent(
* allOf={
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
* @OA\Property(property="data", ref="#/components/schemas/ModelParameterResource")
* )
* }
* )
* ),
* @OA\Response(ref="#/components/responses/ValidationErrorResponse", response=422),
* @OA\Response(ref="#/components/responses/ErrorResponse", response=400),
* @OA\Response(ref="#/components/responses/UnauthorizedResponse", response=401)
* )
*/
public function store(ModelParameterFormRequest $request, int $modelId)
{
return ApiResponse::handle(function () use ($request, $modelId) {
return $this->service->createParameter($modelId, $request->validated());
}, __('message.created'));
}
/**
* @OA\Put(
* path="/v1/design/models/{modelId}/parameters/{parameterId}",
* summary="Update model parameter",
* description="Update a specific model parameter",
* security={{"ApiKeyAuth": {}}, {"BearerAuth": {}}},
* tags={"Model Parameters"},
* @OA\Parameter(
* name="modelId",
* description="Model ID",
* in="path",
* required=true,
* @OA\Schema(type="integer", example=1)
* ),
* @OA\Parameter(
* name="parameterId",
* description="Parameter ID",
* in="path",
* required=true,
* @OA\Schema(type="integer", example=1)
* ),
* @OA\RequestBody(
* required=true,
* @OA\JsonContent(ref="#/components/schemas/UpdateModelParameterRequest")
* ),
* @OA\Response(
* response=200,
* description="Model parameter updated successfully",
* @OA\JsonContent(
* allOf={
* @OA\Schema(ref="#/components/schemas/ApiResponse"),
* @OA\Schema(
* @OA\Property(property="data", ref="#/components/schemas/ModelParameterResource")
* )
* }
* )
* ),
* @OA\Response(ref="#/components/responses/ValidationErrorResponse", response=422),
* @OA\Response(ref="#/components/responses/ErrorResponse", response=400),
* @OA\Response(ref="#/components/responses/UnauthorizedResponse", response=401),
* @OA\Response(ref="#/components/responses/NotFoundResponse", response=404)
* )
*/
public function update(ModelParameterFormRequest $request, int $modelId, int $parameterId)
{
return ApiResponse::handle(function () use ($request, $modelId, $parameterId) {
return $this->service->updateParameter($modelId, $parameterId, $request->validated());
}, __('message.updated'));
}
/**
* @OA\Delete(
* path="/v1/design/models/{modelId}/parameters/{parameterId}",
* summary="Delete model parameter",
* description="Delete a specific model parameter",
* security={{"ApiKeyAuth": {}}, {"BearerAuth": {}}},
* tags={"Model Parameters"},
* @OA\Parameter(
* name="modelId",
* description="Model ID",
* in="path",
* required=true,
* @OA\Schema(type="integer", example=1)
* ),
* @OA\Parameter(
* name="parameterId",
* description="Parameter ID",
* in="path",
* required=true,
* @OA\Schema(type="integer", example=1)
* ),
* @OA\Response(
* response=200,
* description="Model parameter deleted successfully",
* @OA\JsonContent(ref="#/components/schemas/ApiResponse")
* ),
* @OA\Response(ref="#/components/responses/ErrorResponse", response=400),
* @OA\Response(ref="#/components/responses/UnauthorizedResponse", response=401),
* @OA\Response(ref="#/components/responses/NotFoundResponse", response=404)
* )
*/
public function destroy(int $modelId, int $parameterId)
{
return ApiResponse::handle(function () use ($modelId, $parameterId) {
$this->service->deleteParameter($modelId, $parameterId);
return null;
}, __('message.deleted'));
}
}