qudoco-be/app/database/entity/bookmarks.entity.go

21 lines
613 B
Go

package entity
import (
"time"
"github.com/google/uuid"
)
type Bookmarks struct {
ID uint `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
UserId uint `json:"user_id" gorm:"type:int4"`
ArticleId uint `json:"article_id" gorm:"type:int4"`
ClientId *uuid.UUID `json:"client_id" gorm:"type:UUID"`
IsActive *bool `json:"is_active" gorm:"type:bool;default:true"`
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
UpdatedAt time.Time `json:"updated_at" gorm:"default:now()"`
// Relations
Article Articles `json:"article" gorm:"foreignKey:ArticleId"`
}