Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ban ¶ added in v0.2.7
type Ban struct {
Id uint `gorm:"primaryKey" query:"unique"`
UserId uint `gorm:"not null"`
User User `gorm:"foreignKey:UserId;constraint:OnDelete:CASCADE"`
Reason string `gorm:"type:text"`
IsPermanent bool `gorm:"not null;default:false"`
UnbanDate *time.Time
IsActive bool `gorm:"not null;default:true"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" query:"unique"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`
}
func (Ban) MarkerEntity ¶ added in v0.2.10
func (b Ban) MarkerEntity()
type Image ¶
type Image struct {
Id uint `gorm:"primaryKey"`
S3Key string `gorm:"size:255;not null"`
Url string `gorm:"size:512;not null"`
UserID *uint `gorm:"index"` // Указатель для nullable
Size int `gorm:""`
MimeType string `gorm:"size:50"`
ExpiresAt time.Time `gorm:""`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`
}
func (Image) MarkerEntity ¶ added in v0.2.10
func (b Image) MarkerEntity()
type Role ¶
type Role struct {
Id uint `gorm:"primaryKey" query:"unique"`
Name role_enum.RoleName `gorm:"unique;not null" query:"unique"`
Description string
CreatedAt time.Time
UpdatedAt time.Time
}
func (Role) MarkerEntity ¶ added in v0.2.10
func (r Role) MarkerEntity()
type User ¶
type User struct {
Id uint `gorm:"primaryKey" query:"unique"`
Username string `gorm:"unique;not null" query:"unique"`
Email string `gorm:"unique;not null" query:"ops:ilike|like|eq|neq,unique"`
PasswordHash string `gorm:"not null" query:"ignore"`
FirstName string
LastName string
RoleId uint
IsBanned bool `gorm:"default:false"`
Bans []Ban `gorm:"foreignKey:UserId"`
Role Role `gorm:"foreignKey:RoleId"`
IsActive bool `gorm:"default:true"`
LastLogin *time.Time
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`
}
func (User) MarkerEntity ¶ added in v0.2.10
func (user User) MarkerEntity()
Click to show internal directories.
Click to hide internal directories.