Add update route for posts

This commit is contained in:
Florian
2018-05-14 18:15:49 +02:00
parent 81aa3a6004
commit a1fb3298f9
2 changed files with 47 additions and 0 deletions
@@ -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);
}
}