| | |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.sys.ResEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.service.all.FileService; |
| | | import com.lf.server.service.data.UploaderService; |
| | | import com.lf.server.service.sys.ResService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | FileService fileService; |
| | | UploaderService uploaderService; |
| | | |
| | | private final static String TAB_NAME = "sys_res"; |
| | | |
| | |
| | | public ResponseMsg<String> upload(@RequestParam("file") MultipartFile file, HttpServletRequest req) { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | |
| | | return fileService.upload(ue, TAB_NAME, file, this); |
| | | return uploaderService.upload(ue, TAB_NAME, file, this); |
| | | } |
| | | |
| | | @SysLog() |
| | |
| | | @ApiImplicitParam(name = "guid", value = "附件Guid", dataType = "String", paramType = "body") |
| | | }) |
| | | @GetMapping(value = "/download") |
| | | public void download(String guid, HttpServletRequest req, HttpServletResponse res) { |
| | | fileService.download(guid, req, res, this); |
| | | public void download(String guid, HttpServletResponse res) { |
| | | uploaderService.download(guid, res); |
| | | } |
| | | } |