Allow normal user to upload.

This commit is contained in:
2025-07-10 15:10:56 +08:00
parent 747f76991d
commit dd5e5193da
14 changed files with 216 additions and 17 deletions

View File

@@ -1,8 +1,9 @@
package model
import (
"gorm.io/gorm"
"time"
"gorm.io/gorm"
)
type Storage struct {
@@ -12,6 +13,7 @@ type Storage struct {
Config string
MaxSize int64
CurrentSize int64
IsDefault bool
}
type StorageView struct {
@@ -21,6 +23,7 @@ type StorageView struct {
MaxSize int64 `json:"maxSize"`
CurrentSize int64 `json:"currentSize"`
CreatedAt time.Time `json:"createdAt"`
IsDefault bool `json:"isDefault"`
}
func (s *Storage) ToView() StorageView {
@@ -31,5 +34,6 @@ func (s *Storage) ToView() StorageView {
MaxSize: s.MaxSize,
CurrentSize: s.CurrentSize,
CreatedAt: s.CreatedAt,
IsDefault: s.IsDefault,
}
}