database #2

Merged
v4l3n71n merged 21 commits from database into master 2022-05-13 17:56:08 +00:00
3 changed files with 36 additions and 4 deletions
Showing only changes of commit 0b241bd8b5 - Show all commits

View File

@ -1,16 +1,20 @@
package com.covas; package com.covas;
import java.time.LocalDate;
import java.time.Month;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import javax.annotation.PostConstruct;
import javax.annotation.security.PermitAll; import javax.annotation.security.PermitAll;
import javax.annotation.security.RolesAllowed; import javax.annotation.security.RolesAllowed;
import javax.inject.Inject; import javax.inject.Inject;
import javax.transaction.TransactionScoped;
import javax.transaction.Transactional;
import javax.ws.rs.CookieParam; import javax.ws.rs.CookieParam;
import javax.ws.rs.GET; import javax.ws.rs.GET;
import javax.ws.rs.InternalServerErrorException; import javax.ws.rs.InternalServerErrorException;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.core.Context; import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
@ -32,6 +36,7 @@ public class TokenRessource {
@Inject @Inject
JsonWebToken jwt; JsonWebToken jwt;
@Inject JWTParser parser; @Inject JWTParser parser;

View File

@ -0,0 +1,20 @@
package com.covas;
import java.time.LocalDate;
import javax.persistence.Entity;
import io.quarkus.hibernate.orm.panache.PanacheEntity;
@Entity
public class Users extends PanacheEntity {
public String name;
public LocalDate birth;
public Boolean status;
public static Users findByName(String name){
return find("name", name).firstResult();
}
}

View File

@ -1,6 +1,13 @@
smallrye.jwt.sign.key.location=privateKey.pem smallrye.jwt.sign.key.location=privateKey.pem
mp.jwt.verify.publickey.location=publicKey.pem mp.jwt.verify.publickey.location=publicKey.pem
mp.jwt.verify.issuer=https://example.com/issuer mp.jwt.verify.issuer=https://example.com/issuer
quarkus.datasource.db-kind = postgresql
quarkus.datasource.username = toto
quarkus.datasource.password = toto
quarkus.datasource.jdbc.url = jdbc:postgresql://localhost:5432/toto
# drop and create the database at startup (use `update` to only update the schema)
quarkus.hibernate-orm.database.generation = drop-and-create