| | |
| | | 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; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import lombok.SneakyThrows; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 报案表(Report)表控制层 |
| | |
| | | */ |
| | | @Resource |
| | | private ReportService reportService; |
| | | @Resource |
| | | GroupUserService groupUserService; |
| | | @Resource |
| | | MessageService messageService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | |
| | | @PutMapping("/updateReport") |
| | | @ApiResponse(message = "执行成功", code = 200) |
| | | public R updateReport(@RequestBody Report report) { |
| | | report.setPic(null); |
| | | reportService.updateById(report); |
| | | return R.ok(); |
| | | } |
| | |
| | | @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(); |
| | | } |