src/main/java/com/example/jz/controller/CauseController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/example/jz/controller/ReportController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/example/jz/modle/vo/ReportListVo.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/example/jz/service/ReportService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/example/jz/service/impl/ReportServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/example/jz/controller/CauseController.java
@@ -72,12 +72,13 @@ return R.ok(causeService.getGroupAnnouncement(groupId)); } @ApiOperation(httpMethod = "Delete", value = "案件删除") @ApiOperation(httpMethod = "DELETE", value = "案件删除") @DeleteMapping("/deleteCause") @ApiResponse(message = "执行成功", code = 200) public R deleteCause(@RequestParam(value = "id") Integer id) { causeService.deleteCause(id); return R.ok(); } // TODO: 2022/7/15 导入 } src/main/java/com/example/jz/controller/ReportController.java
@@ -4,11 +4,15 @@ 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.entity.Report; import com.example.jz.modle.vo.ReportListVo; import com.example.jz.service.ReportService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -84,5 +88,29 @@ public R<Boolean> audit(@RequestBody Report report) { return R.ok(reportService.audit(report)); } @ApiOperation(httpMethod = "PUT", value = "报案人编辑") @PutMapping("/updateReport") @ApiResponse(message = "执行成功", code = 200) public R updateReport(@RequestBody Report report) { reportService.updateById(report); return R.ok(); } @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); return R.ok(); } @ApiOperation(httpMethod = "DELETE", value = "删除报案人") @DeleteMapping("/deleteReporter") @ApiResponse(message = "执行成功", code = 200) public R deleteReporter( @RequestParam(value = "id") Integer id) { reportService.removeById(id); return R.ok(); } } src/main/java/com/example/jz/modle/vo/ReportListVo.java
New file @@ -0,0 +1,15 @@ package com.example.jz.modle.vo; import com.example.jz.modle.entity.Report; import io.swagger.annotations.ApiModel; import lombok.Data; @Data @ApiModel(description = "报案人员首页",value = "ReportListVo") public class ReportListVo extends Report { //是否进群 private Integer isIntoGroup; //群id private Integer groupId; } src/main/java/com/example/jz/service/ReportService.java
@@ -12,5 +12,7 @@ public interface ReportService extends IService<Report> { Boolean audit(Report report); void leaveGroup(Integer id, Integer groupId); } src/main/java/com/example/jz/service/impl/ReportServiceImpl.java
@@ -1,6 +1,7 @@ package com.example.jz.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.example.jz.dao.CauseDao; import com.example.jz.dao.GroupDao; @@ -51,5 +52,10 @@ groupUserDao.insert(groupUser); return true; } @Override public void leaveGroup(Integer id, Integer groupId) { groupUserDao.delete(new QueryWrapper<GroupUser>().eq("user_id",id).eq("group_id",groupId)); } }