fix: improvement log record ads tih ip, useragent, and uer_id

This commit is contained in:
ericprd
2025-03-19 22:43:31 +08:00
parent b0099dac1e
commit 290d7f6701
9 changed files with 83 additions and 28 deletions
+5 -3
View File
@@ -3,9 +3,11 @@ package database
import "time"
type LogAds struct {
ID string `gorm:"primaryKey;not null" json:"id"`
AdsID string `gorm:"not null" json:"ads_id"`
// UserID string `gorm:"default:null" json:"user_id"`
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"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
}