feat(init): First commit
This commit is contained in:
commit
f92368748a
22 changed files with 1298 additions and 0 deletions
24
pkg/models/user.go
Normal file
24
pkg/models/user.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
ID uuid.UUID `gorm:"column:id;type:uuid;default:gen_random_uuid()" yaml:"id"`
|
||||
Username string `gorm:"primaryKey;column:username;type:varchar(256);not null" yaml:"username"`
|
||||
Domain string `gorm:"primaryKey;column:domain;type:varchar(256);not null" yaml:"domain"`
|
||||
Password string `gorm:"column:password;type:varchar(256);not null" yaml:"password"`
|
||||
Home string `gorm:"column:home;type:varchar(256);not null;default:/var/lib/vmail/null" yaml:"home"`
|
||||
UID int `gorm:"column:uid;type:integer;not null;default:1000" yaml:"uid"`
|
||||
GID int `gorm:"column:gid;type:integer;not null;default:1000" yaml:"gid"`
|
||||
Active bool `gorm:"column:active;type:boolean;not null;default:true" yaml:"active"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;type:timestamp;not null;autoCreateTime:nano;default:now()" yaml:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"column:udpated_at;type:timestamp;not null;autoUpdateTime:nano;default:now()" yaml:"updated_at"`
|
||||
}
|
||||
|
||||
func (o *User) TableName() string {
|
||||
return "users"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue