Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UserGORM ¶
type UserGORM struct {
ID string `gorm:"type:varchar(26);primaryKey"`
CreatedAt time.Time `gorm:"autoCreateTime"`
UpdatedAt time.Time `gorm:"autoUpdateTime"`
Username string `gorm:"unique;not null;size:150"`
Email string `gorm:"unique;not null;size:254"`
FirstName string `gorm:"size:150"`
LastName string `gorm:"size:150"`
Password string `gorm:"not null;size:128"`
Height float64 `gorm:"not null"`
Weight float64 `gorm:"not null"`
OTP *string `gorm:"size:6"`
IsStaff bool `gorm:"default:false"`
IsActive bool `gorm:"default:true"`
IsSuperuser bool `gorm:"default:false"`
IsVerified bool `gorm:"default:false"`
DateJoined time.Time `gorm:"autoCreateTime"`
LastLogin *time.Time `gorm:"type:timestamp"`
ProfileImageURL string `gorm:"size:512"`
}
UserGORM represents the GORM model for User
func UserModelToGORM ¶
FromUserModel converts domain model to GORM model
func (*UserGORM) BeforeCreate ¶
BeforeCreate hook to set ID if not provided
func (*UserGORM) ToUserModel ¶
ToUserModel converts GORM model to domain model
Click to show internal directories.
Click to hide internal directories.