mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00

- Added 'not null' tags - Followed associations according to Mongoose schemas from the current backend
26 lines
681 B
Go
26 lines
681 B
Go
package user
|
|
|
|
import (
|
|
"git.rwth-aachen.de/acs/public/villas/villasweb-backend-go/file"
|
|
"git.rwth-aachen.de/acs/public/villas/villasweb-backend-go/project"
|
|
"git.rwth-aachen.de/acs/public/villas/villasweb-backend-go/simulation"
|
|
"github.com/jinzhu/gorm"
|
|
// TODO: we need also bcrypt
|
|
)
|
|
|
|
type User struct {
|
|
gorm.Model
|
|
Username string `gorm:"unique;not null"`
|
|
Password string `gorm:"not null"`
|
|
Mail string `gorm:"default:"`
|
|
Role string `gorm:"default:user"`
|
|
Projects []Project
|
|
Simulations []Simulaion
|
|
Files []File
|
|
}
|
|
|
|
// TODO: callback for verifying password
|
|
|
|
// TODO: execute before each user.save()
|
|
|
|
// TODO: execute before each user.delete()
|