package com.example.jz.controller;
|
|
|
import com.baomidou.mybatisplus.extension.api.ApiController;
|
import com.example.jz.modle.R;
|
import com.example.jz.modle.dto.CauseDto;
|
import com.example.jz.service.CauseService;
|
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;
|
|
/**
|
* 案件表(Cause)表控制层
|
*
|
* @author makejava
|
* @since 2022-07-13 11:52:57
|
*/
|
@RestController
|
@RequestMapping("cause")
|
@Api(tags = "案件区-案件录入")
|
public class CauseController extends ApiController {
|
/**
|
* 服务对象
|
*/
|
@Resource
|
private CauseService causeService;
|
|
@ApiOperation(httpMethod = "POST", value = "添加案件")
|
@PostMapping("/addCause")
|
@ApiResponse(message = "执行成功", code = 200)
|
public R addCause(@RequestBody CauseDto causeDto) {
|
causeService.addCause(causeDto);
|
return R.ok();
|
}
|
|
@ApiOperation(httpMethod = "PUT", value = "修改案件")
|
@PutMapping("/updateCause")
|
@ApiResponse(message = "执行成功", code = 200)
|
public R updateCause(@RequestBody CauseDto causeDto,Integer id) {
|
return R.ok(causeService.updateCause(causeDto,id));
|
}
|
|
|
@ApiOperation(httpMethod = "GET", value = "案件录入列表")
|
@GetMapping("/getCauseList")
|
@ApiResponse(message = "执行成功", code = 200)
|
public R getCauseList(String cause, Integer status, Integer size, Integer current) {
|
return R.ok(causeService.getCauserListByCondition(cause, status, size, current));
|
}
|
|
@ApiOperation(httpMethod = "GET", value = "负责人查询")
|
@GetMapping("/getManagerList")
|
@ApiResponse(message = "执行成功", code = 200)
|
public R getManagerList() {
|
return R.ok(causeService.getManagerList());
|
}
|
|
@ApiOperation(httpMethod = "GET", value = "获取报案人员")
|
@GetMapping("/getReporterList")
|
@ApiResponse(message = "执行成功", code = 200)
|
public R getReporterList(Integer causeId) {
|
return R.ok(causeService.getReporterList(causeId));
|
}
|
|
@ApiOperation(httpMethod = "GET", value = "获取案件群公告")
|
@GetMapping("/getGroupAnnouncement")
|
@ApiResponse(message = "执行成功", code = 200)
|
public R getGroupAnnouncement(Integer groupId) {
|
return R.ok(causeService.getGroupAnnouncement(groupId));
|
}
|
|
@ApiOperation(httpMethod = "Delete", value = "案件删除")
|
@DeleteMapping("/deleteCause")
|
@ApiResponse(message = "执行成功", code = 200)
|
public R deleteCause(@RequestParam(value = "id") Integer id) {
|
causeService.deleteCause(id);
|
return R.ok();
|
}
|
}
|