From 9c6150c879432b21816618a256c166dc3801b1a2 Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期二, 19 七月 2022 14:11:44 +0800
Subject: [PATCH] 群公告 导入导出
---
src/main/java/com/example/jz/controller/ReportController.java | 34 ++++++++++++++++++++--------------
1 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/src/main/java/com/example/jz/controller/ReportController.java b/src/main/java/com/example/jz/controller/ReportController.java
index a0c9c82..821f17b 100644
--- a/src/main/java/com/example/jz/controller/ReportController.java
+++ b/src/main/java/com/example/jz/controller/ReportController.java
@@ -1,12 +1,11 @@
package com.example.jz.controller;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.example.jz.enums.BusinessHttpStatus;
-import com.example.jz.exception.BusinessException;
import com.example.jz.modle.R;
+import com.example.jz.modle.dto.ReportParamDto;
import com.example.jz.modle.entity.Report;
import com.example.jz.modle.vo.ReportListVo;
import com.example.jz.service.ReportService;
@@ -16,9 +15,9 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
import java.io.Serializable;
import java.util.Date;
-import java.util.List;
/**
* 鎶ユ琛�(Report)琛ㄦ帶鍒跺眰
@@ -28,7 +27,7 @@
*/
@RestController
@RequestMapping("report")
-@Api(value = "鎶ユ鎺ュ彛", tags = "鎶ユ鎺ュ彛")
+@Api(value = "妗堜欢鍖�-妗堜欢浜哄憳", tags = "妗堜欢鍖�-妗堜欢浜哄憳")
public class ReportController extends ApiController {
/**
* 鏈嶅姟瀵硅薄
@@ -39,14 +38,14 @@
/**
* 鍒嗛〉鏌ヨ鎵�鏈夋暟鎹�
*
- * @param page 鍒嗛〉瀵硅薄
- * @param report 鏌ヨ瀹炰綋
+ * @param page 鍒嗛〉瀵硅薄
+ * @param reportParamDto 鏌ヨ瀹炰綋
* @return 鎵�鏈夋暟鎹�
*/
@GetMapping
@ApiOperation(value = "鍒嗛〉鏌ヨ鎵�鏈夋暟鎹�")
- public R<IPage<Report>> selectAll(Page<Report> page, Report report) {
- return R.ok(reportService.page(page, new QueryWrapper<>(report)));
+ public R<IPage<ReportListVo>> selectAll(Page<ReportListVo> page, ReportParamDto reportParamDto) {
+ return R.ok(reportService.getPage(page, reportParamDto));
}
/**
@@ -57,8 +56,8 @@
*/
@GetMapping("{id}")
@ApiOperation(value = "閫氳繃涓婚敭鏌ヨ鍗曟潯鏁版嵁")
- public R<Report> selectOne(@PathVariable Serializable id) {
- return R.ok(reportService.getById(id));
+ public R<ReportListVo> selectOne(@PathVariable Serializable id) {
+ return R.ok(reportService.getReportListVoById(id));
}
/**
@@ -100,17 +99,24 @@
@ApiOperation(httpMethod = "DELETE", value = "鎶ユ浜轰汉鍛橀��缇�")
@DeleteMapping("/leaveGroup")
@ApiResponse(message = "鎵ц鎴愬姛", code = 200)
- public R leaveGroup( @RequestParam(value = "id") Integer id,@RequestParam(value = "groupId") Integer groupId) {
- reportService.leaveGroup(id,groupId);
+ public R leaveGroup(@RequestParam(value = "id") Integer id, @RequestParam(value = "groupId") Integer groupId) {
+ reportService.leaveGroup(id, groupId);
return R.ok();
}
@ApiOperation(httpMethod = "DELETE", value = "鍒犻櫎鎶ユ浜�")
@DeleteMapping("/deleteReporter")
@ApiResponse(message = "鎵ц鎴愬姛", code = 200)
- public R deleteReporter( @RequestParam(value = "id") Integer id) {
+ public R deleteReporter(@RequestParam(value = "id") Integer id) {
reportService.removeById(id);
return R.ok();
}
+
+ @ApiOperation(httpMethod = "POST", value = "瀵煎嚭鏉愭枡")
+ @PostMapping("/exportReporter")
+ @ApiResponse(message = "鎵ц鎴愬姛", code = 200)
+ public void exportReport(@RequestParam(value = "id") Integer id, HttpServletResponse response) {
+ reportService.exportReporter(id, response);
+ }
}
--
Gitblit v1.8.0