Files
Go-Web-Template/server/model/app/app_user.go
2026-04-23 15:29:07 +08:00

24 lines
652 B
Go

package app
import (
"time"
"github.com/google/uuid"
"gorm.io/gorm"
)
type AppUser struct {
ID uint `json:"id" gorm:"primaryKey"`
UUID uuid.UUID `json:"uuid" gorm:"index;not null;comment:用户UUID"`
Username string `json:"username" gorm:"uniqueIndex;size:64;not null"`
Password string `json:"-" gorm:"not null"`
Enable int `json:"enable" gorm:"default:1;comment:1正常 2禁用"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
func (AppUser) TableName() string {
return "app_users"
}