|
|
@@ -5,7 +5,6 @@ import java.time.LocalDateTime;
|
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
-import org.springframework.web.bind.annotation.CrossOrigin;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
@@ -41,14 +40,12 @@ public class ApiController {
|
|
|
this.repositoryUser = repositoryUser;
|
|
|
}
|
|
|
|
|
|
- @CrossOrigin(origins = "http://localhost:8081")
|
|
|
@GetMapping("/evenements")
|
|
|
public List<Evenement> getEvenements() {
|
|
|
return (List<Evenement>) repository.findByLastVersionIsTrue();
|
|
|
}
|
|
|
|
|
|
// Single evenement data
|
|
|
- @CrossOrigin(origins = "http://localhost:8081")
|
|
|
@GetMapping("/evenements/{uuid}")
|
|
|
String one(@PathVariable String uuid) {
|
|
|
List<Evenement> allVersions = repository.findFirst1ByUuidOrderByLastModifiedDesc(uuid);
|
|
|
@@ -59,7 +56,6 @@ public class ApiController {
|
|
|
.orElseThrow(() -> new EvenementNotFoundException(uuid)).getJsonContent();
|
|
|
}
|
|
|
|
|
|
- @CrossOrigin(origins = "http://localhost:8081")
|
|
|
@GetMapping("/evenements/history/{uuid}")
|
|
|
List<Evenement> history(@PathVariable String uuid) {
|
|
|
return repository.findByUuidOrderByLastModifiedDesc(uuid);
|