You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nucleus/internal/entities/user_entity.go

23 lines
770 B

package entities
import (
"database/sql"
"gorm.io/gorm"
"time"
)
type User struct {
Id uint `json:"id" gorm:"primaryKey"`
Nickname string `json:"secret_key"`
Gender string `json:"gender"`
Avatar string `json:"avatar"`
Username sql.NullString `json:"username" gorm:"unique"`
Email sql.NullString `json:"email" gorm:"unique"`
PhoneNumber sql.NullString `json:"phone_number" gorm:"unique"`
Password sql.NullString `json:"password"`
Data []*UserData `json:"data,omitempty" gorm:"foreignKey:Uid;references:Id"`
CreatedAt time.Time `json:"create_time"`
UpdatedAt time.Time `json:"update_time"`
DeletedAt gorm.DeletedAt `json:"delete_time,omitempty" gorm:"index"`
}