fix: add start date and end date of ads

This commit is contained in:
ericprd
2025-03-13 11:45:39 +08:00
parent ce17e9dc73
commit 47085ca0ae
3 changed files with 23 additions and 15 deletions
+7 -5
View File
@@ -3,9 +3,11 @@ package database
import "time"
type Ads struct {
ID string `gorm:"primaryKey;not null" json:"id"`
ImageUrl string `gorm:"not null" json:"image_url"`
Url string `gorm:"not null" json:"url"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
ID string `gorm:"primaryKey;not null" json:"id"`
ImageUrl string `gorm:"not null" json:"image_url"`
Url string `gorm:"not null" json:"url"`
StartDate *time.Time `gorm:"default:null" json:"start_date"`
EndDate *time.Time `gorm:"default:null" json:"end_date"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
}