mirror of
https://github.com/usatiuk/y.git
synced 2025-10-28 18:37:47 +01:00
basic feed
This commit is contained in:
@@ -47,12 +47,12 @@ public class PostController {
|
||||
@GetMapping(path = "/by-author-username")
|
||||
public Stream<PostTo> readAllByAuthorUsername(@RequestParam Optional<String> author) {
|
||||
if (author.isPresent())
|
||||
return postService.readByAuthorId(author.get()).stream().map(PostMapper::makeDto);
|
||||
return postService.readByAuthorUsername(author.get()).stream().map(PostMapper::makeDto);
|
||||
else
|
||||
throw new ResponseStatusException(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
@GetMapping(path = "/following")
|
||||
@GetMapping(path = "/by-following")
|
||||
public Stream<PostTo> readAllByFollowees(Principal principal) {
|
||||
return postService.readByPersonFollowees(principal.getName()).stream().map(PostMapper::makeDto);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user