mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 17:41:57 +08:00
Feat: support chunk size option in policy
This commit is contained in:
@@ -46,11 +46,12 @@ type Object struct {
|
||||
|
||||
// PolicySummary 用于前端组件使用的存储策略概况
|
||||
type PolicySummary struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
MaxSize uint64 `json:"max_size"`
|
||||
FileType []string `json:"file_type"`
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
MaxSize uint64 `json:"max_size"`
|
||||
FileType []string `json:"file_type"`
|
||||
ChunkSize uint64 `json:"chunk_size"`
|
||||
}
|
||||
|
||||
// BuildObjectList 构建列目录响应
|
||||
@@ -65,11 +66,12 @@ func BuildObjectList(parent uint, objects []Object, policy *model.Policy) Object
|
||||
|
||||
if policy != nil {
|
||||
res.Policy = &PolicySummary{
|
||||
ID: hashid.HashID(policy.ID, hashid.PolicyID),
|
||||
Name: policy.Name,
|
||||
Type: policy.Type,
|
||||
MaxSize: policy.MaxSize,
|
||||
FileType: policy.OptionsSerialized.FileType,
|
||||
ID: hashid.HashID(policy.ID, hashid.PolicyID),
|
||||
Name: policy.Name,
|
||||
Type: policy.Type,
|
||||
MaxSize: policy.MaxSize,
|
||||
FileType: policy.OptionsSerialized.FileType,
|
||||
ChunkSize: policy.OptionsSerialized.ChunkSize,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ type UploadSession struct {
|
||||
Name string
|
||||
Size uint64
|
||||
SavePath string
|
||||
ChunkSize uint64
|
||||
}
|
||||
|
||||
// UploadCallback 上传回调正文
|
||||
|
||||
Reference in New Issue
Block a user