✨ CRUD of subscriptions
This commit is contained in:
@ -5,8 +5,9 @@ import "git.solsynth.dev/hydrogen/dealer/pkg/hyper"
|
||||
type Account struct {
|
||||
hyper.BaseUser
|
||||
|
||||
Posts []Post `json:"posts" gorm:"foreignKey:AuthorID"`
|
||||
Reactions []Reaction `json:"reactions"`
|
||||
Posts []Post `json:"posts" gorm:"foreignKey:AuthorID"`
|
||||
Reactions []Reaction `json:"reactions"`
|
||||
Subscriptions []Subscription `json:"subscriptions" gorm:"foreginKey:FollowerID"`
|
||||
|
||||
TotalUpvote int `json:"total_upvote"`
|
||||
TotalDownvote int `json:"total_downvote"`
|
||||
|
16
pkg/internal/models/subscriptions.go
Normal file
16
pkg/internal/models/subscriptions.go
Normal file
@ -0,0 +1,16 @@
|
||||
package models
|
||||
|
||||
import "git.solsynth.dev/hydrogen/dealer/pkg/hyper"
|
||||
|
||||
type Subscription struct {
|
||||
hyper.BaseModel
|
||||
|
||||
FollowerID uint `json:"follower_id"`
|
||||
Follower Account `json:"follower"`
|
||||
AccountID *uint `json:"account_id,omitempty"`
|
||||
Account *Account `json:"account,omitempty"`
|
||||
TagID *uint `json:"tag_id,omitempty"`
|
||||
Tag Tag `json:"tag,omitempty"`
|
||||
CategoryID *uint `json:"category_id,omitempty"`
|
||||
Category Category `json:"category,omitempty"`
|
||||
}
|
Reference in New Issue
Block a user