初始提交:一场soul的创业实验-永平 网站与小程序
Made-with: Cursor
This commit is contained in:
24
soul-api/internal/model/admin_user.go
Normal file
24
soul-api/internal/model/admin_user.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// AdminUser 后台管理员用户
|
||||
type AdminUser struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Username string `gorm:"column:username;size:64;uniqueIndex;not null" json:"username"`
|
||||
PasswordHash string `gorm:"column:password_hash;size:128;not null" json:"-"`
|
||||
Role string `gorm:"column:role;size:32;not null;default:admin" json:"role"` // super_admin | admin
|
||||
Name string `gorm:"column:name;size:64" json:"name"`
|
||||
Status string `gorm:"column:status;size:16;not null;default:active" json:"status"` // active | disabled
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
}
|
||||
|
||||
func (AdminUser) TableName() string {
|
||||
return "admin_users"
|
||||
}
|
||||
Reference in New Issue
Block a user