add new models, change migration files, prepare to add all new tables from models
This commit is contained in:
33
internal/foundry/temp_models/json/grid.go
Normal file
33
internal/foundry/temp_models/json/grid.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package json
|
||||
|
||||
import "gitea.local.lab/Lbenedar/foundry_helper_service/internal/foundry/temp_models/db"
|
||||
|
||||
type Grid struct {
|
||||
Type int `json:"type"`
|
||||
Size int `json:"size,omitempty"`
|
||||
Color string `json:"color,omitempty"`
|
||||
Alpha float64 `json:"alpha,omitempty"`
|
||||
Distance int `json:"distance"`
|
||||
Units string `json:"units"`
|
||||
Diagonals int `json:"diagonals,omitempty"`
|
||||
Style string `json:"style,omitempty"`
|
||||
Thickness int `json:"thickness,omitempty"`
|
||||
}
|
||||
|
||||
func (g *Grid) ToDB(dest *db.Grid) bool {
|
||||
if dest == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
dest.Type = g.Type
|
||||
dest.Size = g.Size
|
||||
dest.Color = g.Color
|
||||
dest.Alpha = g.Alpha
|
||||
dest.Distance = g.Distance
|
||||
dest.Units = g.Units
|
||||
dest.Diagonals = g.Diagonals
|
||||
dest.Style = g.Style
|
||||
dest.Thickness = g.Thickness
|
||||
|
||||
return true
|
||||
}
|
||||
Reference in New Issue
Block a user