Add password validation

This commit is contained in:
2024-04-25 22:51:37 +07:00
commit 2e2fbdf800
51 changed files with 3526 additions and 0 deletions

28
types/models/models.go Normal file
View File

@ -0,0 +1,28 @@
package models
import "github.com/google/uuid"
type User struct {
UserID uuid.UUID `gorm:"primaryKey;not null;unique"`
Username string `gorm:"unique;not null"`
Email string `gorm:"unique;not null"`
Password string `gorm:"not null"`
}
type File struct {
ID uuid.UUID `gorm:"primaryKey;not null;unique"`
OwnerID uuid.UUID `gorm:"not null"`
Name string `gorm:"not null"`
Size int `gorm:"not null"`
Downloaded int `gorm:"not null;default=0"`
}
type FilesUploaded struct {
UploadID uuid.UUID `gorm:"primaryKey;not null;unique"`
FileID uuid.UUID `gorm:"not null"`
OwnerID uuid.UUID `gorm:"not null"`
Name string `gorm:"not null"`
Size int `gorm:"not null"`
Uploaded int `gorm:"not null;default=0"`
Done bool `gorm:"not null;default=false"`
}