File manager - Edit - /var/www/html/spdc/api/app/Http/Controllers/OccurrencyScriptureInterdictionController.php
Back
<?php namespace App\Http\Controllers; use App\Models\Occurrency; use Illuminate\Http\Request; use Illuminate\Http\JsonResponse; use App\Models\OccurrencyScriptureInterdiction; use App\Http\Requests\OccurrencyScriptureInterdictionRequest; use App\Http\Services\OccurrencyScriptureInterdictionService; class OccurrencyScriptureInterdictionController extends Controller { private OccurrencyScriptureInterdictionService $interdictionService; public function __construct() { $this->interdictionService = new OccurrencyScriptureInterdictionService(); $this->middleware('auth.permissions:gestao-de-ocorrencias'); } /** * @OA\Post( * path="/api/occurrency-scripture/interdiction/{occurrency_id}", * summary="Add a new interdiction", * description="Add a new interdiction", * operationId="AddNewOccurrencyScriptureInterdiction", * 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={"ban_type", "implementation_type","place_type_id"}, * @OA\Property( * property="ban_type", * type="string", * example="PONTUAL", * description="Tipo de interdição:PONTUAL,ÁREA" * ), * @OA\Property( * property="implementation_type", * type="string", * example="TOTAL", * description="Tipo de efetivação:TOTAL,PARCIAL" * ), * @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\Property( * property="area", * type="string", * description="Área" * ), * @OA\Property( * property="family_composition", * type="array", * description="Composição familiar", * collectionFormat="multi", * @OA\Items( * @OA\Property( * property="name", * type="string", * ), * @OA\Property( * property="age", * type="string", * ), * ), * ), * ), * ), * @OA\MediaType( * mediaType="application/json", * @OA\Schema( * required={"ban_type", "implementation_type","place_type_id"}, * @OA\Property( * property="ban_type", * type="string", * example="PONTUAL", * description="Tipo de interdição:PONTUAL,ÁREA" * ), * @OA\Property( * property="implementation_type", * type="string", * example="TOTAL", * description="Tipo de efetivação:TOTAL,PARCIAL" * ), * @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\Property( * property="area", * type="string", * description="Área" * ), * @OA\Property( * property="family_composition", * type="array", * description="Composição familiar", * collectionFormat="multi", * @OA\Items( * @OA\Property( * property="name", * type="string", * ), * @OA\Property( * property="age", * type="string", * ), * ), * ), * ), * ), * ), * @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(OccurrencyScriptureInterdictionRequest $request, Occurrency $occurrency): JsonResponse { return $this->response($this->interdictionService->store($request, $occurrency)); } /** * @OA\Put( * path="/api/occurrency-scripture/interdiction/{inderdiction_id}", * summary="Update a interdiction", * description="Update a interdiction", * operationId="UpdateOccurrencyScriptureInterdiction", * security={{"bearerAuth":{}}}, * tags={"occurrency_scriptures"}, * @OA\Parameter( * name="inderdiction_id", * in="path", * required=true, * description="Interdiction ID", * @OA\Schema(type="string") * ), * @OA\RequestBody( * required=true, * @OA\MediaType( * mediaType="application/x-www-form-urlencoded", * @OA\Schema( * required={"ban_type", "implementation_type","place_type_id"}, * @OA\Property( * property="ban_type", * type="string", * example="PONTUAL", * description="Tipo de interdição:PONTUAL,ÁREA" * ), * @OA\Property( * property="implementation_type", * type="string", * example="TOTAL", * description="Tipo de efetivação:TOTAL,PARCIAL" * ), * @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\Property( * property="area", * type="string", * description="Área" * ), * @OA\Property( * property="family_composition", * type="array", * description="Composição familiar", * collectionFormat="multi", * @OA\Items( * @OA\Property( * property="name", * type="string", * ), * @OA\Property( * property="age", * type="string", * ), * ), * ), * ), * ), * @OA\MediaType( * mediaType="application/json", * @OA\Schema( * required={"ban_type", "implementation_type","place_type_id"}, * @OA\Property( * property="ban_type", * type="string", * example="PONTUAL", * description="Tipo de interdição:PONTUAL,ÁREA" * ), * @OA\Property( * property="implementation_type", * type="string", * example="TOTAL", * description="Tipo de efetivação:TOTAL,PARCIAL" * ), * @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\Property( * property="area", * type="string", * description="Área" * ), * @OA\Property( * property="family_composition", * type="array", * description="Composição familiar", * collectionFormat="multi", * @OA\Items( * @OA\Property( * property="name", * type="string", * ), * @OA\Property( * property="age", * type="string", * ), * ), * ), * ), * ), * ), * @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(OccurrencyScriptureInterdictionRequest $request, OccurrencyScriptureInterdiction $interdiction): JsonResponse { return $this->response($this->interdictionService->update($request, $interdiction)); } /** * @OA\Get( * path="/api/occurrency-scripture/interdiction/{interdiction_id}", * summary="Get details from a interdiction", * description="Get details from a interdiction", * operationId="GetInterdictionDetails", * security={{"bearerAuth":{}}}, * tags={"occurrency_scriptures"}, * @OA\Parameter( * name="interdiction_id", * in="path", * required=true, * description="Interdiction 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(OccurrencyScriptureInterdiction $interdiction): JsonResponse { return $this->response($this->interdictionService->show($interdiction)); } /** * @OA\Get( * path="/api/occurrency-scripture/interdiction/{interdiction_id}/pdf", * summary="Generate pdf scripture", * description="Generate pdf scripture", * operationId="GenerateInterdictionScripture", * security={{"bearerAuth":{}}}, * tags={"occurrency_scriptures"}, * @OA\Parameter( * name="interdiction_id", * in="path", * required=true, * description="Interdiction 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(OccurrencyScriptureInterdiction $interdiction): JsonResponse { return $this->response($this->interdictionService->pdf($interdiction)); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings