huminmin
2026-06-29 9f1ec3d21f02d38d1a54876fface13301cc65fad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package com.ruoyi.safe.controller;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.domain.R;
import com.ruoyi.safe.pojo.SafeFacilityInspection;
import com.ruoyi.safe.service.SafeFacilityInspectionService;
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-06-29
 */
@RestController
@RequestMapping("/safeFacilityInspection")
@AllArgsConstructor
@Tag(name = "安全生产--安全设施巡检")
public class SafeFacilityInspectionController {
 
    private SafeFacilityInspectionService safeFacilityInspectionService;
 
    @GetMapping("/page")
    @Operation(summary = "分页查询")
    public R page(Page page, SafeFacilityInspection safeFacilityInspection) {
        return R.ok(safeFacilityInspectionService.pageSafeFacilityInspection(page, safeFacilityInspection));
    }
 
    @GetMapping("/{id}")
    @Operation(summary = "根据ID查询")
    public R getById(@PathVariable Integer id) {
        return R.ok(safeFacilityInspectionService.getById(id));
    }
 
    @Operation(summary = "新增安全设施巡检")
    @Log(title = "安全设施巡检", businessType = BusinessType.INSERT)
    @PostMapping()
    public R add(@RequestBody SafeFacilityInspection safeFacilityInspection) {
        return R.ok(safeFacilityInspectionService.save(safeFacilityInspection));
    }
 
    @Operation(summary = "修改安全设施巡检")
    @Log(title = "安全设施巡检", businessType = BusinessType.UPDATE)
    @PutMapping()
    public R update(@RequestBody SafeFacilityInspection safeFacilityInspection) {
        return R.ok(safeFacilityInspectionService.updateById(safeFacilityInspection));
    }
 
    @Operation(summary = "删除安全设施巡检")
    @Log(title = "安全设施巡检", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public R delSafeFacilityInspection(@RequestBody List<Integer> ids) {
        return R.ok(safeFacilityInspectionService.removeBatchByIds(ids));
    }
}