auth listo y contador terminados

This commit is contained in:
2025-09-10 17:36:04 -04:00
commit bdefcf5162
21 changed files with 1090 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
package com.example.fercoganbackend.entity;
public enum Rol {
SUPER_USUARIO, ADMIN, COLABORADOR, CLIENTE
}

View File

@@ -0,0 +1,67 @@
package com.example.fercoganbackend.entity;
import jakarta.persistence.*;
import java.util.Set;
@Entity
public class Usuario {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String username;
private String password;
@Column(nullable = false)
private Boolean aprobado = false;
@ElementCollection(fetch = FetchType.EAGER)
@Enumerated(EnumType.STRING)
private Set<Rol> roles; // aquí consumes el enum
// getters y setters
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public boolean isAprobado() {
return aprobado;
}
public void setAprobado(boolean aprobado) {
this.aprobado = aprobado;
}
public Set<Rol> getRoles() {
return roles;
}
public void setRoles(Set<Rol> roles) {
this.roles = roles;
}
}