generated from Thomas-More-Digital-Innovation/2223-DI000-TemplateRepo
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #119 from Thomas-More-Digital-Innovation/sva-vrage…
…nlijst-actief Sva vragenlijst actief
- Loading branch information
Showing
2 changed files
with
279 additions
and
0 deletions.
There are no files selected for viewing
275 changes: 275 additions & 0 deletions
275
code/webapp/app/Http/Controllers/Api/QuestionListController.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,275 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Api; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Http\Requests\StoreQuestionListRequest; | ||
use App\Models\QuestionList; | ||
use Illuminate\Http\Request; | ||
|
||
/** | ||
* @OA\Schema( | ||
* schema="QuestionList", | ||
* @OA\Property( | ||
* property="id", | ||
* type="integer", | ||
* format="int64", | ||
* example=1 | ||
* ), | ||
* @OA\Property( | ||
* property="questionList", | ||
* type="string", | ||
* example="QuestionList 1" | ||
* ), | ||
* @OA\Property( | ||
* property="answer", | ||
* type="string", | ||
* example="Answer 1" | ||
* ), | ||
* @OA\Property( | ||
* property="created_at", | ||
* type="string", | ||
* format="date-time", | ||
* example="2021-05-01 12:00:00" | ||
* ), | ||
* @OA\Property( | ||
* property="updated_at", | ||
* type="string", | ||
* format="date-time", | ||
* example="2021-05-01 12:00:00" | ||
* ), | ||
* ) | ||
* @OA\Get( | ||
* path="/api/questionLists", | ||
* tags={"questionLists"}, | ||
* summary="Get list of questionLists", | ||
* description="Returns list of questionLists", | ||
* operationId="questionListsIndex", | ||
* @OA\Parameter( | ||
* name="Authorization", | ||
* description="Bearer {token}", | ||
* in="header", | ||
* required=true, | ||
* ), | ||
* @OA\Response( | ||
* response=200, | ||
* description="successful operation", | ||
* @OA\JsonContent( | ||
* @OA\Property( | ||
* property="status", | ||
* type="boolean", | ||
* example=true | ||
* ), | ||
* @OA\Property( | ||
* property="questionLists", | ||
* type="array", | ||
* @OA\Items(ref="#/components/schemas/QuestionList") | ||
* ) | ||
* ) | ||
* ), | ||
* @OA\Response( | ||
* response=401, | ||
* description="Unauthorized", | ||
* ) | ||
* ) | ||
* @OA\Post( | ||
* path="/api/questionLists", | ||
* tags={"questionLists"}, | ||
* summary="Create new questionList", | ||
* description="Create new questionList", | ||
* operationId="questionListsStore", | ||
* @OA\Parameter( | ||
* name="Authorization", | ||
* description="Bearer {token}", | ||
* in="header", | ||
* required=true, | ||
* ), | ||
* @OA\RequestBody( | ||
* required=true, | ||
* @OA\JsonContent(ref="#/components/schemas/QuestionList") | ||
* ), | ||
* @OA\Response( | ||
* response=200, | ||
* description="successful operation", | ||
* @OA\JsonContent( | ||
* @OA\Property( | ||
* property="status", | ||
* type="boolean", | ||
* example=true | ||
* ), | ||
* @OA\Property( | ||
* property="questionList", | ||
* ref="#/components/schemas/QuestionList" | ||
* ) | ||
* ) | ||
* ), | ||
* @OA\Response( | ||
* response=401, | ||
* description="Unauthorized" | ||
* ), | ||
* ) | ||
* @OA\Patch( | ||
* path="/api/questionLists/{id}", | ||
* tags={"questionLists"}, | ||
* summary="Update QuestionList", | ||
* description="Update QuestionList", | ||
* operationId="questionListsUpdate", | ||
* @OA\Parameter( | ||
* name="Authorization", | ||
* description="Bearer {token}", | ||
* in="header", | ||
* required=true, | ||
* ), | ||
* @OA\Parameter( | ||
* name="id", | ||
* description="QuestionList id", | ||
* in="path", | ||
* required=true, | ||
* ), | ||
* @OA\RequestBody( | ||
* required=true, | ||
* @OA\JsonContent(ref="#/components/schemas/QuestionList") | ||
* ), | ||
* @OA\Response( | ||
* response=200, | ||
* description="successful operation", | ||
* @OA\JsonContent( | ||
* @OA\Property( | ||
* property="status", | ||
* type="boolean", | ||
* example=true | ||
* ), | ||
* @OA\Property( | ||
* property="questionList", | ||
* ref="#/components/schemas/QuestionList" | ||
* ), | ||
* ), | ||
* ), | ||
* @OA\Response( | ||
* response=401, | ||
* description="Unauthorized" | ||
* ), | ||
* ) | ||
* @OA\Delete( | ||
* path="/api/questionLists/{id}", | ||
* tags={"questionLists"}, | ||
* summary="Delete question", | ||
* description="Delete question", | ||
* operationId="questionsDestroy", | ||
* @OA\Parameter( | ||
* name="Authorization", | ||
* description="Bearer {token}", | ||
* in="header", | ||
* required=true, | ||
* ), | ||
* @OA\Parameter( | ||
* name="id", | ||
* description="Question id", | ||
* in="path", | ||
* required=true, | ||
* ), | ||
* @OA\Response( | ||
* response=200, | ||
* description="successful operation", | ||
* @OA\JsonContent( | ||
* @OA\Property( | ||
* property="status", | ||
* type="boolean", | ||
* example=true | ||
* ), | ||
* @OA\Property( | ||
* property="question", | ||
* ref="#/components/schemas/Question" | ||
* ), | ||
* ), | ||
* ), | ||
* @OA\Response( | ||
* response=401, | ||
* description="Unauthorized" | ||
* ), | ||
* ) | ||
*/ | ||
|
||
class QuestionListController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function index() | ||
{ | ||
$questionLists = QuestionList::all(); | ||
|
||
return response()->json([ | ||
"status" => true, | ||
"questionLists" => [$questionLists], | ||
]); | ||
} | ||
|
||
/** | ||
* Display the specified resource. | ||
* | ||
* @param \App\Models\QuestionList $questionList | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function show(QuestionList $questionList) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Show the form for creating a new resource. | ||
* | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function create() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function store(StoreQuestionRequest $request) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Show the form for editing the specified resource. | ||
* | ||
* @param \App\Models\QuestionList $questionList | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function edit(QuestionList $questionList) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \App\Models\QuestionList $questionList | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function update(StoreQuestionListRequest $request, QuestionList $questionList) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
* | ||
* @param \App\Models\QuestionList $questionList | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function destroy(QuestionList $questionList) | ||
{ | ||
// | ||
} | ||
} |
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