2024-05-03 17:32:44 +00:00
|
|
|
package models
|
|
|
|
|
2024-09-11 14:31:30 +00:00
|
|
|
import "gorm.io/datatypes"
|
|
|
|
|
2024-05-03 17:32:44 +00:00
|
|
|
type Realm struct {
|
|
|
|
BaseModel
|
|
|
|
|
2024-09-11 14:31:30 +00:00
|
|
|
Alias string `json:"alias" gorm:"uniqueIndex"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
Members []RealmMember `json:"members"`
|
|
|
|
Avatar *string `json:"avatar"`
|
|
|
|
Banner *string `json:"banner"`
|
|
|
|
AccessPolicy datatypes.JSONMap `json:"access_policy"`
|
|
|
|
IsPublic bool `json:"is_public"`
|
|
|
|
IsCommunity bool `json:"is_community"`
|
|
|
|
AccountID uint `json:"account_id"`
|
2024-05-03 17:32:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type RealmMember struct {
|
|
|
|
BaseModel
|
|
|
|
|
|
|
|
RealmID uint `json:"realm_id"`
|
|
|
|
AccountID uint `json:"account_id"`
|
|
|
|
Realm Realm `json:"realm"`
|
|
|
|
Account Account `json:"account"`
|
|
|
|
PowerLevel int `json:"power_level"`
|
|
|
|
}
|