redis work in progress

This commit is contained in:
Valentin CZERYBA 2022-06-12 00:34:05 +02:00
parent 824d75dfcd
commit 180d25cfcb
3 changed files with 27 additions and 6 deletions

View File

@ -76,6 +76,10 @@
<groupId>io.quarkus</groupId> <groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-qute</artifactId> <artifactId>quarkus-resteasy-qute</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-redis-client</artifactId>
</dependency>
<dependency> <dependency>
<groupId>io.quarkus</groupId> <groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId> <artifactId>quarkus-junit5</artifactId>

View File

@ -1,8 +1,7 @@
package com.covas.Resources; package com.covas.Resources;
import java.util.Arrays;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Flow;
import javax.inject.Inject; import javax.inject.Inject;
import javax.ws.rs.GET; import javax.ws.rs.GET;
@ -13,8 +12,7 @@ import javax.ws.rs.core.Response;
import com.covas.Entity.UsersEntity; import com.covas.Entity.UsersEntity;
import io.quarkus.mailer.MailTemplate; import io.quarkus.mailer.MailTemplate;
import io.quarkus.qute.CheckedTemplate; import io.quarkus.redis.client.RedisClient;
import io.smallrye.mutiny.Uni;
@Path("mail") @Path("mail")
public class MailRessource { public class MailRessource {
@ -22,7 +20,8 @@ public class MailRessource {
@Inject @Inject
private MailTemplate mailer; private MailTemplate mailer;
@Inject
RedisClient redisClient;
@GET @GET
@ -43,5 +42,18 @@ public class MailRessource {
return Response.ok().build(); return Response.ok().build();
} }
@GET
@Path("set-redis")
public Response setRedis(){
redisClient.set(Arrays.asList("toto","sss"));
return Response.ok().build();
}
@GET
@Path("get-redis/{id}")
public Response getRedis(@PathParam("id") String id){
return Response.ok().entity(redisClient.get(id)).build();
}
} }

View File

@ -21,3 +21,8 @@ quarkus.mailer.start-tls=REQUIRED
quarkus.mailer.username=valczebackup@gmail.com quarkus.mailer.username=valczebackup@gmail.com
quarkus.mailer.password=aohrpmqvxldwyebs quarkus.mailer.password=aohrpmqvxldwyebs
quarkus.mailer.mock=false quarkus.mailer.mock=false
quarkus.redis.hosts=redis://localhost:6379