Test users databse
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user