Private
Public Access
añadida entidad de log
This commit is contained in:
1 parent
7cadb9c84b
commit
5fa3fd7cc5
2 files changed
+31
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package logs
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
models_seguridad "repuestera_back/models/seguridad"
|
||||
)
|
||||
|
||||
type LogDetalle struct {
|
||||
NombreTabla string `json:"nombreTabla"`
|
||||
Columna string `json:"columna"`
|
||||
ValorAnterior string `json:"valorAnterior,omitempty"`
|
||||
ValorNuevo string `json:"valorNuevo,omitempty"`
|
||||
}
|
||||
|
||||
type Log struct {
|
||||
ID uint64 `gorm:"primaryKey" json:"id"`
|
||||
EmpresaID string `gorm:"type:varchar(3);index;not null" json:"empresaId"`
|
||||
UsuarioID uint `gorm:"index;not null" json:"usuarioId"`
|
||||
Accion string `gorm:"type:varchar(50);not null" json:"accion"`
|
||||
Detalles []LogDetalle `gorm:"type:json" json:"detalles,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
Empresa models_seguridad.Empresa `gorm:"foreignKey:EmpresaID" json:"empresa,omitempty"`
|
||||
Usuario models_seguridad.Usuario `gorm:"foreignKey:UsuarioID" json:"usuario,omitempty"`
|
||||
}
|
||||
|
||||
func (Log) TableName() string {
|
||||
return "logs"
|
||||
}
|
||||
Reference in new issue
Block a user