feat: user manage api

This commit is contained in:
Noah Hsu
2022-06-26 19:36:27 +08:00
parent 6b9bca893b
commit cab498e376
5 changed files with 101 additions and 10 deletions

View File

@ -12,13 +12,13 @@ const (
)
type User struct {
ID uint `json:"id" gorm:"primaryKey"` // unique key
Username string `json:"username" gorm:"unique"` // username
Password string `json:"password"` // password
BasePath string `json:"base_path"` // base path
ReadOnly bool `json:"read_only"` // read only
Webdav bool `json:"webdav"` // allow webdav
Role int `json:"role"` // user's role
ID uint `json:"id" gorm:"primaryKey"` // unique key
Username string `json:"username" gorm:"unique" binding:"required"` // username
Password string `json:"password"` // password
BasePath string `json:"base_path"` // base path
ReadOnly bool `json:"read_only"` // read only
Webdav bool `json:"webdav"` // allow webdav
Role int `json:"role"` // user's role
}
func (u User) IsGuest() bool {