Initial commit - cleaned for CV

This commit is contained in:
Renato97
2026-03-31 01:28:28 -03:00
commit ce9f0d5180
203 changed files with 50950 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
package models
import (
"time"
"github.com/google/uuid"
)
type Usuario struct {
ID uuid.UUID `json:"id"`
Email string `json:"email"`
Username string `json:"username"`
PasswordHash string `json:"-"`
Nombre string `json:"nombre"`
Rol string `json:"rol"` // admin, estudiante
CreadoEn time.Time `json:"creado_en"`
UltimoLogin *time.Time `json:"ultimo_login"`
Activo bool `json:"activo"`
}
type UsuarioCreate struct {
Username string `json:"username" binding:"required"`
Email string `json:"email"`
Password string `json:"password"`
Nombre string `json:"nombre" binding:"required"`
Rol string `json:"rol"`
}
type UsuarioUpdate struct {
Email string `json:"email"`
Nombre string `json:"nombre"`
Activo *bool `json:"activo"`
}
type LoginRequest struct {
Email string `json:"email"`
Username string `json:"username"`
Password string `json:"password" binding:"required"`
}
type LoginResponse struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
ExpiresIn int `json:"expires_in"` // seconds
User *Usuario `json:"user"`
}
type RefreshRequest struct {
RefreshToken string `json:"refresh_token" binding:"required"`
}