feat: create user, read users, batch delete users

This commit is contained in:
naiba
2024-10-22 21:19:30 +08:00
parent 73e3e4f3a1
commit 387da11f1b
7 changed files with 107 additions and 11 deletions

View File

@@ -2,6 +2,6 @@ package model
type User struct {
Common
Username string `json:"username,omitempty"`
Username string `json:"username,omitempty" gorm:"uniqueIndex"`
Password string `json:"password,omitempty" gorm:"type:char(72)"`
}

6
model/user_api.go Normal file
View File

@@ -0,0 +1,6 @@
package model
type UserForm struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty" gorm:"type:char(72)"`
}