linwe
2024-07-15 8f5aeec641d916806553ef9772d55e17e93db150
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
@@ -20,6 +20,8 @@
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.common.utils.ImageUtils;
import org.springblade.common.utils.WeiXinSecurityUtil;
import org.springblade.core.launch.constant.AppConstant;
@@ -53,6 +55,7 @@
@Api(value = "对象存储端点", tags = "对象存储端点")
@RequestMapping(AppConstant.APPLICATION_RESOURCE_NAME + "/oss/endpoint")
public class OssEndpoint {
   private static final Logger logger = LoggerFactory.getLogger(OssEndpoint.class);
   /**
    * 对象存储构建类
@@ -367,6 +370,7 @@
    * @return attachId
    */
   private Long buildAttachData(Long attachId, String fileName, Long fileSize, BladeFile bladeFile, MultipartFile file) {
      try {
      String fileExtension = FileUtil.getFileExtension(fileName);
      AttachData attach = new AttachData();
      attach.setAttachId(attachId);
@@ -377,6 +381,10 @@
      attach.setData(ImageUtils.mulToBase64(file));
      attachDataService.save(attach);
      return attach.getId();
      } catch (Exception e) {
         logger.error("附件数据表保存失败", e);
      }
      return 0L;
   }
   /**