fix: improvement logs and record news access

This commit is contained in:
ericprd
2025-03-20 11:11:08 +08:00
parent 290d7f6701
commit d8f6968f64
13 changed files with 81 additions and 25 deletions
+14
View File
@@ -0,0 +1,14 @@
package database
import "time"
type ContentLog struct {
ID string `gorm:"primaryKey;not null" json:"id"`
ContentID string `gorm:"not null" json:"content_id"`
UserID string `gorm:"default:null" json:"user_id"`
IP string `gorm:"default:null" json:"ip"`
UserAgent string `gorm:"default:null" json:"user_agent"`
Category string `gorm:"not null" json:"category"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
}