| | |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.oss.model.BladeFile; |
| | | import org.springblade.core.oss.model.OssFile; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.secure.annotation.PreAuth; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.constant.RoleConstant; |
| | |
| | | .headers(headers) |
| | | .build()); |
| | | in.close(); |
| | | String urls = "http://192.168.0.109:9000/jfpt/" + newName; |
| | | String urls = "http://192.168.0.109:9000/zhba/" + newName; |
| | | return R.data(urls); |
| | | } |
| | | |
| | |
| | | * @return attachId |
| | | */ |
| | | private Long buildAttach(String fileName, Long fileSize, BladeFile bladeFile,String deptid,String type) throws Exception { |
| | | BladeUser user = AuthUtil.getUser(); |
| | | String fileExtension = FileUtil.getFileExtension(fileName); |
| | | Attach attach = new Attach(); |
| | | attach.setDomain(bladeFile.getDomain()); |
| | |
| | | attach.setOriginalName(bladeFile.getOriginalName()); |
| | | attach.setAttachSize(fileSize); |
| | | attach.setExtension(fileExtension); |
| | | attach.setDeptid(deptid); |
| | | attach.setDeptid(user.getDeptId()); |
| | | attach.setType(type); |
| | | attachService.save(attach); |
| | | arg.test01(arg.url+"/blade-resource/attach/save",attach); |
| | | // arg.test01(arg.url+"/blade-resource/attach/save",attach); |
| | | return attach.getId(); |
| | | } |
| | | |