Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.21.12.1^2
zouap 4 years ago
parent
commit
515b8cf375
2 changed files with 2 additions and 3 deletions
  1. +1
    -0
      modules/storage/obs.go
  2. +1
    -3
      routers/repo/ai_model_manage.go

+ 1
- 0
modules/storage/obs.go View File

@@ -341,6 +341,7 @@ func GetAllObjectByBucketAndPrefix(bucket string, prefix string) ([]FileInfo, er
index++
for _, val := range output.Contents {
var isDir bool
log.Info("val.key=" + val.Key)
if val.Key == prefix {
continue
}


+ 1
- 3
routers/repo/ai_model_manage.go View File

@@ -192,13 +192,11 @@ func DownloadMultiModelFile(ctx *context.Context) {
ctx.Resp.Header().Set("Content-Type", "application/octet-stream")
allFile, err := storage.GetAllObjectByBucketAndPrefix(setting.Bucket, path)
if err != nil {

w := zip.NewWriter(ctx.Resp)
defer w.Close()

for _, oneFile := range allFile {
if !oneFile.IsDir {
log.Info("zip file name:" + oneFile.FileName)
log.Info("zip file name:" + oneFile.FileName)
fDest, err := w.Create(oneFile.FileName)
if err != nil {
log.Info("create zip entry error, download file failed: %s\n", err.Error())


Loading…
Cancel
Save