管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-02-20 95da38d29cc4a88d1ee8b852f54b37fc5052a0ee
src/main/java/com/lf/server/controller/sys/ReportController.java
@@ -5,6 +5,7 @@
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.sys.ReportEntity;
import com.lf.server.entity.sys.UserEntity;
import com.lf.server.helper.StringHelper;
import com.lf.server.service.all.UploadAttachService;
import com.lf.server.service.sys.ReportService;
import com.lf.server.service.sys.TokenService;
@@ -34,11 +35,6 @@
    @Autowired
    TokenService tokenService;
    @Autowired
    UploadAttachService uploadAttachService;
    private final static String TAB_NAME = "lf.sys_report";
    @SysLog()
    @ApiOperation(value = "分页查询并返回记录数")
    @ApiImplicitParams({
@@ -61,19 +57,6 @@
            List<ReportEntity> rs = reportService.selectByPage(name, pageSize, pageSize * (pageIndex - 1));
            return success(count, rs);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
    @SysLog()
    @ApiOperation(value = "查询所有")
    @GetMapping(value = "/selectAll")
    public ResponseMsg<List<ReportEntity>> selectAll() {
        try {
            List<ReportEntity> list = reportService.selectAll();
            return success(list);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
@@ -172,25 +155,5 @@
        } catch (Exception ex) {
            return fail(ex.getMessage(), -1);
        }
    }
    @SysLog()
    @ApiOperation(value = "上传文件")
    @ResponseBody
    @PostMapping(value = "/upload")
    public ResponseMsg<String> upload(@RequestParam("file") MultipartFile file, HttpServletRequest req) {
        UserEntity ue = tokenService.getCurrentUser(req);
        return uploadAttachService.upload(ue, TAB_NAME, file, this);
    }
    @SysLog()
    @ApiOperation(value = "下载文件")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "guid", value = "附件Guid", dataType = "String", paramType = "body")
    })
    @GetMapping(value = "/download")
    public void download(String guid, HttpServletResponse res) {
        uploadAttachService.download(guid, res);
    }
}