Private
Public Access
refactor: ahora los repos se acceden con un singleton en vez de inyecion
de dependencias
This commit is contained in:
1 parent
52fc779abd
commit
141715ee0a
22 files changed
+244
-211
No files matched your search
@@ -4,21 +4,13 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repuestera_back/dto"
|
"repuestera_back/dto"
|
||||||
repositorios "repuestera_back/repositorios"
|
r "repuestera_back/repositorios"
|
||||||
"repuestera_back/utils"
|
"repuestera_back/utils"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
)
|
)
|
||||||
|
|
||||||
var usuarioRepo repositorios.RepositorioUsuario
|
|
||||||
var grupoRepo repositorios.RepositorioGrupo
|
|
||||||
|
|
||||||
func InitUsuarioRepository(repo repositorios.RepositorioUsuario, repog repositorios.RepositorioGrupo) {
|
|
||||||
usuarioRepo = repo
|
|
||||||
grupoRepo = repog
|
|
||||||
}
|
|
||||||
|
|
||||||
func CambiarContraseña(c *gin.Context) {
|
func CambiarContraseña(c *gin.Context) {
|
||||||
var req dto.CambiarContraseñaRequest
|
var req dto.CambiarContraseñaRequest
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
@@ -46,7 +38,7 @@ func CambiarContraseña(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
user, err := usuarioRepo.ObtenerPorID(targetID)
|
user, err := r.ObtenerRepositorios().Usuario.ObtenerPorID(targetID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": "usuario no encontrado"})
|
c.JSON(http.StatusNotFound, gin.H{"error": "usuario no encontrado"})
|
||||||
return
|
return
|
||||||
@@ -69,7 +61,7 @@ func CambiarContraseña(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := usuarioRepo.ActualizarContraseña(user.ID, string(hashedPassword)); err != nil {
|
if err := r.ObtenerRepositorios().Usuario.ActualizarContraseña(user.ID, string(hashedPassword)); err != nil {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Error al actualizar la contraseña"})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": "Error al actualizar la contraseña"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import (
|
|||||||
"repuestera_back/dto"
|
"repuestera_back/dto"
|
||||||
"repuestera_back/jwtutils"
|
"repuestera_back/jwtutils"
|
||||||
models_seguridad "repuestera_back/models/seguridad"
|
models_seguridad "repuestera_back/models/seguridad"
|
||||||
|
r "repuestera_back/repositorios"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/golang-jwt/jwt/v5"
|
"github.com/golang-jwt/jwt/v5"
|
||||||
@@ -22,7 +23,7 @@ func Login(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
email := strings.ToLower(strings.TrimSpace(req.Email))
|
email := strings.ToLower(strings.TrimSpace(req.Email))
|
||||||
user, err := usuarioRepo.ObtenerPorEmail(email)
|
user, err := r.ObtenerRepositorios().Usuario.ObtenerPorEmail(email)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusUnauthorized, gin.H{"error": "Mail Invalido"})
|
c.JSON(http.StatusUnauthorized, gin.H{"error": "Mail Invalido"})
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
|
|
||||||
"repuestera_back/dto"
|
"repuestera_back/dto"
|
||||||
"repuestera_back/jwtutils"
|
"repuestera_back/jwtutils"
|
||||||
|
r "repuestera_back/repositorios"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/golang-jwt/jwt/v5"
|
"github.com/golang-jwt/jwt/v5"
|
||||||
@@ -50,7 +51,7 @@ func Me(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
userID, _ := strconv.ParseUint(sub, 10, 32)
|
userID, _ := strconv.ParseUint(sub, 10, 32)
|
||||||
user, err := usuarioRepo.ObtenerPorID(uint(userID))
|
user, err := r.ObtenerRepositorios().Usuario.ObtenerPorID(uint(userID))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": "user not found"})
|
c.JSON(http.StatusNotFound, gin.H{"error": "user not found"})
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
|
|
||||||
"repuestera_back/dto"
|
"repuestera_back/dto"
|
||||||
"repuestera_back/jwtutils"
|
"repuestera_back/jwtutils"
|
||||||
|
r "repuestera_back/repositorios"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/golang-jwt/jwt/v5"
|
"github.com/golang-jwt/jwt/v5"
|
||||||
@@ -42,7 +43,7 @@ func Refresh(c *gin.Context) {
|
|||||||
c.JSON(http.StatusUnauthorized, gin.H{"error": "invalid token claims"})
|
c.JSON(http.StatusUnauthorized, gin.H{"error": "invalid token claims"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
user, err := usuarioRepo.ObtenerPorID(uint(sub))
|
user, err := r.ObtenerRepositorios().Usuario.ObtenerPorID(uint(sub))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": "user not found"})
|
c.JSON(http.StatusNotFound, gin.H{"error": "user not found"})
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
|
|
||||||
"repuestera_back/dto"
|
"repuestera_back/dto"
|
||||||
models_seguridad "repuestera_back/models/seguridad"
|
models_seguridad "repuestera_back/models/seguridad"
|
||||||
|
r "repuestera_back/repositorios"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
@@ -20,7 +21,7 @@ func Register(c *gin.Context) {
|
|||||||
|
|
||||||
email := strings.ToLower(strings.TrimSpace(req.Email))
|
email := strings.ToLower(strings.TrimSpace(req.Email))
|
||||||
|
|
||||||
if _, err := usuarioRepo.ObtenerPorEmail(email); err == nil {
|
if _, err := r.ObtenerRepositorios().Usuario.ObtenerPorEmail(email); err == nil {
|
||||||
c.JSON(http.StatusConflict, gin.H{"error": "El email ya esta registrado"})
|
c.JSON(http.StatusConflict, gin.H{"error": "El email ya esta registrado"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -39,9 +40,9 @@ func Register(c *gin.Context) {
|
|||||||
|
|
||||||
//checkeo para ver si hay usuarios añadidos
|
//checkeo para ver si hay usuarios añadidos
|
||||||
var cantUsuarios int64
|
var cantUsuarios int64
|
||||||
usuarioRepo.CantidadUsuarios(&cantUsuarios)
|
r.ObtenerRepositorios().Usuario.CantidadUsuarios(&cantUsuarios)
|
||||||
if (cantUsuarios < 1){
|
if (cantUsuarios < 1){
|
||||||
admin, err := grupoRepo.ObtenerPorID(1)
|
admin, err := r.ObtenerRepositorios().Grupo.ObtenerPorID(1)
|
||||||
if err != nil{
|
if err != nil{
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "Hay un problema con la base de datos: Faltan Grupos?"})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": "Hay un problema con la base de datos: Faltan Grupos?"})
|
||||||
return
|
return
|
||||||
@@ -49,7 +50,7 @@ func Register(c *gin.Context) {
|
|||||||
user.Grupos = append(user.Grupos, *admin)
|
user.Grupos = append(user.Grupos, *admin)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := usuarioRepo.Crear(&user); err != nil {
|
if err := r.ObtenerRepositorios().Usuario.Crear(&user); err != nil {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,25 +5,14 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
models_seguridad "repuestera_back/models/seguridad"
|
models_seguridad "repuestera_back/models/seguridad"
|
||||||
repositorios "repuestera_back/repositorios"
|
|
||||||
|
r "repuestera_back/repositorios"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
grupoRepo repositorios.RepositorioGrupo
|
|
||||||
permisoRepo repositorios.RepositorioPermiso
|
|
||||||
usuarioRepo repositorios.RepositorioUsuario
|
|
||||||
)
|
|
||||||
|
|
||||||
func Initrepositorios(gr repositorios.RepositorioGrupo, pr repositorios.RepositorioPermiso, ur repositorios.RepositorioUsuario) {
|
|
||||||
grupoRepo = gr
|
|
||||||
permisoRepo = pr
|
|
||||||
usuarioRepo = ur
|
|
||||||
}
|
|
||||||
|
|
||||||
func ObtenerGrupos(c *gin.Context) {
|
func ObtenerGrupos(c *gin.Context) {
|
||||||
grupos, err := grupoRepo.ObtenerTodosConRelaciones()
|
grupos, err := r.ObtenerRepositorios().Grupo.ObtenerTodosConRelaciones()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
@@ -37,7 +26,7 @@ func ObtenerGrupo(c *gin.Context) {
|
|||||||
c.JSON(http.StatusBadRequest, gin.H{"error": "ID invalido"})
|
c.JSON(http.StatusBadRequest, gin.H{"error": "ID invalido"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
grupo, err := grupoRepo.ObtenerPorIDConRelaciones(uint(id))
|
grupo, err := r.ObtenerRepositorios().Grupo.ObtenerPorIDConRelaciones(uint(id))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": "Grupo no encontrado"})
|
c.JSON(http.StatusNotFound, gin.H{"error": "Grupo no encontrado"})
|
||||||
return
|
return
|
||||||
@@ -51,7 +40,7 @@ func CrearGrupo(c *gin.Context) {
|
|||||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err := grupoRepo.Crear(&grupo); err != nil {
|
if err := r.ObtenerRepositorios().Grupo.Crear(&grupo); err != nil {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -64,7 +53,7 @@ func ActualizarGrupo(c *gin.Context) {
|
|||||||
c.JSON(http.StatusBadRequest, gin.H{"error": "ID invalido"})
|
c.JSON(http.StatusBadRequest, gin.H{"error": "ID invalido"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
grupo, err := grupoRepo.ObtenerPorID(uint(id))
|
grupo, err := r.ObtenerRepositorios().Grupo.ObtenerPorID(uint(id))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": "Grupo no encontrado"})
|
c.JSON(http.StatusNotFound, gin.H{"error": "Grupo no encontrado"})
|
||||||
return
|
return
|
||||||
@@ -74,7 +63,7 @@ func ActualizarGrupo(c *gin.Context) {
|
|||||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
grupoRepo.Actualizar(grupo, input)
|
r.ObtenerRepositorios().Grupo.Actualizar(grupo, input)
|
||||||
c.JSON(http.StatusOK, grupo)
|
c.JSON(http.StatusOK, grupo)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +73,7 @@ func EliminarGrupo(c *gin.Context) {
|
|||||||
c.JSON(http.StatusBadRequest, gin.H{"error": "ID invalido"})
|
c.JSON(http.StatusBadRequest, gin.H{"error": "ID invalido"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err := grupoRepo.Eliminar(uint(id)); err != nil {
|
if err := r.ObtenerRepositorios().Grupo.Eliminar(uint(id)); err != nil {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repuestera_back/dto"
|
"repuestera_back/dto"
|
||||||
|
r "repuestera_back/repositorios"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
@@ -22,7 +23,7 @@ func AgregarPermisoAGrupo(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := grupoRepo.AgregarPermiso(uint(grupoID), req.PermisoID); err != nil {
|
if err := r.ObtenerRepositorios().Grupo.AgregarPermiso(uint(grupoID), req.PermisoID); err != nil {
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": err.Error()})
|
c.JSON(http.StatusNotFound, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -43,7 +44,7 @@ func QuitarPermisoAGrupo(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := grupoRepo.QuitarPermiso(uint(grupoID), req.PermisoID); err != nil {
|
if err := r.ObtenerRepositorios().Grupo.QuitarPermiso(uint(grupoID), req.PermisoID); err != nil {
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": err.Error()})
|
c.JSON(http.StatusNotFound, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -64,7 +65,7 @@ func AgregarSubGrupo(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := grupoRepo.AgregarSubGrupo(uint(padreID), req.ChildGroupID); err != nil {
|
if err := r.ObtenerRepositorios().Grupo.AgregarSubGrupo(uint(padreID), req.ChildGroupID); err != nil {
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": err.Error()})
|
c.JSON(http.StatusNotFound, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -85,7 +86,7 @@ func QuitarSubGrupo(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := grupoRepo.QuitarSubGrupo(uint(padreID), req.ChildGroupID); err != nil {
|
if err := r.ObtenerRepositorios().Grupo.QuitarSubGrupo(uint(padreID), req.ChildGroupID); err != nil {
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": err.Error()})
|
c.JSON(http.StatusNotFound, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -101,7 +102,7 @@ func AgregarGrupoAUsuario(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := usuarioRepo.AgregarGrupoAUsuario(req.UsuarioID, req.GrupoID); err != nil {
|
if err := r.ObtenerRepositorios().Usuario.AgregarGrupoAUsuario(req.UsuarioID, req.GrupoID); err != nil {
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": "no se pudo añadir el grupo al usuario"})
|
c.JSON(http.StatusNotFound, gin.H{"error": "no se pudo añadir el grupo al usuario"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -117,7 +118,7 @@ func QuitarGrupoAUsuario(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := usuarioRepo.QuitarGrupoDeUsuario(req.UsuarioID, req.GrupoID); err != nil {
|
if err := r.ObtenerRepositorios().Usuario.QuitarGrupoDeUsuario(req.UsuarioID, req.GrupoID); err != nil {
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": "no se pudo quitar el grupo al usuario"})
|
c.JSON(http.StatusNotFound, gin.H{"error": "no se pudo quitar el grupo al usuario"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -133,7 +134,7 @@ func ObtenerGruposDeUsuario(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
grupos, err := usuarioRepo.ObtenerGruposPorUsuarioID(uint(usuarioID))
|
grupos, err := r.ObtenerRepositorios().Usuario.ObtenerGruposPorUsuarioID(uint(usuarioID))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": "no se ha podido obtener los grupos del usuario"})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": "no se ha podido obtener los grupos del usuario"})
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -5,12 +5,13 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
models_seguridad "repuestera_back/models/seguridad"
|
models_seguridad "repuestera_back/models/seguridad"
|
||||||
|
r "repuestera_back/repositorios"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ObtenerPermisos(c *gin.Context) {
|
func ObtenerPermisos(c *gin.Context) {
|
||||||
permisos, err := permisoRepo.ObtenerTodos()
|
permisos, err := r.ObtenerRepositorios().Permiso.ObtenerTodos()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
@@ -24,7 +25,7 @@ func CrearPermiso(c *gin.Context) {
|
|||||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err := permisoRepo.Crear(&permiso); err != nil {
|
if err := r.ObtenerRepositorios().Permiso.Crear(&permiso); err != nil {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -37,7 +38,7 @@ func ActualizarPermiso(c *gin.Context) {
|
|||||||
c.JSON(http.StatusBadRequest, gin.H{"error": "ID invalido"})
|
c.JSON(http.StatusBadRequest, gin.H{"error": "ID invalido"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
permiso, err := permisoRepo.ObtenerPorID(uint(id))
|
permiso, err := r.ObtenerRepositorios().Permiso.ObtenerPorID(uint(id))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": "Permiso no encontrado"})
|
c.JSON(http.StatusNotFound, gin.H{"error": "Permiso no encontrado"})
|
||||||
return
|
return
|
||||||
@@ -47,7 +48,7 @@ func ActualizarPermiso(c *gin.Context) {
|
|||||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
permisoRepo.Actualizar(permiso, input)
|
r.ObtenerRepositorios().Permiso.Actualizar(permiso, input)
|
||||||
c.JSON(http.StatusOK, permiso)
|
c.JSON(http.StatusOK, permiso)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,7 +58,7 @@ func EliminarPermiso(c *gin.Context) {
|
|||||||
c.JSON(http.StatusBadRequest, gin.H{"error": "ID invalido"})
|
c.JSON(http.StatusBadRequest, gin.H{"error": "ID invalido"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if err := permisoRepo.Eliminar(uint(id)); err != nil {
|
if err := r.ObtenerRepositorios().Permiso.Eliminar(uint(id)); err != nil {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
|
|
||||||
"repuestera_back/dto"
|
"repuestera_back/dto"
|
||||||
models_seguridad "repuestera_back/models/seguridad"
|
models_seguridad "repuestera_back/models/seguridad"
|
||||||
|
r "repuestera_back/repositorios"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
@@ -18,7 +19,7 @@ func ObtenerPermisosUsuario(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
usuario, err := usuarioRepo.PrecargarGruposPermisosPorID(uint(userID))
|
usuario, err := r.ObtenerRepositorios().Usuario.PrecargarGruposPermisosPorID(uint(userID))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == gorm.ErrRecordNotFound {
|
if err == gorm.ErrRecordNotFound {
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": "Usuario no encontrado"})
|
c.JSON(http.StatusNotFound, gin.H{"error": "Usuario no encontrado"})
|
||||||
@@ -72,7 +73,7 @@ func ObtenerGruposYPermisosPorEmail(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
usuario, err := usuarioRepo.ObtenerPorEmailConGrupos(request.Email)
|
usuario, err := r.ObtenerRepositorios().Usuario.ObtenerPorEmailConGrupos(request.Email)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == gorm.ErrRecordNotFound {
|
if err == gorm.ErrRecordNotFound {
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": "Usuario no encontrado"})
|
c.JSON(http.StatusNotFound, gin.H{"error": "Usuario no encontrado"})
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package usuarios
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
models_seguridad "repuestera_back/models/seguridad"
|
||||||
|
r "repuestera_back/repositorios"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ActualizarUsuario(c *gin.Context) {
|
||||||
|
id := c.Param("id")
|
||||||
|
|
||||||
|
var usuarioReq models_seguridad.Usuario
|
||||||
|
|
||||||
|
if err := c.ShouldBind(&usuarioReq); err != nil {
|
||||||
|
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if usuarioReq.Email == "" {
|
||||||
|
c.JSON(http.StatusBadRequest, gin.H{"error": "El email no puede estar vacío"})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if usuarioReq.Name == "" {
|
||||||
|
c.JSON(http.StatusBadRequest, gin.H{"error": "El nombre no puede estar vacío"})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
idconv, _ := strconv.ParseUint(id, 10, 64)
|
||||||
|
|
||||||
|
usuario, err := r.ObtenerRepositorios().Usuario.ObtenerPorID(uint(idconv))
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(http.StatusNotFound, gin.H{"error": "Usuario no encontrado"})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
usuario.Email = usuarioReq.Email
|
||||||
|
usuario.Name = usuarioReq.Name
|
||||||
|
|
||||||
|
r.ObtenerRepositorios().Usuario.Guardar(usuario)
|
||||||
|
|
||||||
|
c.JSON(http.StatusCreated, usuario)
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package usuarios
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
models_seguridad "repuestera_back/models/seguridad"
|
||||||
|
r "repuestera_back/repositorios"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func CrearUsuario(c *gin.Context) {
|
||||||
|
var usuario models_seguridad.Usuario
|
||||||
|
if err := c.ShouldBind(&usuario); err != nil {
|
||||||
|
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := r.ObtenerRepositorios().Usuario.Crear(&usuario); err != nil {
|
||||||
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
c.JSON(http.StatusCreated, usuario)
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package usuarios
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
r "repuestera_back/repositorios"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func EliminarUsuario(c *gin.Context) {
|
||||||
|
id, err := strconv.ParseUint(c.Param("id"), 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(http.StatusBadRequest, gin.H{"error": "ID invalido"})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := r.ObtenerRepositorios().Usuario.Eliminar(uint(id)); err != nil {
|
||||||
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
c.JSON(http.StatusOK, gin.H{"message": "Usuario eliminado"})
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package usuarios
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
r "repuestera_back/repositorios"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ObtenerUsuario(c *gin.Context) {
|
||||||
|
id, err := strconv.ParseUint(c.Param("id"), 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(http.StatusBadRequest, gin.H{"error": "No se especificó el id de usuario o no es un numero natural"})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
usuario, err := r.ObtenerRepositorios().Usuario.BuscarPorID(uint(id))
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
c.JSON(http.StatusOK, usuario)
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package usuarios
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
r "repuestera_back/repositorios"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ObtenerUsuarios(c *gin.Context) {
|
||||||
|
pagina, err1 := strconv.ParseInt(c.Query("p"), 10, 32)
|
||||||
|
tamaño, err2 := strconv.ParseInt(c.Query("s"), 10, 32)
|
||||||
|
|
||||||
|
if err1 != nil {
|
||||||
|
pagina = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
if err2 != nil {
|
||||||
|
tamaño = 10
|
||||||
|
}
|
||||||
|
|
||||||
|
usuarios, total, err := r.ObtenerRepositorios().Usuario.ObtenerTodosPaginado(int(pagina), int(tamaño))
|
||||||
|
if err != nil {
|
||||||
|
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
"usuarios": usuarios,
|
||||||
|
"total": total,
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
package usuarios
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
package usuarios
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net/http"
|
|
||||||
models_seguridad "repuestera_back/models/seguridad"
|
|
||||||
repositorios "repuestera_back/repositorios"
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
)
|
|
||||||
|
|
||||||
var usuarioRepo repositorios.RepositorioUsuario
|
|
||||||
|
|
||||||
func InitUsuarioRepository(repo repositorios.RepositorioUsuario) {
|
|
||||||
usuarioRepo = repo
|
|
||||||
}
|
|
||||||
|
|
||||||
func ObtenerUsuarios(c *gin.Context) {
|
|
||||||
pagina, err1 := strconv.ParseInt(c.Query("p"), 10, 32)
|
|
||||||
tamaño, err2 := strconv.ParseInt(c.Query("s"), 10, 32)
|
|
||||||
|
|
||||||
if err1 != nil {
|
|
||||||
pagina = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
if err2 != nil {
|
|
||||||
tamaño = 10
|
|
||||||
}
|
|
||||||
|
|
||||||
usuarios, total, err := usuarioRepo.ObtenerTodosPaginado(int(pagina), int(tamaño))
|
|
||||||
if err != nil {
|
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
c.JSON(http.StatusOK, gin.H{
|
|
||||||
"usuarios": usuarios,
|
|
||||||
"total": total,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func ObtenerUsuario(c *gin.Context) {
|
|
||||||
id, err := strconv.ParseUint(c.Param("id"), 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"error": "No se especificó el id de usuario o no es un numero natural"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
usuario, err := usuarioRepo.BuscarPorID(uint(id))
|
|
||||||
if err != nil {
|
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
c.JSON(http.StatusOK, usuario)
|
|
||||||
}
|
|
||||||
|
|
||||||
func CrearUsuario(c *gin.Context) {
|
|
||||||
var usuario models_seguridad.Usuario
|
|
||||||
if err := c.ShouldBind(&usuario); err != nil {
|
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := usuarioRepo.Crear(&usuario); err != nil {
|
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
c.JSON(http.StatusCreated, usuario)
|
|
||||||
}
|
|
||||||
|
|
||||||
func ActualizarUsuario(c *gin.Context) {
|
|
||||||
id := c.Param("id")
|
|
||||||
|
|
||||||
var usuarioReq models_seguridad.Usuario
|
|
||||||
|
|
||||||
if err := c.ShouldBind(&usuarioReq); err != nil {
|
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if usuarioReq.Email == "" {
|
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"error": "El email no puede estar vacío"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if usuarioReq.Name == "" {
|
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"error": "El nombre no puede estar vacío"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
idconv, _ := strconv.ParseUint(id, 10, 64)
|
|
||||||
|
|
||||||
usuario, err := usuarioRepo.ObtenerPorID(uint(idconv))
|
|
||||||
if err != nil {
|
|
||||||
c.JSON(http.StatusNotFound, gin.H{"error": "Usuario no encontrado"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
usuario.Email = usuarioReq.Email
|
|
||||||
usuario.Name = usuarioReq.Name
|
|
||||||
|
|
||||||
usuarioRepo.Guardar(usuario)
|
|
||||||
|
|
||||||
c.JSON(http.StatusCreated, usuario)
|
|
||||||
}
|
|
||||||
|
|
||||||
func EliminarUsuario(c *gin.Context) {
|
|
||||||
id, err := strconv.ParseUint(c.Param("id"), 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"error": "ID invalido"})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := usuarioRepo.Eliminar(uint(id)); err != nil {
|
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
c.JSON(http.StatusOK, gin.H{"message": "Usuario eliminado"})
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package repositorios
|
||||||
|
|
||||||
|
import (
|
||||||
|
"sync"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Repositorios struct {
|
||||||
|
Permiso RepositorioPermiso
|
||||||
|
Usuario RepositorioUsuario
|
||||||
|
Grupo RepositorioGrupo
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
instancia *Repositorios
|
||||||
|
once sync.Once
|
||||||
|
)
|
||||||
|
|
||||||
|
func InicializarRepositorios(db *gorm.DB) {
|
||||||
|
if instancia == nil {
|
||||||
|
once.Do(func() {
|
||||||
|
instancia = &Repositorios{
|
||||||
|
Permiso: &repositorioPermiso{db: db},
|
||||||
|
Usuario: &repositorioUsuario{db: db},
|
||||||
|
Grupo: &repositorioGrupo{db: db},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func ObtenerRepositorios() *Repositorios {
|
||||||
|
if instancia == nil {
|
||||||
|
panic("los repositorios no fueron inicializados")
|
||||||
|
}
|
||||||
|
|
||||||
|
return instancia
|
||||||
|
}
|
||||||
@@ -23,10 +23,6 @@ type repositorioGrupo struct {
|
|||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
}
|
}
|
||||||
|
|
||||||
func NuevoRepositorioGrupo(db *gorm.DB) RepositorioGrupo {
|
|
||||||
return &repositorioGrupo{db: db}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *repositorioGrupo) ObtenerTodosConRelaciones() ([]models_seguridad.Grupo, error) {
|
func (r *repositorioGrupo) ObtenerTodosConRelaciones() ([]models_seguridad.Grupo, error) {
|
||||||
var grupos []models_seguridad.Grupo
|
var grupos []models_seguridad.Grupo
|
||||||
if err := r.db.Preload("Permisos").Find(&grupos).Error; err != nil {
|
if err := r.db.Preload("Permisos").Find(&grupos).Error; err != nil {
|
||||||
|
|||||||
@@ -18,10 +18,6 @@ type repositorioPermiso struct {
|
|||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
}
|
}
|
||||||
|
|
||||||
func NuevoRepositorioPermiso(db *gorm.DB) RepositorioPermiso {
|
|
||||||
return &repositorioPermiso{db: db}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *repositorioPermiso) ObtenerTodos() ([]models_seguridad.Permiso, error) {
|
func (r *repositorioPermiso) ObtenerTodos() ([]models_seguridad.Permiso, error) {
|
||||||
var permisos []models_seguridad.Permiso
|
var permisos []models_seguridad.Permiso
|
||||||
if err := r.db.Find(&permisos).Error; err != nil {
|
if err := r.db.Find(&permisos).Error; err != nil {
|
||||||
|
|||||||
@@ -28,10 +28,6 @@ type repositorioUsuario struct {
|
|||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
}
|
}
|
||||||
|
|
||||||
func NuevoRepositorioUsuario(db *gorm.DB) RepositorioUsuario {
|
|
||||||
return &repositorioUsuario{db: db}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *repositorioUsuario) CantidadUsuarios(cant *int64) error {
|
func (r *repositorioUsuario) CantidadUsuarios(cant *int64) error {
|
||||||
if err := r.db.Model(&models_seguridad.Usuario{}).Count(cant).Error; err!= nil {
|
if err := r.db.Model(&models_seguridad.Usuario{}).Count(cant).Error; err!= nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
+1
-12
@@ -5,15 +5,11 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"repuestera_back/config"
|
"repuestera_back/config"
|
||||||
auth "repuestera_back/controllers/auth"
|
|
||||||
permiso "repuestera_back/controllers/permisos"
|
|
||||||
"repuestera_back/controllers/usuarios"
|
|
||||||
"repuestera_back/models"
|
"repuestera_back/models"
|
||||||
"repuestera_back/models/logs"
|
"repuestera_back/models/logs"
|
||||||
models_seguridad "repuestera_back/models/seguridad"
|
models_seguridad "repuestera_back/models/seguridad"
|
||||||
"repuestera_back/repositorios"
|
"repuestera_back/repositorios"
|
||||||
"repuestera_back/routes"
|
"repuestera_back/routes"
|
||||||
"repuestera_back/utils"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
@@ -45,14 +41,7 @@ func main() {
|
|||||||
|
|
||||||
config.InitPermisos()
|
config.InitPermisos()
|
||||||
|
|
||||||
usuarioRepo := repositorios.NuevoRepositorioUsuario(config.DB)
|
repositorios.InicializarRepositorios(config.DB)
|
||||||
grupoRepo := repositorios.NuevoRepositorioGrupo(config.DB)
|
|
||||||
permisoRepo := repositorios.NuevoRepositorioPermiso(config.DB)
|
|
||||||
|
|
||||||
auth.InitUsuarioRepository(usuarioRepo, grupoRepo)
|
|
||||||
usuarios.InitUsuarioRepository(usuarioRepo)
|
|
||||||
permiso.Initrepositorios(grupoRepo, permisoRepo, usuarioRepo)
|
|
||||||
utils.InitUsuarioRepository(usuarioRepo)
|
|
||||||
|
|
||||||
r := gin.Default()
|
r := gin.Default()
|
||||||
|
|
||||||
|
|||||||
@@ -23,21 +23,16 @@
|
|||||||
title: 'Órdenes y Ventas',
|
title: 'Órdenes y Ventas',
|
||||||
desc: 'Administra pedidos, cotizaciones y ventas desde un solo lugar. Historial completo de cada transacción.'
|
desc: 'Administra pedidos, cotizaciones y ventas desde un solo lugar. Historial completo de cada transacción.'
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
icon: Barcode,
|
// icon: Barcode,
|
||||||
title: 'Código de Barras',
|
// title: 'Código de Barras',
|
||||||
desc: 'Escanea y registra productos al instante. Compatible con lectores de código de barras estándar.'
|
// desc: 'Escanea y registra productos al instante. Compatible con lectores de código de barras estándar.'
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
icon: Report,
|
icon: Report,
|
||||||
title: 'Reportes y Analytics',
|
title: 'Reportes y Analytics',
|
||||||
desc: 'Visualiza tus métricas clave: productos más vendidos, rotación de inventario y rentabilidad.'
|
desc: 'Visualiza tus métricas clave: productos más vendidos, rotación de inventario y rentabilidad.'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
icon: UserMultiple,
|
|
||||||
title: 'Usuarios y Roles',
|
|
||||||
desc: 'Control de acceso granular con permisos personalizables por grupo y usuario.'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
icon: Api,
|
icon: Api,
|
||||||
title: 'API Completa',
|
title: 'API Completa',
|
||||||
@@ -103,8 +98,8 @@
|
|||||||
desde cualquier lugar
|
desde cualquier lugar
|
||||||
</h1>
|
</h1>
|
||||||
<p class="hero-subtitle">
|
<p class="hero-subtitle">
|
||||||
La plataforma todo-en-uno para administrar inventario, ventas y usuarios
|
La plataforma todo-en-uno para administrar inventario, ventas y usuarios de tu negocio de
|
||||||
de tu negocio de repuestos. Simple, rápida y segura.
|
repuestos. Simple, rápida y segura.
|
||||||
</p>
|
</p>
|
||||||
{#if !usuario}
|
{#if !usuario}
|
||||||
<div class="hero-buttons">
|
<div class="hero-buttons">
|
||||||
@@ -179,8 +174,8 @@
|
|||||||
<div class="cta-card">
|
<div class="cta-card">
|
||||||
<h2 class="cta-title">¿Listo para transformar tu repuestera?</h2>
|
<h2 class="cta-title">¿Listo para transformar tu repuestera?</h2>
|
||||||
<p class="cta-subtitle">
|
<p class="cta-subtitle">
|
||||||
Únete a cientos de negocios que ya confían en Repuestera.
|
Únete a cientos de negocios que ya confían en Repuestera. Empieza hoy y lleva tu inventario
|
||||||
Empieza hoy y lleva tu inventario al siguiente nivel.
|
al siguiente nivel.
|
||||||
</p>
|
</p>
|
||||||
<Button href="/register" icon={ArrowRight} iconDescription="Comenzar ahora">
|
<Button href="/register" icon={ArrowRight} iconDescription="Comenzar ahora">
|
||||||
Comenzar ahora
|
Comenzar ahora
|
||||||
@@ -305,7 +300,9 @@
|
|||||||
background: var(--cds-layer-02, #393939);
|
background: var(--cds-layer-02, #393939);
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
padding: 1.75rem;
|
padding: 1.75rem;
|
||||||
transition: transform 0.2s, box-shadow 0.2s;
|
transition:
|
||||||
|
transform 0.2s,
|
||||||
|
box-shadow 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.feature-card:hover {
|
.feature-card:hover {
|
||||||
@@ -359,7 +356,9 @@
|
|||||||
gap: 1.25rem;
|
gap: 1.25rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
transition: transform 0.2s, box-shadow 0.2s;
|
transition:
|
||||||
|
transform 0.2s,
|
||||||
|
box-shadow 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pricing-card.highlight {
|
.pricing-card.highlight {
|
||||||
|
|||||||
Reference in new issue
Block a user