-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from IT-Academy-BCN/feature/fake_profile_detai…
…l_endpoint Feature/fake_profile_detail_endpoint
- Loading branch information
Showing
5 changed files
with
222 additions
and
4 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
...nnotations/OpenApi/controllersAnnotations/StudentAnnotations/AnnotationsStudentDetail.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
|
||
namespace App\Annotations\OpenApi\controllersAnnotations\studentAnnotations; | ||
|
||
class AnnotationsStudentDetail | ||
{ | ||
/** | ||
* @OA\Get( | ||
* path="/student/detail/for-home", | ||
* operationId="getStudentDetail", | ||
* tags={"Student"}, | ||
* summary="Get Student Detail.", | ||
* description="Get student detail registered. No authentication required", | ||
* | ||
* @OA\Response( | ||
* response=200, | ||
* description="", | ||
* | ||
* @OA\JsonContent( | ||
* @OA\Property( | ||
* type="array", | ||
* property="data", | ||
* @OA\Items( | ||
* type="object", | ||
* @OA\Property(property="student_id", type="integer", example=1), | ||
* @OA\Property( | ||
* property="profile_detail", | ||
* type="object", | ||
* @OA\Property(property="fullname", type="string", example="Juan Pérez"), | ||
* @OA\Property(property="subtitle", type="string", example="Desarrollador Frontend"), | ||
* @OA\Property( | ||
* property="social_media", | ||
* type="object", | ||
* @OA\Property( | ||
* property="linkedin", | ||
* type="object", | ||
* @OA\Property(property="url", type="string", example="https://es.linkedin.com/"), | ||
* ), | ||
* @OA\Property( | ||
* property="github", | ||
* type="object", | ||
* @OA\Property(property="url", type="string", example="https://github.com/"), | ||
* ) | ||
* ), | ||
* @OA\Property( | ||
* property="about", | ||
* type="object", | ||
* @OA\Property(property="description", type="string", example="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam a euismod elit. Nunc elit ante, vulputate sed maximus eu, posuere eu nibh. In eget lacus in mi pharetra volutpat a a justo. Fusce aliquet nibh nec accumsan facilisis. Suspendisse in tempor nibh, eu fermentum velit. Suspendisse cursus ultricies ipsum, eget tincidunt arcu pretium laoreet. Pellentesque eget egestas erat. Donec dapibus pharetra ultrices. Vivamus mollis sapien sed laoreet interdum." | ||
* ) | ||
* ), | ||
* @OA\Property(property="tags",type="array",@OA\Items(ref="#/components/schemas/Tag")) | ||
* ) | ||
* | ||
* ) | ||
* ) | ||
* ) | ||
* ), | ||
* | ||
* | ||
* @OA\Schema( | ||
* schema="Tag", | ||
* type="object", | ||
* @OA\Property(property="id", type="integer", example=1), | ||
* @OA\Property(property="name", type="string", example="JavaScript"), | ||
* example={"id": 1, "name": "JavaScript"} | ||
* ) | ||
* ) | ||
*/ | ||
public function __invoke() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\api; | ||
|
||
use App\Http\Controllers\Controller; | ||
|
||
class StudentDetailController extends Controller | ||
{ | ||
public function __invoke() | ||
{ | ||
$data = file_get_contents(base_path('database/data/studentDetail.json')); | ||
|
||
return response()->json(json_decode($data, true)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[ | ||
{ | ||
"student_id": 1, | ||
"profile_detail": { | ||
"fullname": "Juan Pérez", | ||
"subtitle": "Desarrollador Frontend", | ||
"social_media": { | ||
"linkedin": { | ||
"url": "https://es.linkedin.com/" | ||
}, | ||
"github": { | ||
"url": "https://github.com/" | ||
|
||
} | ||
}, | ||
"about": { | ||
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam a euismod elit. Nunc elit ante, vulputate sed maximus eu, posuere eu nibh. In eget lacus in mi pharetra volutpat a a justo. Fusce aliquet nibh nec accumsan facilisis. Suspendisse in tempor nibh, eu fermentum velit. Suspendisse cursus ultricies ipsum, eget tincidunt arcu pretium laoreet. Pellentesque eget egestas erat. Donec dapibus pharetra ultrices. Vivamus mollis sapien sed laoreet interdum." | ||
|
||
}, | ||
"tags": [ | ||
{ | ||
"id": 1, | ||
"name": "JavaScript" | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "React" | ||
}, | ||
{ | ||
"id": 3, | ||
"name": "HTML" | ||
}, | ||
{ | ||
"id": 4, | ||
"name": "CSS" | ||
} | ||
] | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters