mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
Formating using Gofmt with local tab=4*stops
This commit is contained in:
parent
608e772c9b
commit
ae0f729a55
2 changed files with 79 additions and 79 deletions
|
@ -26,10 +26,10 @@ func StartDB() {
|
||||||
db.AutoMigrate(&Simulator{})
|
db.AutoMigrate(&Simulator{})
|
||||||
db.AutoMigrate(&Signal{})
|
db.AutoMigrate(&Signal{})
|
||||||
db.AutoMigrate(&SimulationModel{})
|
db.AutoMigrate(&SimulationModel{})
|
||||||
//db.AutoMigrate(&File{})
|
db.AutoMigrate(&File{})
|
||||||
db.AutoMigrate(&Project{})
|
db.AutoMigrate(&Project{})
|
||||||
db.AutoMigrate(&Simulation{})
|
db.AutoMigrate(&Simulation{})
|
||||||
//db.AutoMigrate(&User{})
|
db.AutoMigrate(&User{})
|
||||||
db.AutoMigrate(&Visualization{})
|
db.AutoMigrate(&Visualization{})
|
||||||
db.AutoMigrate(&Signal{})
|
db.AutoMigrate(&Signal{})
|
||||||
db.AutoMigrate(&Widget{})
|
db.AutoMigrate(&Widget{})
|
||||||
|
|
|
@ -36,20 +36,20 @@ type Project struct {
|
||||||
Name string `gorm:"not null"`
|
Name string `gorm:"not null"`
|
||||||
User User `gorm:"not null"`
|
User User `gorm:"not null"`
|
||||||
UserID uint `gorm:"not null"`
|
UserID uint `gorm:"not null"`
|
||||||
Visualizations []Visualization
|
|
||||||
Simulation Simulation `gorm:"not null"`
|
Simulation Simulation `gorm:"not null"`
|
||||||
SimulationID uint `gorm:"not null"`
|
SimulationID uint `gorm:"not null"`
|
||||||
|
Visualizations []Visualization
|
||||||
}
|
}
|
||||||
|
|
||||||
type Simulation struct {
|
type Simulation struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
Name string `gorm:"not null"`
|
Name string `gorm:"not null"`
|
||||||
Running bool `gorm:"default:false"`
|
Running bool `gorm:"default:false"`
|
||||||
Models []SimulationModel `gorm:"foreignkey:BelongsToSimulationID"`
|
|
||||||
Projects []Project
|
|
||||||
User User `gorm:"not null"`
|
User User `gorm:"not null"`
|
||||||
UserID uint `gorm:"not null"`
|
UserID uint `gorm:"not null"`
|
||||||
StartParameters postgres.Jsonb // TODO default value
|
StartParameters postgres.Jsonb // TODO default value
|
||||||
|
Models []SimulationModel `gorm:"foreignkey:BelongsToSimulationID"`
|
||||||
|
Projects []Project
|
||||||
}
|
}
|
||||||
|
|
||||||
type SimulationModel struct {
|
type SimulationModel struct {
|
||||||
|
@ -70,7 +70,7 @@ type User struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
Username string `gorm:"unique;not null"`
|
Username string `gorm:"unique;not null"`
|
||||||
Password string `gorm:"not null"`
|
Password string `gorm:"not null"`
|
||||||
Mail string `gorm:"default:"`
|
Mail string `gorm:"default:''"`
|
||||||
Role string `gorm:"default:'user'"`
|
Role string `gorm:"default:'user'"`
|
||||||
Projects []Project
|
Projects []Project
|
||||||
Simulations []Simulation
|
Simulations []Simulation
|
||||||
|
@ -82,10 +82,10 @@ type Visualization struct {
|
||||||
Name string `gorm:"not null"`
|
Name string `gorm:"not null"`
|
||||||
Project Project `gorm:"not null"`
|
Project Project `gorm:"not null"`
|
||||||
ProjectID uint `gorm:"not null"`
|
ProjectID uint `gorm:"not null"`
|
||||||
Widgets []Widget
|
|
||||||
Grid int `gorm:"default:15"`
|
Grid int `gorm:"default:15"`
|
||||||
VisualizationUser User `gorm:"not null"`
|
VisualizationUser User `gorm:"not null"`
|
||||||
VisualizationUserID uint `gorm:"not null"`
|
VisualizationUserID uint `gorm:"not null"`
|
||||||
|
Widgets []Widget
|
||||||
}
|
}
|
||||||
|
|
||||||
type Signal struct {
|
type Signal struct {
|
||||||
|
|
Loading…
Add table
Reference in a new issue