teldrive/pkg/schemas/file.go

102 lines
2.9 KiB
Go
Raw Normal View History

2023-08-07 03:32:46 +08:00
package schemas
import (
"time"
)
2023-12-03 03:47:23 +08:00
type Part struct {
ID int64 `json:"id"`
Salt string `json:"salt"`
2023-12-03 03:47:23 +08:00
}
2023-08-07 03:32:46 +08:00
type FileQuery struct {
Name string `form:"name"`
Search string `form:"search"`
Type string `form:"type"`
Path string `form:"path"`
Op string `form:"op"`
Starred *bool `form:"starred"`
ParentID string `form:"parentId"`
2024-04-19 04:46:47 +08:00
Category string `form:"category"`
UpdatedAt *time.Time `form:"updatedAt"`
Sort string `form:"sort"`
Order string `form:"order"`
PerPage int `form:"perPage"`
NextPageToken string `form:"nextPageToken"`
2023-08-07 03:32:46 +08:00
}
type FileIn struct {
2023-12-03 03:47:23 +08:00
Name string `json:"name" binding:"required"`
Type string `json:"type" binding:"required"`
Parts []Part `json:"parts,omitempty"`
MimeType string `json:"mimeType"`
ChannelID int64 `json:"channelId"`
Path string `json:"path" binding:"required"`
Size int64 `json:"size"`
ParentID string `json:"parentId"`
2023-12-08 05:46:06 +08:00
Encrypted bool `json:"encrypted"`
2023-08-07 03:32:46 +08:00
}
type FileOut struct {
2023-12-23 01:27:58 +08:00
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
MimeType string `json:"mimeType"`
2024-04-19 04:46:47 +08:00
Category string `json:"category,omitempty"`
2024-04-19 16:39:44 +08:00
Encrypted bool `json:"encrypted"`
2023-12-23 01:27:58 +08:00
Path string `json:"path,omitempty"`
Size int64 `json:"size,omitempty"`
Starred bool `json:"starred"`
ParentID string `json:"parentId,omitempty"`
ParentPath string `json:"parentPath,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
2023-12-03 03:47:23 +08:00
}
type FileOutFull struct {
*FileOut
2023-12-03 03:47:23 +08:00
Parts []Part `json:"parts,omitempty"`
ChannelID int64 `json:"channelId"`
2023-12-08 05:46:06 +08:00
Encrypted bool `json:"encrypted"`
2023-12-03 03:47:23 +08:00
}
type FileUpdate struct {
2023-12-03 03:47:23 +08:00
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Path string `json:"path,omitempty"`
2023-12-03 07:03:16 +08:00
Starred *bool `json:"starred,omitempty"`
2023-12-03 03:47:23 +08:00
ParentID string `json:"parentId,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
Parts []Part `json:"parts,omitempty"`
2023-08-07 03:32:46 +08:00
}
type FileResponse struct {
Files []FileOut `json:"results"`
2023-08-07 03:32:46 +08:00
NextPageToken string `json:"nextPageToken,omitempty"`
}
2023-08-14 04:58:06 +08:00
type FileOperation struct {
2023-12-03 03:47:23 +08:00
Files []string `json:"files" binding:"required"`
2023-08-14 04:58:06 +08:00
Destination string `json:"destination,omitempty"`
2023-08-07 03:32:46 +08:00
}
2023-11-02 03:57:07 +08:00
type DirMove struct {
2023-12-04 03:21:30 +08:00
Source string `json:"source" binding:"required"`
Destination string `json:"destination" binding:"required"`
2023-11-02 03:57:07 +08:00
}
type MkDir struct {
2023-12-03 03:47:23 +08:00
Path string `json:"path" binding:"required"`
}
2023-11-09 19:10:37 +08:00
type Copy struct {
2023-12-03 03:47:23 +08:00
ID string `json:"id" binding:"required"`
Name string `json:"name" binding:"required"`
Destination string `json:"destination" binding:"required"`
2023-11-09 19:10:37 +08:00
}
2024-04-19 04:46:47 +08:00
type FileCategoryStats struct {
TotalFiles int `json:"totalFiles"`
TotalSize int `json:"totalSize"`
Category string `json:"category"`
}