teldrive/pkg/schemas/file.go

99 lines
2.9 KiB
Go
Raw Normal View History

2023-08-07 03:32:46 +08:00
package schemas
import (
"time"
)
type PaginationQuery struct {
PerPage int `form:"perPage"`
NextPageToken string `form:"nextPageToken"`
}
type SortingQuery struct {
Sort string `form:"sort"`
Order string `form:"order"`
}
2023-12-03 03:47:23 +08:00
type Part struct {
ID int64 `json:"id"`
}
2023-08-07 03:32:46 +08:00
type FileQuery struct {
Name string `form:"name" mapstructure:"name,omitempty"`
Search string `form:"search" mapstructure:"search,omitempty"`
Type string `form:"type" mapstructure:"type,omitempty"`
Path string `form:"path" mapstructure:"path,omitempty"`
Op string `form:"op" mapstructure:"op,omitempty"`
Starred *bool `form:"starred" mapstructure:"starred,omitempty"`
MimeType string `form:"mimeType" mapstructure:"mime_type,omitempty"`
ParentID string `form:"parentId" mapstructure:"parent_id,omitempty"`
UpdatedAt *time.Time `form:"updatedAt" mapstructure:"updated_at,omitempty"`
2023-08-14 04:58:06 +08:00
Status string `mapstructure:"status"`
2023-08-22 23:00:14 +08:00
UserID int64 `mapstructure:"user_id"`
2023-08-07 03:32:46 +08:00
}
2023-12-03 03:47:23 +08:00
type CreateFile struct {
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 {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
2023-12-03 03:47:23 +08:00
MimeType string `json:"mimeType"`
Path string `json:"path,omitempty"`
Size int64 `json:"size,omitempty"`
Starred bool `json:"starred"`
ParentID string `json:"parentId,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
}
type FileOutFull struct {
FileOut
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 UpdateFile struct {
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"`
2023-08-07 03:32:46 +08:00
}
type FileResponse struct {
Results []FileOut `json:"results"`
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
}