Skip to content

Commit

Permalink
#662 add endpoints for accessing other user's info (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
Legervad authored Dec 23, 2023
1 parent fa4ddb0 commit 2bddd01
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ class UserController (
return userService.getCreatedPosts(userId)
}

@GetMapping("/created-posts/{userId}")
@ResponseStatus(HttpStatus.OK)
fun getCreatedPostsByUserId(@PathVariable userId: Long): List<PostDTO>{
return userService.getCreatedPosts(userId)
}

@GetMapping("/created-games")
@ResponseStatus(HttpStatus.OK)
fun getCreatedGames(@CookieValue("SESSIONID") sessionId: UUID): List<GameDTO>{
Expand All @@ -62,6 +68,12 @@ class UserController (
return userService.getCreatedGames(userId)
}

@GetMapping("/created-games/{userId}")
@ResponseStatus(HttpStatus.OK)
fun getCreatedGamesByUserId(@PathVariable userId: Long): List<GameDTO>{
return userService.getCreatedGames(userId)
}

@GetMapping("/liked-posts")
@ResponseStatus(HttpStatus.OK)
fun getLikedPosts(@CookieValue("SESSIONID") sessionId: UUID): List<PostDTO>{
Expand All @@ -70,6 +82,12 @@ class UserController (
return userService.getLikedPosts(userId)
}

@GetMapping("/liked-posts/{userId}")
@ResponseStatus(HttpStatus.OK)
fun getLikedPostsByUserId(@PathVariable userId: Long): List<PostDTO>{
return userService.getLikedPosts(userId)
}

@GetMapping("/liked-comments")
@ResponseStatus(HttpStatus.OK)
fun getLikedComments(@CookieValue("SESSIONID") sessionId: UUID): List<CommentDTO>{
Expand All @@ -78,6 +96,12 @@ class UserController (
return userService.getLikedComments(userId)
}

@GetMapping("/liked-comments/{userId}")
@ResponseStatus(HttpStatus.OK)
fun getLikedCommentsByUserId(@PathVariable userId: Long): List<CommentDTO>{
return userService.getLikedComments(userId)
}

@PutMapping("/follow-user/{userIdToBeFollowed}")
@ResponseStatus(HttpStatus.OK)
fun followUser(
Expand Down

0 comments on commit 2bddd01

Please sign in to comment.