61 lines
2.0 KiB
Java
61 lines
2.0 KiB
Java
|
|
package com.gunshi.project.xyt.controller;
|
||
|
|
|
||
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||
|
|
import com.gunshi.core.result.R;
|
||
|
|
import com.gunshi.project.xyt.entity.so.CommonDataPageSo;
|
||
|
|
import com.gunshi.project.xyt.model.SafetyHazardInvest;
|
||
|
|
import com.gunshi.project.xyt.service.SafetyHazardInvestService;
|
||
|
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||
|
|
import com.gunshi.project.xyt.validate.markers.Update;
|
||
|
|
import io.swagger.v3.oas.annotations.Operation;
|
||
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.validation.annotation.Validated;
|
||
|
|
import org.springframework.web.bind.annotation.*;
|
||
|
|
|
||
|
|
import java.io.Serializable;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 描述: 安排隐患排查
|
||
|
|
* author: wanyan
|
||
|
|
* date: 2024-08-20 17:40:37
|
||
|
|
*/
|
||
|
|
@Tag(name = "安排隐患排查")
|
||
|
|
@RestController
|
||
|
|
@RequestMapping(value="/safety/hazard/invest")
|
||
|
|
public class SafetyHazardInvestController extends AbstractCommonFileController{
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private SafetyHazardInvestService service;
|
||
|
|
|
||
|
|
|
||
|
|
@Operation(summary = "新增")
|
||
|
|
@PostMapping("/insert")
|
||
|
|
public R<SafetyHazardInvest> insert(@Validated(Insert.class) @RequestBody SafetyHazardInvest dto) {
|
||
|
|
return R.ok(service.saveData(dto));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "修改")
|
||
|
|
@PostMapping("/update")
|
||
|
|
public R<SafetyHazardInvest> update(@Validated(Update.class) @RequestBody SafetyHazardInvest dto) {
|
||
|
|
return R.ok(service.updateData(dto));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "删除")
|
||
|
|
@GetMapping("/del/{id}")
|
||
|
|
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||
|
|
return R.ok(service.delData(id));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "分页")
|
||
|
|
@PostMapping("/page")
|
||
|
|
public R<Page<SafetyHazardInvest>> page(@RequestBody @Validated CommonDataPageSo page) {
|
||
|
|
return R.ok(service.pageQuery(page));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public String getGroupId() {
|
||
|
|
return "safetyHazardInvest";
|
||
|
|
}
|
||
|
|
}
|