Starting to improve the project structure

This commit is contained in:
2025-05-17 18:43:54 +03:30
parent cb5149b7bc
commit ab9254fcad
11 changed files with 874 additions and 16 deletions
+11
View File
@@ -0,0 +1,11 @@
package domain
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"`
}
+12
View File
@@ -0,0 +1,12 @@
package domain
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"`
}
+9
View File
@@ -0,0 +1,9 @@
package domain
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"`
}
@@ -0,0 +1,5 @@
package requestmodels
type ApproveMediaInput struct {
MediaId string `json:"mediaId" binding:"required"`
}
+5
View File
@@ -0,0 +1,5 @@
package requestmodels
type LoginInput struct {
Password string `json:"password" binding:"required"`
}
@@ -0,0 +1,5 @@
package requestmodels
type RejectMediaInput struct {
MediaId string `json:"mediaId" binding:"required"`
}