Changed project structure
This commit is contained in:
11
internal/models/account.go
Normal file
11
internal/models/account.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package models
|
||||
|
||||
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"`
|
||||
}
|
11
internal/models/mediaAttachment.go
Normal file
11
internal/models/mediaAttachment.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package models
|
||||
|
||||
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"`
|
||||
Approved bool `json:"-"`
|
||||
PostID string // Foreign key to Post
|
||||
}
|
9
internal/models/post.go
Normal file
9
internal/models/post.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package models
|
||||
|
||||
type Post struct {
|
||||
ID string `json:"id" gorm:"primaryKey"`
|
||||
Url string `json:"url"`
|
||||
AccountID string // Foreign key field (must match Account.AccId)
|
||||
Account Account `json:"account" gorm:"foreignKey:AccountID;references:AccId"`
|
||||
Attachments []MediaAttachment `json:"media_attachments" gorm:"foreignKey:PostID;references:ID"`
|
||||
}
|
Reference in New Issue
Block a user