user.go 399 B

123456789101112131415161718192021
  1. package model
  2. import (
  3. "gorm.io/gorm"
  4. "time"
  5. )
  6. type User struct {
  7. Id uint `gorm:"primarykey"`
  8. UserId string `gorm:"unique;not null"`
  9. Nickname string `gorm:"not null"`
  10. Password string `gorm:"not null"`
  11. Email string `gorm:"not null"`
  12. CreatedAt time.Time
  13. UpdatedAt time.Time
  14. DeletedAt gorm.DeletedAt `gorm:"index"`
  15. }
  16. func (u *User) TableName() string {
  17. return "users"
  18. }