Test users databse
This commit is contained in:
parent
2202700bc7
commit
0b241bd8b5
@ -1,16 +1,20 @@
|
||||
package com.covas;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.Month;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.security.PermitAll;
|
||||
import javax.annotation.security.RolesAllowed;
|
||||
import javax.inject.Inject;
|
||||
import javax.transaction.TransactionScoped;
|
||||
import javax.transaction.Transactional;
|
||||
import javax.ws.rs.CookieParam;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.InternalServerErrorException;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
@ -32,8 +36,9 @@ public class TokenRessource {
|
||||
@Inject
|
||||
JsonWebToken jwt;
|
||||
|
||||
|
||||
@Inject JWTParser parser;
|
||||
|
||||
|
||||
|
||||
@GET
|
||||
@Path("authentificate")
|
||||
|
20
src/main/java/com/covas/Users.java
Normal file
20
src/main/java/com/covas/Users.java
Normal 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();
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,13 @@
|
||||
smallrye.jwt.sign.key.location=privateKey.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
|
Loading…
x
Reference in New Issue
Block a user