add workspaces to user
This commit is contained in:
@@ -7,16 +7,15 @@ import (
|
||||
)
|
||||
|
||||
type Settings struct {
|
||||
PrimaryColor string `json:"primaryColor,omitempty"`
|
||||
PrimaryColorText string `json:"primaryColorText,omitempty"`
|
||||
SecondaryColor string `json:"secondaryColor,omitempty"`
|
||||
SecondaryColorText string `json:"secondaryColorText,omitempty"`
|
||||
Icon string `json:"icon,omitempty"`
|
||||
AppName string `json:"appName,omitempty"`
|
||||
DatabaseName string `json:"databaseName,omitempty"`
|
||||
DatabaseToken string `json:"databaseToken,omitempty"`
|
||||
Workspace string `json:"workspace,omitempty"`
|
||||
Workspaces []string `json:"workspaces,omitempty"`
|
||||
PrimaryColor string `json:"primaryColor,omitempty"`
|
||||
PrimaryColorText string `json:"primaryColorText,omitempty"`
|
||||
SecondaryColor string `json:"secondaryColor,omitempty"`
|
||||
SecondaryColorText string `json:"secondaryColorText,omitempty"`
|
||||
Icon string `json:"icon,omitempty"`
|
||||
AppName string `json:"appName,omitempty"`
|
||||
DatabaseName string `json:"databaseName,omitempty"`
|
||||
DatabaseToken string `json:"databaseToken,omitempty"`
|
||||
Workspace string `json:"workspace,omitempty"`
|
||||
}
|
||||
|
||||
func (s *Settings) DefaultQuasarSettings() {
|
||||
|
||||
@@ -5,15 +5,16 @@ import (
|
||||
)
|
||||
|
||||
type User struct {
|
||||
Id uint `gorm:"primaryKey" json:"id"`
|
||||
Name string `gorm:"column:user_name" json:"user"`
|
||||
Email string `gorm:"column:email" json:"email"`
|
||||
RoleID *uint `gorm:"column:roleId" json:"roleId,omitempty"`
|
||||
Role *Role `gorm:"foreignKey:RoleID" json:"role,omitempty"`
|
||||
Password string `gorm:"column:password" json:"password"`
|
||||
NewPassword string `gorm:"-" json:"newPassword,omitempty"`
|
||||
Expiration string `gorm:"column:expiration" json:"expiration,omitempty"`
|
||||
Settings Settings `gorm:"type:json" json:"settings"`
|
||||
Id uint `gorm:"primaryKey" json:"id"`
|
||||
Name string `gorm:"column:user_name" json:"user"`
|
||||
Email string `gorm:"column:email" json:"email"`
|
||||
RoleID *uint `gorm:"column:roleId" json:"roleId,omitempty"`
|
||||
Role *Role `gorm:"foreignKey:RoleID" json:"role,omitempty"`
|
||||
Password string `gorm:"column:password" json:"password"`
|
||||
NewPassword string `gorm:"-" json:"newPassword,omitempty"`
|
||||
Expiration string `gorm:"column:expiration" json:"expiration,omitempty"`
|
||||
Settings Settings `gorm:"type:json" json:"settings"`
|
||||
Workspaces []*Workspace `gorm:"many2many:users_workspaces;" `
|
||||
}
|
||||
|
||||
func (u *User) IsValid() bool {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package models
|
||||
|
||||
type Workspace struct {
|
||||
Id uint `gorm:"primaryKey" json:"id"`
|
||||
Name string `gorm:"column:name" json:"name"`
|
||||
Description string `gorm:"type:json" json:"description"`
|
||||
Id uint `gorm:"primaryKey" json:"id"`
|
||||
Name string `gorm:"column:name" json:"name"`
|
||||
Description string `gorm:"type:json" json:"description"`
|
||||
Users []*User `gorm:"many2many:users_workspaces;" `
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user