fix: improvement logs and record news access
This commit is contained in:
@@ -2,12 +2,13 @@ package database
|
||||
|
||||
import "time"
|
||||
|
||||
type LogAds struct {
|
||||
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"`
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package database
|
||||
|
||||
import "time"
|
||||
|
||||
type LogNews struct {
|
||||
ID string `gorm:"primaryKey;not null" json:"id"`
|
||||
NewsID string `gorm:"not null" json:"news_id"`
|
||||
UserID string `gorm:"not null" json:"user_id"`
|
||||
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
|
||||
}
|
||||
+1
-2
@@ -55,7 +55,6 @@ func (db *DB) Migrate() error {
|
||||
&Tag{},
|
||||
&Category{},
|
||||
&Ads{},
|
||||
&LogAds{},
|
||||
&LogNews{},
|
||||
&ContentLog{},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user