2025-02-07 04:07:13 +00:00
|
|
|
package entity
|
|
|
|
|
|
2025-07-02 06:03:52 +00:00
|
|
|
import (
|
|
|
|
|
"time"
|
2025-09-16 16:16:51 +00:00
|
|
|
|
|
|
|
|
"github.com/google/uuid"
|
2025-07-02 06:03:52 +00:00
|
|
|
)
|
2025-02-07 04:07:13 +00:00
|
|
|
|
|
|
|
|
type ActivityLogs struct {
|
2025-07-02 06:03:52 +00:00
|
|
|
ID uint `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
|
|
|
|
|
ActivityTypeId int `json:"activity_type_id" gorm:"type:int4"`
|
|
|
|
|
Url string `json:"url" gorm:"type:varchar"`
|
|
|
|
|
VisitorIp *string `json:"visitor_ip" gorm:"type:varchar"`
|
|
|
|
|
ArticleId *uint `json:"article_id" gorm:"type:int4"`
|
|
|
|
|
UserId *uint `json:"user_id" gorm:"type:int4"`
|
|
|
|
|
ClientId *uuid.UUID `json:"client_id" gorm:"type:UUID"`
|
|
|
|
|
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
|
2025-09-16 16:16:51 +00:00
|
|
|
|
|
|
|
|
// Relations
|
|
|
|
|
Article *Articles `json:"article" gorm:"foreignKey:ArticleId;constraint:OnDelete:CASCADE"`
|
2025-02-07 04:07:13 +00:00
|
|
|
}
|