ke
2024-05-13 d31e928394ad711a86a3d93caa6470b1abb96a39
skjcmanager/skjcmanager-ops/skjcmanager-resource/src/main/java/cn/gistack/resource/builder/oss/OssBuilder.java
@@ -17,6 +17,7 @@
package cn.gistack.resource.builder.oss;
import cn.gistack.resource.rule.MyOssRule;
import cn.gistack.resource.rule.PanoramaOSSRule;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springblade.core.cache.utils.CacheUtil;
@@ -86,6 +87,12 @@
      return templateByPath(StringPool.EMPTY,prefixPath);
   }
   public OssTemplate templateByPrefixPathPanorama(String prefixPath ,String resGuid) {
      return templateByPathPanorama(StringPool.EMPTY,prefixPath,resGuid);
   }
   /**
    * 获取template
    *
@@ -155,6 +162,32 @@
   }
   /**
    * 全景图片上传
    * @param code
    * @param prefixPath
    * @return
    */
   public OssTemplate templateByPathPanorama(String code,String prefixPath,String resGuid) {
      String tenantId = AuthUtil.getTenantId();
      Oss oss = getOss(tenantId, code);
      OssTemplate template = null;
//      template = templatePool.get(tenantId);
      OssRule ossRule = new PanoramaOSSRule(Boolean.FALSE,prefixPath,resGuid);
      if (oss.getCategory() == OssEnum.MINIO.getCategory()) {
         template = MinioOssBuilder.template(oss, ossRule);
      } else if (oss.getCategory() == OssEnum.QINIU.getCategory()) {
         template = QiniuOssBuilder.template(oss, ossRule);
      } else if (oss.getCategory() == OssEnum.ALI.getCategory()) {
         template = AliOssBuilder.template(oss, ossRule);
      } else if (oss.getCategory() == OssEnum.TENCENT.getCategory()) {
         template = TencentOssBuilder.template(oss, ossRule);
      }
//      templatePool.put(tenantId, template);
//      ossPool.put(tenantId, oss);
      return template;
   }
   /**
    * 获取对象存储实体
    *
    * @param tenantId 租户ID