feat: ads log

This commit is contained in:
ericprd
2025-03-17 22:19:17 +08:00
parent ee8e8e140d
commit c0dcdb77fa
19 changed files with 276 additions and 4 deletions
+11
View File
@@ -0,0 +1,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:"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"`
}
+11
View File
@@ -0,0 +1,11 @@
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"`
}
+2
View File
@@ -55,5 +55,7 @@ func (db *DB) Migrate() error {
&Tag{},
&Category{},
&Ads{},
&LogAds{},
&LogNews{},
)
}