Refactor app structure: move models to domain, centralize config and database init - TODO: add jwt

This commit is contained in:
2025-05-17 20:07:29 +03:30
parent ab9254fcad
commit 7b601e75ba
12 changed files with 142 additions and 181 deletions

View File

@@ -7,3 +7,24 @@ type Post struct {
Account Account `json:"account" gorm:"foreignKey:AccountID;references:AccId"`
Attachments []MediaAttachment `json:"media_attachments" gorm:"foreignKey:PostID;references:ID"`
}
type Account struct {
AccId string `json:"id" gorm:"primaryKey"`
Username string `json:"username"`
Acct string `json:"acct"`
DisplayName string `json:"display_name"`
IsBot bool `json:"bot"`
Url string `json:"url"`
AvatarStatic string `json:"avatar_static"`
}
type MediaAttachment struct {
ID string `json:"id" gorm:"primaryKey"`
Type string `json:"type"`
Url string `json:"url"`
PreviewUrl string `json:"preview_url"`
RemoteUrl string `json:"remote_url"`
PostID string // Foreign key to Post
Approved bool `json:"approved"`
Rejected bool `json:"rejected"`
}