2024-08-29 16:46:53 +08:00
|
|
|
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.InspectTaskPageSo;
|
|
|
|
|
import com.gunshi.project.xyt.model.InspectTask;
|
|
|
|
|
import com.gunshi.project.xyt.service.InspectTaskService;
|
|
|
|
|
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.*;
|
2024-08-30 13:36:20 +08:00
|
|
|
|
2024-08-29 16:46:53 +08:00
|
|
|
/**
|
|
|
|
|
* 描述: 巡检任务
|
|
|
|
|
* author: xusan
|
|
|
|
|
* date: 2024-08-29 14:21:15
|
|
|
|
|
*/
|
|
|
|
|
@Tag(name = "巡检任务")
|
|
|
|
|
@RestController
|
2024-08-30 13:36:20 +08:00
|
|
|
@RequestMapping(value="/inspect/task")
|
2024-08-29 16:46:53 +08:00
|
|
|
public class InspectTaskController {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private InspectTaskService service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "新增")
|
|
|
|
|
@PostMapping("/insert")
|
|
|
|
|
public R<InspectTask> insert(@Validated(Insert.class) @RequestBody InspectTask dto) {
|
|
|
|
|
return R.ok(service.saveData(dto));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "修改")
|
|
|
|
|
@PostMapping("/update")
|
|
|
|
|
public R<InspectTask> update(@Validated(Update.class) @RequestBody InspectTask dto) {
|
|
|
|
|
return R.ok(service.updateData(dto));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "删除")
|
|
|
|
|
@GetMapping("/del/{id}")
|
|
|
|
|
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Long id) {
|
|
|
|
|
return R.ok(service.delData(id));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "分页")
|
|
|
|
|
@PostMapping("/page")
|
|
|
|
|
public R<Page<InspectTask>> page(@RequestBody @Validated InspectTaskPageSo page) {
|
|
|
|
|
return R.ok(service.pageQuery(page));
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-30 10:39:18 +08:00
|
|
|
@Operation(summary = "开始巡检")
|
|
|
|
|
@GetMapping("/startInspect/{id}")
|
|
|
|
|
public R<Boolean> startInspect(@Schema(name = "id") @PathVariable("id") Long id) {
|
|
|
|
|
return R.ok(service.startInspect(id));
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-30 13:36:20 +08:00
|
|
|
|
|
|
|
|
|
2024-08-29 16:46:53 +08:00
|
|
|
}
|