feat: add cache to getAssoInfo
This commit is contained in:
parent
beb40db1b1
commit
645949a2f6
@ -23,6 +23,8 @@ public class AssoEndpoints {
|
||||
return stateIdService.get_status(stateId).onFailure().transform(throwable -> {
|
||||
if (throwable instanceof WebApplicationException exception) {
|
||||
if (exception.getResponse().getStatus() == 404)
|
||||
return new DNotFoundException("Service momentanément indisponible");
|
||||
if (exception.getResponse().getStatus() == 400)
|
||||
return new DNotFoundException("Asso introuvable");
|
||||
}
|
||||
return throwable;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package fr.titionfire.ffsaf.rest.client;
|
||||
|
||||
import fr.titionfire.ffsaf.rest.data.AssoData;
|
||||
import io.quarkus.cache.CacheResult;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
@ -13,5 +14,6 @@ public interface StateIdService {
|
||||
|
||||
@GET
|
||||
@Path("/structure/{id}")
|
||||
@CacheResult(cacheName = "AssoData_status")
|
||||
Uni<AssoData> get_status(@PathParam("id") String id);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user