File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
server/src/main/java/voldemort/writter/server/rest Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -50,18 +50,24 @@ public ResponseEntity<Story> getStory(@PathVariable() Long storyId) {
50
50
}
51
51
52
52
@ GetMapping ("/user" )
53
- public ResponseEntity <List <Story >> getStoryByUser () {
53
+ public ResponseEntity <List <Story >> getStoriesForUser () {
54
54
User user = AuthenticationUtils .getCurrentUser ();
55
55
return new ResponseEntity <List <Story >>(storyDao .findByUser (user ), HttpStatus .OK );
56
56
}
57
57
58
58
@ GetMapping ("/user/{userId}" )
59
- public ResponseEntity <List <Story >> getStoryByUser (@ PathVariable () Long userId ) {
59
+ public ResponseEntity <List <Story >> getStoriesByUser (@ PathVariable () Long userId ) {
60
60
return new ResponseEntity <List <Story >>(storyDao .findByUser (new User (userId )), HttpStatus .OK );
61
61
}
62
62
63
+ @ GetMapping ("/recommended" )
64
+ public ResponseEntity <List <Story >> getRecommendedStories () {
65
+ User user = AuthenticationUtils .getCurrentUser ();
66
+ return new ResponseEntity <>(recommendationDao .findAllRecommended (new User (user .getId ())), HttpStatus .OK );
67
+ }
68
+
63
69
@ GetMapping ("/recommended/{userId}" )
64
- public ResponseEntity <List <Story >> getRecommendedStory (@ PathVariable () Long userId ) {
70
+ public ResponseEntity <List <Story >> getRecommendedStories (@ PathVariable () Long userId ) {
65
71
return new ResponseEntity <>(recommendationDao .findAllRecommended (new User (userId )), HttpStatus .OK );
66
72
}
67
73
You can’t perform that action at this time.
0 commit comments