animeic 2 lat temu
rodzic
commit
833943c2dc
1 zmienionych plików z 17 dodań i 3 usunięć
  1. 17 3
      3dshow-supplier/api/asset.go

+ 17 - 3
3dshow-supplier/api/asset.go

@@ -69,8 +69,6 @@ func AssetsConv(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 		return nil, errors.New("groupId不能为空")
 	}
 
-	return nil, nil
-
 	startTime := time.Now()
 	dir, _ := os.Getwd()
 	ffmpegExe = fmt.Sprintf("%s/ffmpeg", dir)
@@ -126,10 +124,26 @@ func AssetsConv(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 			os.Remove(levelScaleImage)
 		}
 	}
+	// 删除图片文件
+	// os.Remove(oPath)
+	// os.Remove(wPath)
 
 	fmt.Println(time.Since(startTime).Seconds())
+
 	key := wPath
-	return serviceObsUploadPolicy(key, apictx.Svc.Conf)
+	_url, _ := serviceObsUploadPolicy(key, apictx.Svc.Conf)
+
+	url := fmt.Sprintf("%s%s", "https://www.3dqueen.cloud/asset360/index.html?apath=", _url)
+
+	result, err := repo.RepoDocArrayOneUpdate(apictx.CreateRepoCtx(), &repo.ArrayOneUpdateOption{
+		CollectName: repo.CollectionAssets,
+		Id:          id,
+		Query:       repo.Map{"groups.id": groupId},
+		Set:         repo.Map{"groups.$.url": url},
+	})
+
+	return result, err
+
 }
 
 func createLevel(w, h int, source, dest string) {