fix(upload): 分片上传 - 先预留配额并原子提交容量 (#679)
Co-authored-by: ddcat666 <26564566+ddcat666@users.noreply.github.com>
This commit is contained in:
13
backend/internal/model/upload_reservation.go
Normal file
13
backend/internal/model/upload_reservation.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
// UploadReservation survives process restarts; expiry, not process ownership,
|
||||
// bounds its lifetime. Day records the UTC quota bucket charged at admission.
|
||||
type UploadReservation struct {
|
||||
ID string `gorm:"primaryKey;size:64"`
|
||||
UserID string `gorm:"index;size:64;not null"`
|
||||
Size int64 `gorm:"not null"`
|
||||
Day string `gorm:"size:10;not null"`
|
||||
ExpiresAt time.Time `gorm:"index;not null"`
|
||||
}
|
||||
Reference in New Issue
Block a user