File manager - Edit - /var/www/html/spdc/api/app/Http/Controllers/OccurrencyScriptureDemolitionController.php
Back
<?php namespace App\Http\Controllers; use App\Models\Occurrency; use Illuminate\Http\Request; use Illuminate\Http\JsonResponse; use App\Models\OccurrencyScriptureDemolition; use App\Http\Requests\OccurrencyScriptureDemolitionRequest; use App\Http\Services\OccurrencyScriptureDemolitionService; class OccurrencyScriptureDemolitionController extends Controller { private OccurrencyScriptureDemolitionService $demolitionService; public function __construct() { $this->demolitionService = new OccurrencyScriptureDemolitionService(); $this->middleware('auth.permissions:gestao-de-ocorrencias'); } /** * @OA\Post( * path="/api/occurrency-scripture/demolition/{occurrency_id}", * summary="Add a new demolition", * description="Add a new demolition", * operationId="AddNewOccurrencyScriptureDemolition", * 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(OccurrencyScriptureDemolitionRequest $request, Occurrency $occurrency): JsonResponse { return $this->response($this->demolitionService->store($request, $occurrency)); } /** * @OA\Put( * path="/api/occurrency-scripture/demolition/{disinderdiction_id}", * summary="Update a demolition", * description="Update a demolition", * operationId="UpdateOccurrencyScriptureDemolition", * security={{"bearerAuth":{}}}, * tags={"occurrency_scriptures"}, * @OA\Parameter( * name="disinderdiction_id", * in="path", * required=true, * description="Demolition 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(OccurrencyScriptureDemolitionRequest $request, OccurrencyScriptureDemolition $demolition): JsonResponse { return $this->response($this->demolitionService->update($request, $demolition)); } /** * @OA\Get( * path="/api/occurrency-scripture/demolition/{demolition_id}", * summary="Get details from a demolition", * description="Get details from a demolition", * operationId="GetDemolitionDetails", * security={{"bearerAuth":{}}}, * tags={"occurrency_scriptures"}, * @OA\Parameter( * name="demolition_id", * in="path", * required=true, * description="Demolition 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(OccurrencyScriptureDemolition $demolition): JsonResponse { return $this->response($this->demolitionService->show($demolition)); } /** * @OA\Get( * path="/api/occurrency-scripture/demolition/{demolition_id}/pdf", * summary="Generate pdf scripture", * description="Generate pdf scripture", * operationId="GenerateDemolitionScripture", * security={{"bearerAuth":{}}}, * tags={"occurrency_scriptures"}, * @OA\Parameter( * name="demolition_id", * in="path", * required=true, * description="Demolition 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(OccurrencyScriptureDemolition $demolition): JsonResponse { return $this->response($this->demolitionService->pdf($demolition)); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings