Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PA165 - Airport - project
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ján Macháček
PA165 - Airport - project
Commits
2ca6b873
There was an error fetching the commit references. Please try again later.
Commit
2ca6b873
authored
1 year ago
by
Martin Slovík
Browse files
Options
Downloads
Patches
Plain Diff
Implementing AirplaneTypeDto endpoints.
parent
5add05e9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/src/main/java/cz/muni/fi/pa165/core/rest/AirplaneTypeController.java
+37
-0
37 additions, 0 deletions
...va/cz/muni/fi/pa165/core/rest/AirplaneTypeController.java
openapi.yaml
+116
-6
116 additions, 6 deletions
openapi.yaml
with
153 additions
and
6 deletions
core/src/main/java/cz/muni/fi/pa165/core/rest/AirplaneTypeController.java
0 → 100644
+
37
−
0
View file @
2ca6b873
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
);
}
}
This diff is collapsed.
Click to expand it.
openapi.yaml
+
116
−
6
View file @
2ca6b873
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment