mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 13:47:15 +08:00
25 lines
651 B
Go
25 lines
651 B
Go
package biz
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type User struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
Username string `gorm:"not null;unique" json:"username"`
|
|
Password string `gorm:"not null" json:"password"`
|
|
Email string `gorm:"not null" json:"email"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
|
|
}
|
|
|
|
type UserRepo interface {
|
|
Create(username, password string) (*User, error)
|
|
CheckPassword(username, password string) (*User, error)
|
|
Get(id uint) (*User, error)
|
|
Save(user *User) error
|
|
}
|