refactor backend packages and global db service
This commit is contained in:
17
backend/internal/models/user.go
Normal file
17
backend/internal/models/user.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type SenlinAgentUser struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
Email string `gorm:"uniqueIndex;not null"`
|
||||
DisplayName string `gorm:"not null"`
|
||||
PasswordHash string `gorm:"not null"`
|
||||
Role string `gorm:"not null;default:user"`
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
func (SenlinAgentUser) TableName() string {
|
||||
return "senlin_agent_users"
|
||||
}
|
||||
Reference in New Issue
Block a user