<?php

namespace App\Http\Controllers\Api\V1;

use App\Helpers\ApiResponse;
use App\Http\Controllers\Controller;
use App\Services\CategoryLogService;
use Illuminate\Http\Request;

class CategoryLogController extends Controller
{
    public function __construct(private CategoryLogService $service) {}

    // GET /categories/{id}/logs
    public function index(int $id, Request $request)
    {
        return ApiResponse::handle(function () use ($id, $request) {
            return $this->service->index($id, $request->all());
        }, '카테고리 변경이력 목록');
    }

    // GET /categories/logs/{log}
    public function show(int $log)
    {
        return ApiResponse::handle(function () use ($log) {
            return $this->service->show($log);
        }, '카테고리 변경이력 조회');
    }
}
