remove chunk
This commit is contained in:
parent
44f0cf68be
commit
3e48bd14df
@ -26,22 +26,12 @@ var (
|
||||
|
||||
// Model
|
||||
type File struct {
|
||||
ID uint32 `gorm:"primary_key" json:"id"`
|
||||
Name string `gorm:"not null" json:"name"`
|
||||
Checksum string `gorm:"unique;size:44;not null"`
|
||||
Size uint64 `gorm:"not null"`
|
||||
Author *Account `gorm:"constraint:OnDelete:SET NULL,OnUpdate:CASCADE" json:"author"`
|
||||
AuthorId *uint32 `json:"-"`
|
||||
Chunks []*FileChunk `gorm:"constraint:OnDelete:CASCADE,OnUpdate:CASCADE"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type FileChunk struct {
|
||||
FileId uint32
|
||||
File *File `gorm:"constraint:OnDelete:CASCADE,OnUpdate:CASCADE"`
|
||||
Part uint32
|
||||
ID uint32 `gorm:"primary_key" json:"id"`
|
||||
Name string `gorm:"not null" json:"name"`
|
||||
Checksum string `gorm:"unique;size:44;not null"`
|
||||
Size uint64 `gorm:"not null"`
|
||||
Author *Account `gorm:"constraint:OnDelete:SET NULL,OnUpdate:CASCADE" json:"author"`
|
||||
AuthorId *uint32 `json:"-"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
@ -176,6 +166,7 @@ func (s *Service) UploadComplete(c *gin.Context) {
|
||||
|
||||
func (s *Service) UploadInit() {
|
||||
upload := s.Gin.Group("/upload")
|
||||
upload.Use(s.RequireSession)
|
||||
|
||||
// start
|
||||
upload.POST("", s.UploadCreate)
|
||||
|
Loading…
x
Reference in New Issue
Block a user