2025-02-26 22:28:19 +08:00
|
|
|
package database
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type User struct {
|
2025-03-02 04:36:17 +08:00
|
|
|
ID string `gorm:"primaryKey;not null" json:"id"`
|
2025-02-26 22:28:19 +08:00
|
|
|
SubscribeID string `gorm:"not null" json:"subscribe_id"`
|
2025-03-01 21:27:28 +08:00
|
|
|
Email string `gorm:"unique;not null" json:"email"`
|
2025-02-26 22:28:19 +08:00
|
|
|
Password string `gorm:"not null" json:"password"`
|
2025-03-01 21:27:28 +08:00
|
|
|
Phone string `gorm:"default:not null;unique" json:"phone"`
|
2025-02-26 22:28:19 +08:00
|
|
|
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
|
|
|
|
|
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
|
2025-02-27 01:14:16 +08:00
|
|
|
|
|
|
|
|
Subscribe Subscribe `gorm:"foreignKey:SubscribeID;constraint:OnDelete:CASCADE"`
|
2025-02-26 22:28:19 +08:00
|
|
|
}
|