| 
														
															@@ -22,6 +22,8 @@ import org.springframework.web.client.RestTemplate; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import es.uv.garcosda.shared.domain.Mail; 
														 | 
														
														 | 
														
															 import es.uv.garcosda.shared.domain.Mail; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 import es.uv.garcosda.shared.domain.MailDTO; 
														 | 
														
														 | 
														
															 import es.uv.garcosda.shared.domain.MailDTO; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import io.swagger.v3.oas.annotations.Operation; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+import io.swagger.v3.oas.annotations.security.SecurityRequirement; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 @RestController 
														 | 
														
														 | 
														
															 @RestController 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 @RequestMapping("/api/v1") 
														 | 
														
														 | 
														
															 @RequestMapping("/api/v1") 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -38,11 +40,15 @@ public class MailerController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	private String data_api; 
														 | 
														
														 | 
														
															 	private String data_api; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	 
														 | 
														
														 | 
														
															 	 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	@GetMapping("status") 
														 | 
														
														 | 
														
															 	@GetMapping("status") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	@SecurityRequirement(name = "Bearer Authentication") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	@Operation(summary="Is running?", description="Tests if the service is running") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	public ResponseEntity<String> test(){ 
														 | 
														
														 | 
														
															 	public ResponseEntity<String> test(){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		return new ResponseEntity<String>("Running", HttpStatus.OK); 
														 | 
														
														 | 
														
															 		return new ResponseEntity<String>("Running", HttpStatus.OK); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	} 
														 | 
														
														 | 
														
															 	} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	 
														 | 
														
														 | 
														
															 	 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	@GetMapping("{mail}") 
														 | 
														
														 | 
														
															 	@GetMapping("{mail}") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	@SecurityRequirement(name = "Bearer Authentication") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	@Operation(summary="Get inbox", description="Get inbox for a certain user by its email") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	public ResponseEntity<?> getMails(@PathVariable String mail, @RequestHeader("x-auth-user-id") String user){ 
														 | 
														
														 | 
														
															 	public ResponseEntity<?> getMails(@PathVariable String mail, @RequestHeader("x-auth-user-id") String user){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		ResponseEntity<MailDTO[]> response; 
														 | 
														
														 | 
														
															 		ResponseEntity<MailDTO[]> response; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		List<MailDTO> mails = new ArrayList<MailDTO>(); 
														 | 
														
														 | 
														
															 		List<MailDTO> mails = new ArrayList<MailDTO>(); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -66,6 +72,8 @@ public class MailerController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	} 
														 | 
														
														 | 
														
															 	} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	 
														 | 
														
														 | 
														
															 	 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	@DeleteMapping("{id}") 
														 | 
														
														 | 
														
															 	@DeleteMapping("{id}") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	@SecurityRequirement(name = "Bearer Authentication") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	@Operation(summary="Delete email", description="Delete one email by id") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	public ResponseEntity<?> deleteMail(@PathVariable String id){ 
														 | 
														
														 | 
														
															 	public ResponseEntity<?> deleteMail(@PathVariable String id){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		try { 
														 | 
														
														 | 
														
															 		try { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 			template.delete(input_api+"/"+id); 
														 | 
														
														 | 
														
															 			template.delete(input_api+"/"+id); 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -77,6 +85,8 @@ public class MailerController { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	} 
														 | 
														
														 | 
														
															 	} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	 
														 | 
														
														 | 
														
															 	 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	@PostMapping 
														 | 
														
														 | 
														
															 	@PostMapping 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	@SecurityRequirement(name = "Bearer Authentication") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	@Operation(summary="Send email", description="Send email to a user") 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	public ResponseEntity<?> sendMail(@RequestBody Mail mail){		 
														 | 
														
														 | 
														
															 	public ResponseEntity<?> sendMail(@RequestBody Mail mail){		 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		ResponseEntity<Mail> response; 
														 | 
														
														 | 
														
															 		ResponseEntity<Mail> response; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		try { 
														 | 
														
														 | 
														
															 		try { 
														 |