feat: finished implementing apiService functions
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package enseirb.myinpulse.controller;
|
||||
|
||||
import com.itextpdf.text.DocumentException;
|
||||
|
||||
import enseirb.myinpulse.model.*;
|
||||
import enseirb.myinpulse.service.SharedApiService;
|
||||
|
||||
@ -10,7 +11,8 @@ import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||
import org.springframework.security.oauth2.jwt.Jwt;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
@SpringBootApplication
|
||||
@RestController
|
||||
@ -83,10 +85,12 @@ public class SharedApi {
|
||||
@PathVariable int appointmentId, @AuthenticationPrincipal Jwt principal) {
|
||||
try {
|
||||
sharedApiService.getPDFReport(appointmentId, principal.getClaimAsString("email"));
|
||||
} catch (FileNotFoundException e) {
|
||||
System.out.println(e + "File not found");
|
||||
} catch (DocumentException e) {
|
||||
System.out.println(e + "Document exception");
|
||||
} catch (URISyntaxException e) {
|
||||
System.out.println(e + "Error with URI");
|
||||
} catch (IOException e) {
|
||||
System.out.println(e + "Failed to access file");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user