@RestController
@RequestMapping(value="/api/posts/")
public class PostController
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private PostService |
postService |
Constructor and Description |
---|
PostController() |
Modifier and Type | Method and Description |
---|---|
org.springframework.http.ResponseEntity<java.lang.Void> |
createPost(PostRequest postRequest) |
org.springframework.http.ResponseEntity<java.util.List<PostResponse>> |
getAllPosts() |
org.springframework.http.ResponseEntity<PostResponse> |
getPost(java.lang.Long id) |
org.springframework.http.ResponseEntity<java.util.List<PostResponse>> |
getPostsByGuild(java.lang.Long id) |
org.springframework.http.ResponseEntity<java.util.List<PostResponse>> |
getPostsByUsername(java.lang.String username) |
private final PostService postService
@PostMapping public org.springframework.http.ResponseEntity<java.lang.Void> createPost(@RequestBody PostRequest postRequest)
@GetMapping public org.springframework.http.ResponseEntity<java.util.List<PostResponse>> getAllPosts()
@GetMapping(value="/{id}") public org.springframework.http.ResponseEntity<PostResponse> getPost(@PathVariable java.lang.Long id)
@GetMapping(value="by-guild/{id}") public org.springframework.http.ResponseEntity<java.util.List<PostResponse>> getPostsByGuild(java.lang.Long id)
@GetMapping(value="by-user/{name}") public org.springframework.http.ResponseEntity<java.util.List<PostResponse>> getPostsByUsername(java.lang.String username)