70 lines
1.2 KiB
Go
70 lines
1.2 KiB
Go
|
package types
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"gorm.io/gorm"
|
||
|
)
|
||
|
|
||
|
type Tolerancia struct {
|
||
|
Medida string `gorm:"primaryKey"`
|
||
|
MMax float64
|
||
|
MMin float64
|
||
|
HMax float64
|
||
|
HMin float64
|
||
|
SMax float64
|
||
|
SMin float64
|
||
|
TMax float64
|
||
|
TMin float64
|
||
|
BMax float64
|
||
|
BMin float64
|
||
|
ParalMax float64
|
||
|
AsimMax float64
|
||
|
Curvatura float64
|
||
|
Escuadrado float64
|
||
|
Longitud float64
|
||
|
FlechaMax float64
|
||
|
FlechaLat float64
|
||
|
MNom float64
|
||
|
HNom float64
|
||
|
SNom float64
|
||
|
TNom float64
|
||
|
BNom float64
|
||
|
CreatedAt time.Time
|
||
|
UpdatedAt time.Time
|
||
|
DeletedAt gorm.DeletedAt `gorm:"index"`
|
||
|
}
|
||
|
|
||
|
type GetToleranciaReq struct {
|
||
|
Sender string
|
||
|
Medida string
|
||
|
TimeStamp string
|
||
|
}
|
||
|
|
||
|
type GetToleranciaRes struct {
|
||
|
Tolerancia Tolerancia
|
||
|
TimeStamp string
|
||
|
}
|
||
|
|
||
|
type CreateToleranceReq struct {
|
||
|
Sender string
|
||
|
Tolerancia Tolerancia
|
||
|
TimeStamp string
|
||
|
}
|
||
|
|
||
|
type CreateToleranceRes struct {
|
||
|
Message string
|
||
|
TimeStamp string
|
||
|
}
|
||
|
|
||
|
func (t *Tolerancia) BeforeCreate(tx *gorm.DB) (err error) {
|
||
|
t.CreatedAt = time.Now()
|
||
|
t.UpdatedAt = time.Now()
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func (t *Tolerancia) BeforeUpdate(tx *gorm.DB) (err error) {
|
||
|
t.UpdatedAt = time.Now()
|
||
|
return
|
||
|
}
|