3.1-3.6: install l5-swagger, add @OA annotations to all controllers
Deploy Backend / deploy (push) Failing after 2m16s
Deploy Backend / deploy (push) Failing after 2m16s
This commit is contained in:
1 parent
37dd2c9d54
commit
a4025256d4
13 files changed
+1367
-73
No files matched your search
@@ -5,8 +5,20 @@ namespace App\Http\Controllers\Api\Website;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Website\Service;
|
||||
|
||||
/**
|
||||
* @OA\Tag(name="Services", description="Services section endpoints")
|
||||
*/
|
||||
class ServiceController extends Controller
|
||||
{
|
||||
/**
|
||||
* @OA\Get(
|
||||
* path="/website/services/{locale}",
|
||||
* tags={"Services"},
|
||||
* summary="List all services in a given locale",
|
||||
* @OA\Parameter(name="locale", in="path", required=true, @OA\Schema(type="string", enum={"fa","en"})),
|
||||
* @OA\Response(response=200, description="OK", @OA\JsonContent(type="array", @OA\Items(ref="#/components/schemas/Service")))
|
||||
* )
|
||||
*/
|
||||
public function index($locale)
|
||||
{
|
||||
$services = Service::all();
|
||||
@@ -26,6 +38,16 @@ class ServiceController extends Controller
|
||||
return response()->json($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* @OA\Get(
|
||||
* path="/website/services/{id}/translation/{locale}",
|
||||
* tags={"Services"},
|
||||
* summary="Get a single service translation",
|
||||
* @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")),
|
||||
* @OA\Parameter(name="locale", in="path", required=true, @OA\Schema(type="string", enum={"fa","en"})),
|
||||
* @OA\Response(response=200, description="OK")
|
||||
* )
|
||||
*/
|
||||
public function showTranslation($id, $locale)
|
||||
{
|
||||
$service = Service::findOrFail($id);
|
||||
|
||||
Reference in new issue
Block a user