@@ -13,6 +13,43 @@ import {verifyCaptcha} from '../common/VerifyCaptcha';
|
||||
*/
|
||||
export const climbingGymRouter = express.Router();
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /crr/gyms:
|
||||
* get:
|
||||
* summary: Retrieve all known climbing gyms
|
||||
* description: Returns all climbing gyms in a JSON list
|
||||
* tags:
|
||||
* - climbing-route-rating
|
||||
* responses:
|
||||
* 200:
|
||||
* description: Success
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: array
|
||||
* items:
|
||||
* type: object
|
||||
* properties:
|
||||
* gym_id:
|
||||
* type: integer
|
||||
* description: The gym id
|
||||
* example: 1
|
||||
* name:
|
||||
* type: string
|
||||
* description: The gym name
|
||||
* example: DAV Kletterhalle
|
||||
* city:
|
||||
* type: string
|
||||
* description: The city where the gym is in
|
||||
* example: Karlsruhe
|
||||
* verified:
|
||||
* type: boolean
|
||||
* description: If the gym is verified
|
||||
* example: 1
|
||||
* 500:
|
||||
* description: A server error occurred. Please try again. If this issue persists, contact the admin.
|
||||
*/
|
||||
climbingGymRouter.get('/', async (req: Request, res: Response) => {
|
||||
try {
|
||||
const gyms: ClimbingGym[] = await GymService.findAll();
|
||||
@@ -29,6 +66,52 @@ climbingGymRouter.get('/', async (req: Request, res: Response) => {
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /crr/gyms:
|
||||
* post:
|
||||
* summary: Create a new climbing gym
|
||||
* description: Creates a new climbing gym and returns the id of the created gym
|
||||
* tags:
|
||||
* - climbing-route-rating
|
||||
* responses:
|
||||
* 201:
|
||||
* description: Created
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* gym_id:
|
||||
* type: integer
|
||||
* description: The gym id
|
||||
* example: 1
|
||||
* 400:
|
||||
* description: Wrong parameters, see response body for detailed information
|
||||
* 403:
|
||||
* description: Invalid captcha, please try again.
|
||||
* 500:
|
||||
* description: A server error occurred. Please try again. If this issue persists, contact the admin.
|
||||
* parameters:
|
||||
* - in: query
|
||||
* name: name
|
||||
* required: true
|
||||
* description: The name of the gym
|
||||
* schema:
|
||||
* type: string
|
||||
* - in: query
|
||||
* name: city
|
||||
* required: true
|
||||
* description: The city where the gym is in
|
||||
* schema:
|
||||
* type: string
|
||||
* - in: query
|
||||
* name: h-captcha-response
|
||||
* required: true
|
||||
* description: The hCaptcha response key
|
||||
* schema:
|
||||
* type: string
|
||||
*/
|
||||
climbingGymRouter.post('/', async (req: Request, res: Response) => {
|
||||
try {
|
||||
let name = req.query.name as string;
|
||||
|
||||
@@ -26,7 +26,7 @@ export const raPlaMiddlewareRouter = express.Router();
|
||||
* 400:
|
||||
* description: Wrong parameters, see response body for detailed information
|
||||
* 500:
|
||||
* description: A server error occured. Please try again. If this issue persists, contact the admin.
|
||||
* description: A server error occurred. Please try again. If this issue persists, contact the admin.
|
||||
* parameters:
|
||||
* - in: query
|
||||
* name: user
|
||||
@@ -51,13 +51,13 @@ export const raPlaMiddlewareRouter = express.Router();
|
||||
* required: false
|
||||
* description: The chosen elective module which is not to be filtered out
|
||||
* schema:
|
||||
* type: number
|
||||
* type: integer
|
||||
* - in: query
|
||||
* name: pflicht
|
||||
* required: false
|
||||
* description: The chosen profile module which is not to be filtered out
|
||||
* schema:
|
||||
* type: number
|
||||
* type: integer
|
||||
*/
|
||||
raPlaMiddlewareRouter.get('/', async (req: Request, res: Response) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user