|
@@ -2,8 +2,12 @@ package es.uv.garcosda.controllers;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
|
+import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
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;
|
|
|
|
|
@@ -24,4 +28,19 @@ public class NewsController {
|
|
|
return this.ns.findById(id);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping()
|
|
|
+ public Mono<Document> insert(@RequestBody Document n){
|
|
|
+ return this.ns.insert(n);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping()
|
|
|
+ public Mono<Document> update(@RequestBody Document n){
|
|
|
+ return this.ns.update(n);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("{id}")
|
|
|
+ public Mono<Void> delete(@PathVariable("id") Integer id){
|
|
|
+ return this.ns.deleteById(id);
|
|
|
+ }
|
|
|
+
|
|
|
}
|