feat: get file source link in batch

This commit is contained in:
HFO4
2022-04-29 19:59:25 +08:00
parent 4a4375a796
commit 1038bae238
9 changed files with 73 additions and 37 deletions

View File

@@ -80,6 +80,8 @@ const (
CodeInvalidChunkIndex = 400012
// CodeInvalidContentLength 无效的正文长度
CodeInvalidContentLength = 400013
// CodeBatchSourceSize 超出批量获取外链限制
CodeBatchSourceSize = 40014
// CodeDBError 数据库操作失败
CodeDBError = 50001
// CodeEncryptError 加密失败

View File

@@ -76,3 +76,11 @@ func BuildObjectList(parent uint, objects []Object, policy *model.Policy) Object
return res
}
// Sources 获取外链的结果响应
type Sources struct {
URL string `json:"url"`
Name string `json:"name"`
Parent uint `json:"parent"`
Error string `json:"error,omitempty"`
}

View File

@@ -40,6 +40,7 @@ type group struct {
ShareDownload bool `json:"shareDownload"`
CompressEnabled bool `json:"compress"`
WebDAVEnabled bool `json:"webdav"`
SourceBatchSize int `json:"sourceBatch"`
}
type tag struct {
@@ -98,6 +99,7 @@ func BuildUser(user model.User) User {
ShareDownload: user.Group.OptionsSerialized.ShareDownload,
CompressEnabled: user.Group.OptionsSerialized.ArchiveTask,
WebDAVEnabled: user.Group.WebDAVEnabled,
SourceBatchSize: user.Group.OptionsSerialized.SourceBatchSize,
},
Tags: buildTagRes(tags),
}