⬆️ Upgrade Passport

This commit is contained in:
2024-05-05 00:39:59 +08:00
parent 3929f502ec
commit e6407bbe4d
16 changed files with 159 additions and 27 deletions

View File

@ -10,7 +10,7 @@ const (
type Channel struct {
BaseModel
Alias string `json:"alias" gorm:"uniqueIndex"`
Alias string `json:"alias"`
Name string `json:"name"`
Description string `json:"description"`
Members []ChannelMember `json:"members"`
@ -19,7 +19,7 @@ type Channel struct {
Type ChannelType `json:"type"`
Account Account `json:"account"`
AccountID uint `json:"account_id"`
RealmID uint `json:"realm_id"`
RealmID *uint `json:"realm_id"`
}
type NotifyLevel = int8

15
pkg/models/realms.go Normal file
View File

@ -0,0 +1,15 @@
package models
// Realm profiles basically fetched from Hydrogen.Passport
// But cache at here for better usage and database relations
type Realm struct {
BaseModel
Alias string `json:"alias"`
Name string `json:"name"`
Description string `json:"description"`
Channels []Channel `json:"channels"`
IsPublic bool `json:"is_public"`
IsCommunity bool `json:"is_community"`
ExternalID uint `json:"external_id"`
}