Skip to content
Snippets Groups Projects
Commit 320c2916 authored by Martin Gargalovič's avatar Martin Gargalovič
Browse files

added get and delete mail

parent a0277648
No related branches found
No related tags found
1 merge request!12Mail module
package org.fuseri.modulemail.service; package org.fuseri.modulemail.service;
import jakarta.websocket.server.PathParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -19,6 +23,17 @@ public class MailControler { ...@@ -19,6 +23,17 @@ public class MailControler {
this.service = service; this.service = service;
} }
@GetMapping("/{id}")
public ResponseEntity getEmail(@PathVariable("id") Long id) {
return ResponseEntity.ok(service.getMail(id).toString());
}
@DeleteMapping("/delete/{id}")
public ResponseEntity deleteMail(@PathVariable("id") Long id) {
return ResponseEntity.ok(service.DeleteMail(id));
}
@PostMapping() @PostMapping()
public ResponseEntity sendMail(@RequestBody EmailDto emailDto) { public ResponseEntity sendMail(@RequestBody EmailDto emailDto) {
return ResponseEntity.ok(service.send(emailDto)); return ResponseEntity.ok(service.send(emailDto));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment