2024-02-01 15:26:17 +00:00
|
|
|
package models
|
|
|
|
|
2024-02-03 07:20:32 +00:00
|
|
|
import "time"
|
|
|
|
|
2024-02-18 14:41:18 +00:00
|
|
|
// Account profiles basically fetched from Hydrogen.Identity
|
2024-02-01 15:26:17 +00:00
|
|
|
// But cache at here for better usage
|
|
|
|
// At the same time this model can make relations between local models
|
|
|
|
type Account struct {
|
|
|
|
BaseModel
|
|
|
|
|
2024-02-09 04:36:39 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
Nick string `json:"nick"`
|
|
|
|
Avatar string `json:"avatar"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
EmailAddress string `json:"email_address"`
|
|
|
|
PowerLevel int `json:"power_level"`
|
|
|
|
Posts []Post `json:"posts" gorm:"foreignKey:AuthorID"`
|
|
|
|
Attachments []Attachment `json:"attachments" gorm:"foreignKey:AuthorID"`
|
|
|
|
LikedPosts []PostLike `json:"liked_posts"`
|
|
|
|
DislikedPosts []PostDislike `json:"disliked_posts"`
|
|
|
|
RealmIdentities []RealmMember `json:"identities"`
|
|
|
|
Realms []Realm `json:"realms"`
|
|
|
|
ExternalID uint `json:"external_id"`
|
2024-02-01 15:26:17 +00:00
|
|
|
}
|
2024-02-03 07:20:32 +00:00
|
|
|
|
|
|
|
type AccountMembership struct {
|
|
|
|
ID uint `json:"id" gorm:"primaryKey"`
|
|
|
|
CreatedAt time.Time `json:"created_at"`
|
|
|
|
UpdatedAt time.Time `json:"updated_at"`
|
2024-02-12 09:24:17 +00:00
|
|
|
Follower Account `json:"follower"`
|
|
|
|
Following Account `json:"following"`
|
2024-02-03 07:20:32 +00:00
|
|
|
FollowerID uint
|
|
|
|
FollowingID uint
|
|
|
|
}
|