package com.ruoyi.safe.controller;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.ruoyi.framework.web.domain.R;
|
import com.ruoyi.safe.pojo.SafeAccident;
|
import com.ruoyi.safe.service.SafeAccidentService;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.Operation;
|
import lombok.AllArgsConstructor;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
/**
|
* <p>
|
* 安全生产--事故上报记录 前端控制器
|
* </p>
|
*
|
* @author 芯导软件(江苏)有限公司
|
* @since 2026-01-28 02:40:31
|
*/
|
@RestController
|
@RequestMapping("/safeAccident")
|
@AllArgsConstructor
|
@Tag(name = "安全生产--事故上报记录")
|
public class SafeAccidentController {
|
|
private SafeAccidentService safeAccidentService;
|
|
@GetMapping("/page")
|
@Operation(summary = "分页查询")
|
public R page(Page page, SafeAccident safeAccident) {
|
return R.ok(safeAccidentService.pageSafeAccident(page, safeAccident));
|
}
|
|
@Operation(summary = "新增事故上报记录")
|
@PostMapping()
|
public R add(@RequestBody SafeAccident safeAccident) {
|
return R.ok(safeAccidentService.save(safeAccident));
|
}
|
|
@Operation(summary = "修改事故上报记录")
|
@PutMapping ()
|
public R update(@RequestBody SafeAccident safeAccident) {
|
return R.ok(safeAccidentService.updateById(safeAccident));
|
}
|
|
@Operation(summary = "删除事故上报记录")
|
@DeleteMapping("/{ids}")
|
public R delSafeAccident(@RequestBody List<Integer> ids) {
|
return R.ok(safeAccidentService.removeBatchByIds(ids));
|
}
|
|
}
|