models/models.go (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
package models import ( "github.com/golang-jwt/jwt/v5" "gorm.io/gorm" ) type JwtCustomClaims struct { jwt.RegisteredClaims FirstName string `json:"first_name"` LastName string `json:"last_name"` Role string `json:"role"` Email string `json:"email"` ID uint `json:"id"` } type User struct { gorm.Model FirstName string `json:"first_name" gorm:"text"` LastName string `json:"last_name" gorm:"text"` Email string `json:"email" gorm:"text"` Password string `json:"password" gorm:"text"` Role string `json:"role" gorm:"text"` Applications []Application `json:"applications" gorm:"foreignKey:UserID"` } type Application struct { gorm.Model UserID string `json:"user_id" gorm:"text"` Name string `json:"name" gorm:"text"` Description string `json:"description" gorm:"text"` Domain string `json:"domain" gorm:"text"` Status string `json:"status" gorm:"text"` TrackingCode string `json:"tracking_code" gorm:"text"` Events []Event `json:"events" gorm:"foreignKey:ApplicationID"` } type Event struct { gorm.Model ApplicationID string `json:"application_id" gorm:"text"` Name string `json:"name" gorm:"text"` Description string `json:"description" gorm:"text"` } |