| | |
| | | */ |
| | | package org.springblade.modules.resource.endpoint; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.client.methods.CloseableHttpResponse; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.entity.ContentType; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | | import org.apache.http.impl.client.HttpClients; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.oss.model.BladeFile; |
| | | import org.springblade.core.oss.model.OssFile; |
| | |
| | | * @param bladeFile 对象存储文件 |
| | | * @return attachId |
| | | */ |
| | | private Long buildAttach(String fileName, Long fileSize, BladeFile bladeFile,String deptid,String type) { |
| | | private Long buildAttach(String fileName, Long fileSize, BladeFile bladeFile,String deptid,String type) throws Exception { |
| | | String fileExtension = FileUtil.getFileExtension(fileName); |
| | | Attach attach = new Attach(); |
| | | attach.setDomain(bladeFile.getDomain()); |
| | |
| | | attach.setDeptid(deptid); |
| | | attach.setType(type); |
| | | attachService.save(attach); |
| | | arg.test01(arg.url+"/blade-resource/attach/save",attach); |
| | | return attach.getId(); |
| | | } |
| | | |