File manager - Edit - /var/www/html/spdc/api/app/Http/Controllers/OccurrencyScriptureImpedimentController.php
Back
<?php namespace App\Http\Controllers; use App\Models\Occurrency; use Illuminate\Http\Request; use Illuminate\Http\JsonResponse; use App\Models\OccurrencyScriptureImpediment; use App\Http\Requests\OccurrencyScriptureImpedimentRequest; use App\Http\Services\OccurrencyScriptureImpedimentService; class OccurrencyScriptureImpedimentController extends Controller { private OccurrencyScriptureImpedimentService $impedimentService; public function __construct() { $this->impedimentService = new OccurrencyScriptureImpedimentService(); $this->middleware('auth.permissions:gestao-de-ocorrencias'); } /** * @OA\Post( * path="/api/occurrency-scripture/impediment/{occurrency_id}", * summary="Add a new impediment", * description="Add a new impediment", * operationId="AddNewOccurrencyScriptureImpediment", * security={{"bearerAuth":{}}}, * tags={"occurrency_scriptures"}, * @OA\Parameter( * name="occurrency_id", * in="path", * required=true, * description="Occurrency ID", * @OA\Schema(type="string") * ), * @OA\RequestBody( * required=true, * @OA\MediaType( * mediaType="application/x-www-form-urlencoded", * @OA\Schema( * required={"place_type_id"}, * @OA\Property( * property="place_type_id", * type="string", * description="ID do tipo do local" * ), * @OA\Property( * property="note", * type="string", * description="Observações" * ), * @OA\Property( * property="publication", * type="string", * description="Publicação" * ), * @OA\Property( * property="page", * type="string", * description="Página" * ), * @OA\Property( * property="year", * type="string", * description="Ano" * ), * ), * ), * @OA\MediaType( * mediaType="application/json", * @OA\Schema( * required={"place_type_id"}, * @OA\Property( * property="place_type_id", * type="string", * description="ID do tipo do local" * ), * @OA\Property( * property="note", * type="string", * description="Observações" * ), * @OA\Property( * property="publication", * type="string", * description="Publicação" * ), * @OA\Property( * property="page", * type="string", * description="Página" * ), * @OA\Property( * property="year", * type="string", * description="Ano" * ), * ), * ), * ), * @OA\Response( * response="201", * description="Created", * @OA\JsonContent( * @OA\Property(property="data", type="json", example="{}"), * @OA\Property(property="message", type="string", example="Success."), * ) * ), * @OA\Response( * response="401", * description="Unauthorized", * @OA\JsonContent( * @OA\Property(property="message", type="string", example="Unauthorized."), * ) * ), * @OA\Response( * response="422", * description="Validation Error", * @OA\JsonContent( * @OA\Property(property="message", type="string", example="Validation Error."), * @OA\Property(property="errors", type="json", example="{}"), * ) * ), * ) */ public function store(OccurrencyScriptureImpedimentRequest $request, Occurrency $occurrency): JsonResponse { return $this->response($this->impedimentService->store($request, $occurrency)); } /** * @OA\Put( * path="/api/occurrency-scripture/impediment/{disinderdiction_id}", * summary="Update a impediment", * description="Update a impediment", * operationId="UpdateOccurrencyScriptureImpediment", * security={{"bearerAuth":{}}}, * tags={"occurrency_scriptures"}, * @OA\Parameter( * name="disinderdiction_id", * in="path", * required=true, * description="Impediment ID", * @OA\Schema(type="string") * ), * @OA\RequestBody( * required=true, * @OA\MediaType( * mediaType="application/x-www-form-urlencoded", * @OA\Schema( * required={"place_type_id"}, * @OA\Property( * property="place_type_id", * type="string", * description="ID do tipo do local" * ), * @OA\Property( * property="note", * type="string", * description="Observações" * ), * @OA\Property( * property="publication", * type="string", * description="Publicação" * ), * @OA\Property( * property="page", * type="string", * description="Página" * ), * @OA\Property( * property="year", * type="string", * description="Ano" * ), * ), * ), * @OA\MediaType( * mediaType="application/json", * @OA\Schema( * required={"place_type_id"}, * @OA\Property( * property="place_type_id", * type="string", * description="ID do tipo do local" * ), * @OA\Property( * property="note", * type="string", * description="Observações" * ), * @OA\Property( * property="publication", * type="string", * description="Publicação" * ), * @OA\Property( * property="page", * type="string", * description="Página" * ), * @OA\Property( * property="year", * type="string", * description="Ano" * ), * ), * ), * ), * @OA\Response( * response="201", * description="Created", * @OA\JsonContent( * @OA\Property(property="data", type="json", example="{}"), * @OA\Property(property="message", type="string", example="Success."), * ) * ), * @OA\Response( * response="401", * description="Unauthorized", * @OA\JsonContent( * @OA\Property(property="message", type="string", example="Unauthorized."), * ) * ), * @OA\Response( * response="422", * description="Validation Error", * @OA\JsonContent( * @OA\Property(property="message", type="string", example="Validation Error."), * @OA\Property(property="errors", type="json", example="{}"), * ) * ), * ) */ public function update(OccurrencyScriptureImpedimentRequest $request, OccurrencyScriptureImpediment $impediment): JsonResponse { return $this->response($this->impedimentService->update($request, $impediment)); } /** * @OA\Get( * path="/api/occurrency-scripture/impediment/{impediment_id}", * summary="Get details from a impediment", * description="Get details from a impediment", * operationId="GetImpedimentDetails", * security={{"bearerAuth":{}}}, * tags={"occurrency_scriptures"}, * @OA\Parameter( * name="impediment_id", * in="path", * required=true, * description="Impediment ID", * @OA\Schema(type="string") * ), * @OA\Response( * response="200", * description="OK", * @OA\JsonContent( * @OA\Property(property="data", type="json", example="{}"), * @OA\Property(property="message", type="string", example="Success."), * ) * ), * @OA\Response( * response="401", * description="Unauthorized", * @OA\JsonContent( * @OA\Property(property="message", type="string", example="Unauthorized."), * ) * ), * @OA\Response( * response="404", * description="Not found", * @OA\JsonContent( * @OA\Property(property="message", type="string", example="Not found."), * ) * ), * ) */ public function show(OccurrencyScriptureImpediment $impediment): JsonResponse { return $this->response($this->impedimentService->show($impediment)); } /** * @OA\Get( * path="/api/occurrency-scripture/impediment/{impediment_id}/pdf", * summary="Generate pdf scripture", * description="Generate pdf scripture", * operationId="GenerateImpedimentScripture", * security={{"bearerAuth":{}}}, * tags={"occurrency_scriptures"}, * @OA\Parameter( * name="impediment_id", * in="path", * required=true, * description="Impediment ID", * @OA\Schema(type="string") * ), * @OA\Response( * response="200", * description="OK", * @OA\JsonContent( * @OA\Property(property="data", type="json", example="{}"), * @OA\Property(property="message", type="string", example="Success."), * ) * ), * @OA\Response( * response="401", * description="Unauthorized", * @OA\JsonContent( * @OA\Property(property="message", type="string", example="Unauthorized."), * ) * ), * ) */ public function pdf(OccurrencyScriptureImpediment $impediment): JsonResponse { return $this->response($this->impedimentService->pdf($impediment)); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings