优化
This commit is contained in:
@@ -6,23 +6,24 @@ type MediaResponse struct {
|
||||
ID uint `json:"ID"`
|
||||
CreatedAt time.Time `json:"CreatedAt"`
|
||||
UpdatedAt time.Time `json:"UpdatedAt"`
|
||||
DeletedAt any `json:"DeletedAt"`
|
||||
Name string `json:"name"`
|
||||
ClassID int `json:"classId"`
|
||||
URL string `json:"url"`
|
||||
Tag string `json:"tag"`
|
||||
Key string `json:"key"`
|
||||
Size int64 `json:"size"`
|
||||
Mime string `json:"mime"`
|
||||
MD5 string `json:"md5"`
|
||||
UserID uint `json:"userId"`
|
||||
// The compatible model embeds gorm.DeletedAt with json:"-", so this field is omitted.
|
||||
DeletedAt any `json:"-"`
|
||||
Name string `json:"name"`
|
||||
ClassID int `json:"classId"`
|
||||
URL string `json:"url"`
|
||||
Tag string `json:"tag"`
|
||||
Key string `json:"key"`
|
||||
Size int64 `json:"size"`
|
||||
Mime string `json:"mime"`
|
||||
MD5 string `json:"md5"`
|
||||
UserID uint `json:"userId"`
|
||||
}
|
||||
|
||||
type MediaCategoryResponse struct {
|
||||
ID uint `json:"ID"`
|
||||
CreatedAt time.Time `json:"CreatedAt"`
|
||||
UpdatedAt time.Time `json:"UpdatedAt"`
|
||||
DeletedAt any `json:"DeletedAt"`
|
||||
DeletedAt any `json:"-"`
|
||||
Name string `json:"name"`
|
||||
PID uint `json:"pid"`
|
||||
Children []*MediaCategoryResponse `json:"children"`
|
||||
@@ -37,9 +38,9 @@ type StorageObjectResponse struct {
|
||||
|
||||
type InitUploadResponse struct {
|
||||
Instant bool `json:"instant"`
|
||||
UploadID uint `json:"uploadId,omitempty"`
|
||||
UploadID uint `json:"uploadId"`
|
||||
UploadedChunks []int `json:"uploadedChunks"`
|
||||
Media *MediaResponse `json:"media"`
|
||||
Media *MediaResponse `json:"media,omitempty"`
|
||||
}
|
||||
|
||||
type MediaListRequest struct {
|
||||
@@ -86,13 +87,13 @@ type CategoryRequest struct {
|
||||
PID uint `json:"pid"`
|
||||
}
|
||||
type InitUploadRequest struct {
|
||||
FileName string `json:"fileName"`
|
||||
FileHash string `json:"fileHash"`
|
||||
FileSize int64 `json:"fileSize"`
|
||||
ChunkSize int64 `json:"chunkSize"`
|
||||
ChunkTotal int `json:"chunkTotal"`
|
||||
FileName string `json:"fileName" binding:"required"`
|
||||
FileHash string `json:"fileHash" binding:"required"`
|
||||
FileSize int64 `json:"fileSize" binding:"required"`
|
||||
ChunkSize int64 `json:"chunkSize" binding:"required"`
|
||||
ChunkTotal int `json:"chunkTotal" binding:"required"`
|
||||
Mime string `json:"mime"`
|
||||
}
|
||||
type CompleteUploadRequest struct {
|
||||
UploadID uint `json:"uploadId"`
|
||||
UploadID uint `json:"uploadId" binding:"required"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user