Skip to content
Snippets Groups Projects
Commit 2ca6b873 authored by Martin Slovík's avatar Martin Slovík
Browse files

Implementing AirplaneTypeDto endpoints.

parent 5add05e9
No related branches found
No related tags found
No related merge requests found
package cz.muni.fi.pa165.core.rest;
import cz.muni.fi.pa165.core.api.AirplaneTypeApiDelegate;
import cz.muni.fi.pa165.core.model.AirplaneTypeDto;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
public class AirplaneTypeController implements AirplaneTypeApiDelegate {
@Override
public ResponseEntity<AirplaneTypeDto> createAirplaneType(AirplaneTypeDto airplaneTypeDto) {
return AirplaneTypeApiDelegate.super.createAirplaneType(airplaneTypeDto);
}
@Override
public ResponseEntity<Void> deleteAirplaneType(Long id) {
return AirplaneTypeApiDelegate.super.deleteAirplaneType(id);
}
@Override
public ResponseEntity<AirplaneTypeDto> getAirplaneTypeById(Long id) {
return AirplaneTypeApiDelegate.super.getAirplaneTypeById(id);
}
@Override
public ResponseEntity<List<AirplaneTypeDto>> getAllAirplaneTypes() {
return AirplaneTypeApiDelegate.super.getAllAirplaneTypes();
}
@Override
public ResponseEntity<AirplaneTypeDto> updateAirplaneType(Long id, AirplaneTypeDto airplaneTypeDto) {
return AirplaneTypeApiDelegate.super.updateAirplaneType(id, airplaneTypeDto);
}
}
......@@ -387,6 +387,122 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
/api/airplaneTypes:
get:
tags:
- AirplaneType
summary: Get all airplane types.
description: |
Returns an array of objects representing airplane types.
operationId: getAllAirplaneTypes
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/AirplaneTypeDto'
post:
tags:
- AirplaneType
summary: Create a new airplane type.
description: Creates a new airplane type and returns it as a response.
operationId: createAirplaneType
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AirplaneTypeDto'
required: true
responses:
"201":
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/AirplaneTypeDto'
"400":
description: Input data not correct
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
/api/airplaneTypes/{id}:
get:
tags:
- AirplaneType
summary: Get airplane type by id.
description: Returns an object representing an airplane type.
operationId: getAirplaneTypeById
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/AirplaneTypeDto'
delete:
tags:
- AirplaneType
summary: Delete airplane type by id.
operationId: deleteAirplaneType
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
responses:
"204":
description: Deleted
"404":
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
put:
tags:
- AirplaneType
summary: Update airplane type by id.
operationId: updateAirplaneType
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
description: Updates a airplane type by id and returns it as a response.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AirplaneTypeDto'
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/AirplaneTypeDto'
"400":
description: Input data not correct
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorMessage'
components:
schemas:
DomainEntity:
......@@ -457,13 +573,10 @@ components:
items:
$ref: '#/components/schemas/FlightDto'
NewStewardDtoRequest:
allOf:
- $ref: '#/components/schemas/DomainEntity'
type: object
title: New Steward Request
description: Object for requesting a new Steward.
required:
- id
- firstName
- lastName
properties:
......@@ -506,13 +619,10 @@ components:
airplane:
$ref: '#/components/schemas/AirplaneDto'
NewFlightDtoRequest:
allOf:
- $ref: '#/components/schemas/DomainEntity'
type: object
title: New Flight Request
description: Object for requesting a new Flight.
required:
- id
- departureTime
- arrivalTime
properties:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment