Files
sam-api/app/Http/Controllers/Api/V1/ProductController.php

107 lines
3.3 KiB
PHP
Raw Normal View History

2025-07-23 18:06:33 +09:00
<?php
namespace App\Http\Controllers\Api\V1;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Helpers\ApiResponse;
use App\Services\ProductService;
class ProductController extends Controller
{
public function index(Request $request)
{
//
}
/**
* @OA\Get (
* path="/api/v1/product/category",
2025-07-23 18:06:33 +09:00
* summary="제품 카테고리 목록 조회",
* description="제품 카테고리(최상위, parent_id=null) 리스트를 반환합니다.",
* tags={"Product"},
* security={
* {"ApiKeyAuth": {}},
* {"BearerAuth": {}}
* },
2025-07-23 18:06:33 +09:00
* @OA\Response(
* response=200,
* description="카테고리 목록 조회 성공",
* @OA\JsonContent(
* type="object",
* @OA\Property(property="status", type="string", example="success"),
* @OA\Property(property="message", type="string", example="get 성공"),
* @OA\Property(
* property="data",
* type="array",
* @OA\Items(
* type="object",
* @OA\Property(property="id", type="integer", example=4),
* @OA\Property(property="code_group", type="string", example="category"),
* @OA\Property(property="code", type="string", example="BP"),
* @OA\Property(property="name", type="string", example="절곡판"),
* @OA\Property(property="parent_id", type="integer", example=null),
* @OA\Property(property="attributes", type="string", example="[{...}]"),
* @OA\Property(property="description", type="string", example="절곡판"),
* @OA\Property(property="is_active", type="integer", example=1),
* @OA\Property(property="sort_order", type="integer", example=10),
* @OA\Property(property="created_at", type="string", format="date-time", example="2025-07-23T09:00:00Z"),
* @OA\Property(property="updated_at", type="string", format="date-time", example="2025-07-23T09:00:00Z")
* )
* )
* )
* ),
* @OA\Response(response=401, description="인증 실패"),
* @OA\Response(response=500, description="서버 에러")
* )
*/
public function getCategory(Request $request)
{
return ApiResponse::handle(function () use ($request) {
return ProductService::getCategory($request);
}, '제품 카테고리 조회 성공', '제품 카테고리 조회 실패');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}
public function show(Request $request, $userNo)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
//
}
}