修改数据库表

This commit is contained in:
bjdgyc
2021-07-19 15:15:29 +08:00
parent 8ff77626d0
commit e4f959cb69
5 changed files with 94 additions and 46 deletions

View File

@@ -10,21 +10,21 @@ import (
"github.com/xlzd/gotp"
)
type User struct {
Id int `json:"id" xorm:"pk autoincr not null"`
Username string `json:"username" storm:"not null unique"`
Nickname string `json:"nickname"`
Email string `json:"email"`
// Password string `json:"password"`
PinCode string `json:"pin_code"`
OtpSecret string `json:"otp_secret"`
DisableOtp bool `json:"disable_otp"` // 禁用otp
Groups []string `json:"groups"`
Status int8 `json:"status"` // 1正常
SendEmail bool `json:"send_email"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// type User struct {
// Id int `json:"id" xorm:"pk autoincr not null"`
// Username string `json:"username" storm:"not null unique"`
// Nickname string `json:"nickname"`
// Email string `json:"email"`
// // Password string `json:"password"`
// PinCode string `json:"pin_code"`
// OtpSecret string `json:"otp_secret"`
// DisableOtp bool `json:"disable_otp"` // 禁用otp
// Groups []string `json:"groups"`
// Status int8 `json:"status"` // 1正常
// SendEmail bool `json:"send_email"`
// CreatedAt time.Time `json:"created_at"`
// UpdatedAt time.Time `json:"updated_at"`
// }
func SetUser(v *User) error {
var err error