🐛 Fixed friendship check

This commit is contained in:
2024-04-06 23:34:02 +08:00
parent 44d2ec9c4a
commit d1f54099c4
4 changed files with 38 additions and 23 deletions

View File

@ -72,21 +72,3 @@ type AccountContact struct {
VerifiedAt *time.Time `json:"verified_at"`
AccountID uint `json:"account_id"`
}
type FriendshipStatus = int8
const (
FriendshipPending = FriendshipStatus(iota)
FriendshipActive
FriendshipBlocked
)
type AccountFriendship struct {
BaseModel
AccountID uint `json:"account_id"`
RelatedID uint `json:"related_id"`
Account Account `json:"account"`
Related Account `json:"related"`
Status FriendshipStatus `json:"status"`
}

20
pkg/models/friendships.go Normal file
View File

@ -0,0 +1,20 @@
package models
type FriendshipStatus = int8
const (
FriendshipPending = FriendshipStatus(iota)
FriendshipActive
FriendshipBlocked
)
type AccountFriendship struct {
BaseModel
AccountID uint `json:"account_id"`
RelatedID uint `json:"related_id"`
BlockedBy *uint `json:"blocked_by"`
Account Account `json:"account"`
Related Account `json:"related"`
Status FriendshipStatus `json:"status"`
}