From 8b26fa15912e355e57990946ac52f699130788c2 Mon Sep 17 00:00:00 2001 From: wl <173@qq.com> Date: 星期二, 27 十二月 2022 11:15:21 +0800 Subject: [PATCH] fix: 删除管理删除用户删除案件 --- src/main/java/com/example/jz/controller/ReportController.java | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/example/jz/controller/ReportController.java b/src/main/java/com/example/jz/controller/ReportController.java index 2448a01..4908e4f 100644 --- a/src/main/java/com/example/jz/controller/ReportController.java +++ b/src/main/java/com/example/jz/controller/ReportController.java @@ -1,14 +1,19 @@ package com.example.jz.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.modle.R; import com.example.jz.modle.dto.AddReportDto; import com.example.jz.modle.dto.ReportParamDto; +import com.example.jz.modle.entity.GroupUser; +import com.example.jz.modle.entity.Message; import com.example.jz.modle.entity.Report; import com.example.jz.modle.vo.ReportListVo; +import com.example.jz.service.GroupUserService; +import com.example.jz.service.MessageService; import com.example.jz.service.ReportService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -18,7 +23,6 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.Serializable; -import java.util.Date; /** * 鎶ユ琛�(Report)琛ㄦ帶鍒跺眰 @@ -35,6 +39,10 @@ */ @Resource private ReportService reportService; + @Resource + GroupUserService groupUserService; + @Resource + MessageService messageService; /** * 鍒嗛〉鏌ヨ鎵�鏈夋暟鎹� @@ -64,13 +72,12 @@ /** * 鎶ユ * - * @param AddReportDto 瀹炰綋瀵硅薄 + * @param addReportDto 瀹炰綋瀵硅薄 * @return 鏂板缁撴灉 */ @PostMapping @ApiOperation(value = "鎶ユ") public R<Boolean> insert(@RequestBody AddReportDto addReportDto) { - return R.ok(reportService.addReport(addReportDto)); } @@ -90,6 +97,7 @@ @PutMapping("/updateReport") @ApiResponse(message = "鎵ц鎴愬姛", code = 200) public R updateReport(@RequestBody Report report) { + report.setPic(null); reportService.updateById(report); return R.ok(); } @@ -106,6 +114,8 @@ @DeleteMapping("/deleteReporter") @ApiResponse(message = "鎵ц鎴愬姛", code = 200) public R deleteReporter(@RequestParam(value = "id") Integer id) { + groupUserService.remove(new LambdaQueryWrapper<GroupUser>().eq(GroupUser::getUserId, id)); + messageService.remove(new LambdaQueryWrapper<Message>().eq(Message::getUserId, id)); reportService.removeById(id); return R.ok(); } -- Gitblit v1.8.0