Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PA165 Formula One Team
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Diana Gulčíková
PA165 Formula One Team
Commits
d2353ce9
There was an error fetching the commit references. Please try again later.
Commit
d2353ce9
authored
1 year ago
by
Andrej Šimurka
Browse files
Options
Downloads
Patches
Plain Diff
Set json example for rest endpoint
parent
1479c190
No related branches found
No related tags found
2 merge requests
!60
Docker
,
!37
13 fixes by andrej
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common_library/src/main/resources.mv.db
+0
-0
0 additions, 0 deletions
common_library/src/main/resources.mv.db
driver/src/main/java/cz/muni/pa165/driver/rest/DriverController.java
+10
-1
10 additions, 1 deletion
...main/java/cz/muni/pa165/driver/rest/DriverController.java
with
10 additions
and
1 deletion
common_library/src/main/resources.mv.db
+
0
−
0
View file @
d2353ce9
No preview for this file type
This diff is collapsed.
Click to expand it.
driver/src/main/java/cz/muni/pa165/driver/rest/DriverController.java
+
10
−
1
View file @
d2353ce9
...
...
@@ -8,6 +8,7 @@ import cz.muni.pa165.common_library.dtos.DriverUpdateDto;
import
cz.muni.pa165.driver.service.CarService
;
import
cz.muni.pa165.driver.service.DriverService
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
jakarta.validation.Valid
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -44,7 +45,15 @@ public class DriverController {
@PostMapping
(
path
=
"/add"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
ResponseEntity
<
DriverResponseDto
>
addDriver
(
@Valid
@RequestBody
DriverAddDto
driverAddDto
)
{
@Valid
@RequestBody
@Schema
(
example
=
"{\"name\":\"Fernando\", "
+
"\"surname\": \"Alonso\", "
+
"\"nationality\": \"Spanish\", "
+
"\"characteristics\" : {\"Experience\" : 1,"
+
" \"Aggressiveness\" : 1,"
+
" \"Consistency\" : 1,"
+
" \"Racecraft\" : 1 }}"
)
DriverAddDto
driverAddDto
)
{
return
ResponseEntity
.
ok
(
driverService
.
addDriver
(
driverAddDto
));
}
...
...
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