File manager - Edit - /var/www/html/spdc/api/app/Http/Controllers/OccurrencyExecutionController.php
Back
<?php namespace App\Http\Controllers; use App\Models\Occurrency; use Illuminate\Http\Request; use Illuminate\Http\JsonResponse; use App\Http\Requests\OccurrencyExecutionRequest; use App\Http\Services\OccurrencyExecutionService; class OccurrencyExecutionController extends Controller { private OccurrencyExecutionService $inpectionService; public function __construct() { $this->inpectionService = new OccurrencyExecutionService(); $this->middleware('auth.permissions:gestao-de-ocorrencias'); } /** * @OA\Post( * path="/api/occurrency/{occurrency_id}/execution", * summary="Save occurrency execution info", * description="Save occurrency execution info", * operationId="SaveOccurrencyExecution", * security={{"bearerAuth":{}}}, * tags={"occurrencys"}, * @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( * @OA\Property( * property="observation", * type="string", * description="Observation" * ), * @OA\Property( * property="files", * type="array", * @OA\Items(type="string", format="binary"), * description="An array of base64 files", * ), * @OA\Property( * property="images", * type="array", * @OA\Items(type="string", format="binary"), * description="An array of base64 images", * ), * @OA\Property( * property="team", * type="array", * description="An array with user_ids from execution team.", * collectionFormat="multi", * @OA\Items(type="string", format="id"), * ), * @OA\Property( * property="forms", * type="array", * description="Array with info forms info", * collectionFormat="multi", * @OA\Items( * @OA\Property( * property="id", * type="string", * ), * @OA\Property( * property="fields", * type="array", * @OA\Items( * @OA\Property(property="id", type="string"), * @OA\Property(property="value", type="string"), * ), * ), * ), * ), * ), * ), * @OA\MediaType( * mediaType="application/json", * @OA\Schema( * @OA\Property( * property="observation", * type="string", * description="Observation" * ), * @OA\Property( * property="files", * type="array", * @OA\Items(type="string", format="binary"), * description="An array of base64 files", * ), * @OA\Property( * property="images", * type="array", * @OA\Items(type="string", format="binary"), * description="An array of base64 images", * ), * @OA\Property( * property="team", * type="array", * description="An array with user_ids from execution team.", * collectionFormat="multi", * @OA\Items(type="string", format="id"), * ), * @OA\Property( * property="forms", * type="array", * description="Array with info forms info", * collectionFormat="multi", * @OA\Items( * @OA\Property( * property="id", * type="string", * ), * @OA\Property( * property="fields", * type="array", * @OA\Items( * @OA\Property(property="id", type="string"), * @OA\Property(property="value", type="string"), * ), * ), * ), * ), * ), * ), * ), * @OA\Response( * response="204", * description="No content", * @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 save(OccurrencyExecutionRequest $request, Occurrency $occurrency): JsonResponse { return $this->response($this->inpectionService->save($request->all(), $occurrency)); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings