refactor(download): handle stream saver download outside of driver implementation (fix #2366)

This commit is contained in:
Aaron Liu
2025-05-16 13:52:31 +08:00
parent bdaf091aca
commit 0a28bf1689
8 changed files with 73 additions and 59 deletions

View File

@@ -367,8 +367,8 @@ type (
NoCache bool `json:"no_cache"`
}
FileURLResponse struct {
Urls []string `json:"urls"`
Expires *time.Time `json:"expires"`
Urls []manager.EntityUrl `json:"urls"`
Expires *time.Time `json:"expires"`
}
ArchiveDownloadSession struct {
Uris []*fs.URI `json:"uris"`
@@ -419,7 +419,7 @@ func (s *FileURLService) GetArchiveDownloadSession(c *gin.Context) (*FileURLResp
}
return &FileURLResponse{
Urls: []string{finalUrl.String()},
Urls: []manager.EntityUrl{{Url: finalUrl.String()}},
Expires: &expire,
}, nil
}
@@ -473,7 +473,7 @@ func (s *FileURLService) Get(c *gin.Context) (*FileURLResponse, error) {
//}
if s.Redirect && len(uris) == 1 {
c.Redirect(http.StatusFound, res[0])
c.Redirect(http.StatusFound, res[0].Url)
return nil, nil
}

View File

@@ -71,6 +71,7 @@ type (
// UserResetEmailService 发送密码重设邮件服务
UserResetEmailService struct {
UserName string `form:"email" json:"email" binding:"required,email"`
Language string `form:"language" json:"language"`
}
UserResetEmailParameterCtx struct{}
)