- Development dotenvs - Caddy service - Redis service - Postgres service - Fix env parser error Signed-off-by: Asai Neko <sugar@sne.moe>
23 lines
763 B
Go
23 lines
763 B
Go
package data
|
|
|
|
import "github.com/google/uuid"
|
|
|
|
type User struct {
|
|
Id uint `json:"id" gorm:"primarykey;autoincrement"`
|
|
UUID uuid.UUID `json:"uuid" gorm:"type:uuid;uniqueindex;not null"`
|
|
UserId string `json:"user_id" gorm:"size:8;uniqueindex;not null"`
|
|
Email string `json:"email" gorm:"uniqueindex;not null"`
|
|
Nickname string `json:"nickname" gorm:"not null"`
|
|
Type string `json:"type" gorm:"not null"`
|
|
Subtitle string `json:"subtitle" gorm:"not null"`
|
|
Avatar string `json:"avatar" gorm:"not null"`
|
|
Checkin bool `json:"checkin" gorm:"not null"`
|
|
}
|
|
|
|
func (self *User) GetByEmail(email string) error {
|
|
if err := Database.Where("email = ?", email).First(&self).Error; err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|