| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.safe.pojo.SafeCertification; |
| | | import com.ruoyi.safe.pojo.SafeHazard; |
| | | import com.ruoyi.safe.service.SafeCertificationService; |
| | | import com.ruoyi.safe.service.SafeHazardService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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; |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/safeHazard") |
| | | @Api(tags = "安全生产--危险源台账") |
| | | @Tag(name = "安全生产--危险源台账") |
| | | @AllArgsConstructor |
| | | public class SafeHazardController { |
| | | |
| | | @Autowired |
| | | private SafeHazardService safeHazardService; |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation("分页查询") |
| | | @Operation(summary = "分页查询") |
| | | public R page(Page page, SafeHazard safeHazard) { |
| | | return R.ok(safeHazardService.pageSafeHazard(page, safeHazard)); |
| | | } |
| | | |
| | | @ApiOperation("新增危险源台账") |
| | | @Operation(summary = "新增危险源台账") |
| | | @PostMapping() |
| | | public R add(@RequestBody SafeHazard safeHazard) { |
| | | return R.ok(safeHazardService.save(safeHazard)); |
| | | } |
| | | |
| | | @ApiOperation("修改危险源台账") |
| | | @Operation(summary = "修改危险源台账") |
| | | @PutMapping () |
| | | public R update(@RequestBody SafeHazard safeHazard) { |
| | | return R.ok(safeHazardService.updateById(safeHazard)); |
| | | } |
| | | |
| | | @ApiOperation("删除危险源台账") |
| | | @Operation(summary = "删除危险源台账") |
| | | @DeleteMapping("/{ids}") |
| | | public R delSafeHazard(@RequestBody List<Integer> ids) { |
| | | return R.ok(safeHazardService.delSafeHazard(ids)); |