18 lines
294 B
Go
18 lines
294 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type UserFavorite struct {
|
|
UserID string `gorm:"primaryKey"`
|
|
PostID string `gorm:"primaryKey"`
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
func (UserFavorite) TableName() string {
|
|
return "UserFavorites"
|
|
}
|
|
|
|
type FavoriteList struct {
|
|
Posts []Post `json:"posts,omitempty"`
|
|
}
|