Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend_fullstack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
team_fullastack
backend_fullstack
Merge requests
!2
added more fields to the trivio entity
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
added more fields to the trivio entity
rest-endpoints
into
main
Overview
0
Commits
1
Pipelines
0
Changes
6
Merged
Tini Tran
requested to merge
rest-endpoints
into
main
1 year ago
Overview
0
Commits
1
Pipelines
0
Changes
6
Expand
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
dfe96b74
1 commit,
1 year ago
6 files
+
188
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
src/main/java/ntnu/idatt2105/group44/trivioServer/controller/ResultController.java
0 → 100644
+
36
−
0
Options
package
ntnu.idatt2105.group44.trivioServer.controller
;
import
ntnu.idatt2105.group44.trivioServer.dto.ResultDTO
;
import
ntnu.idatt2105.group44.trivioServer.model.Result
;
import
ntnu.idatt2105.group44.trivioServer.repository.ResultRepository
;
import
ntnu.idatt2105.group44.trivioServer.service.ResultService
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"results"
)
public
class
ResultController
{
private
final
ResultService
resultService
;
public
ResultController
(
ResultService
resultService
){
this
.
resultService
=
resultService
;
}
@GetMapping
(
path
=
"{userId}"
)
public
Result
getResultByUserId
(
@PathVariable
Long
userId
){
return
resultService
.
getResultbyId
(
userId
);
}
// test det senere
@PostMapping
public
ResponseEntity
<
String
>
postResult
(
@RequestBody
ResultDTO
resultDTO
){
resultService
.
addResult
(
resultDTO
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
}
}
Loading