feat: add gormv2 and support sqlite

This commit is contained in:
engigu
2024-04-29 17:31:13 +08:00
parent 44054ae157
commit 33e44ce596
22 changed files with 236 additions and 279 deletions
+4 -4
View File
@@ -2,13 +2,13 @@ package models
import (
"errors"
"github.com/jinzhu/gorm"
"gorm.io/gorm"
)
type Auth struct {
ID int `json:"id" gorm:"type:int(11) AUTO_INCREMENT comment 'id';primary_key" json:"id"`
Username string `json:"username" gorm:"type:varchar(100) comment '用户名';default:'';"`
Password string `json:"password" gorm:"type:varchar(100) comment '密码';default:'';"`
ID int `json:"id" gorm:"autoIncrement;type:integer ;primaryKey" json:"id"`
Username string `json:"username" gorm:"type:varchar(100);default:'';"`
Password string `json:"password" gorm:"type:varchar(100);default:'';"`
}
// CheckAuth 检查用户信息