| | |
| | | |
| | | @RequestMapping(value = "/plan/insert/file/auth") |
| | | // @ManagerAuth |
| | | public R insertFile(@RequestParam("planId") String planId, @RequestParam("filename") String filename, @RequestParam("filesize") Long filesize) { |
| | | public R insertFile(@RequestParam("planId") String planId, @RequestParam("filename") String filename, |
| | | @RequestParam("filesize") Long filesize,@RequestParam("token") String token) { |
| | | try { |
| | | // InputStream inputStream = file.getInputStream(); |
| | | // // 获取文件的内容类型 |
| | |
| | | //// String url = "http://tjdt.oss-cn-hangzhou.aliyuncs.com/"+file.getOriginalFilename(); |
| | | // String[] names = url.split("com/"); |
| | | // String name= names[1]; |
| | | |
| | | |
| | | String nickname = null; |
| | | Long userId = null; |
| | | if (!Cools.isEmpty(token)) { |
| | | User user = getUser(token); |
| | | nickname = user.getNickname(); |
| | | userId = user.getId(); |
| | | } |
| | | String[] split = planId.split("-"); |
| | | int id = Integer.parseInt(split[1]); |
| | | String url = "http://zhongyang-ftpserver.oss-cn-hangzhou.aliyuncs.com/" + filename; |
| | | planService.increasePlanUrl(id, url, filename, filesize); |
| | | planService.increasePlanUrl(id, url, filename, filesize,nickname,userId); |
| | | return R.ok(); |
| | | } catch (Exception e) { |
| | | System.out.println(e); |
| | |
| | | String url = planService.selectPlanUrlPlanIdUrl(id2); |
| | | String name = planService.selectPlanUrlPlanIdName(id2); |
| | | Long size = planService.selectPlanUrlPlanIdSize(id2); |
| | | FileSaveExampleUtil.FileDTO dto = new FileSaveExampleUtil.FileDTO(name,size,url); |
| | | String userName = planService.selectPlanUrlPlanIdUserName(id2); |
| | | FileSaveExampleUtil.FileDTO dto = new FileSaveExampleUtil.FileDTO(name,size,url,userName); |
| | | fileDTOS.add(dto); |
| | | } |
| | | // List<FileSaveExampleUtil.FileDTO> fileDTOS = FileSaveExampleUtil.viewFileList(savePath); |