Archived
Add update route for posts
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.codiki.posts;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -17,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -113,4 +115,10 @@ public class PostController {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@PutMapping("/")
|
||||
public void update(@RequestBody final PostDTO pPost, final HttpServletRequest pRequest,
|
||||
final HttpServletResponse pResponse) throws IOException {
|
||||
postService.update(pPost, pRequest, pResponse);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user