Add: Simple user login/register function

This commit is contained in:
2021-12-11 18:47:25 +08:00
parent c580ca245f
commit f3a95973e9
11 changed files with 379 additions and 13 deletions

View File

@@ -20,6 +20,14 @@ type Folder struct {
Foldername string `json:"foldername"`
}
type User struct {
ID int64 `json:"id"`
Username string `json:"username"`
Password string `json:"-"`
Role int64 `json:"role"`
AvatarId int64 `json:"avatar_id"`
}
func (f *File) Path() (string, error) {
folder, err := f.Db.GetFolder(f.Folder_id)
if err != nil {
@@ -27,4 +35,3 @@ func (f *File) Path() (string, error) {
}
return filepath.Join(folder.Folder, f.Filename), nil
}