61 lines
1.9 KiB
Java
61 lines
1.9 KiB
Java
package com.gunshi.project.hsz.controller;
|
|
|
|
import com.gunshi.core.result.R;
|
|
import com.gunshi.project.hsz.model.InspectPoint;
|
|
import com.gunshi.project.hsz.service.InspectPointService;
|
|
import com.gunshi.project.hsz.validate.markers.Insert;
|
|
import com.gunshi.project.hsz.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;
|
|
import java.util.List;
|
|
/**
|
|
* 描述: 巡检点
|
|
* author: xusan
|
|
* date: 2024-08-29 09:57:47
|
|
*/
|
|
@Tag(name = "巡检点")
|
|
@RestController
|
|
@RequestMapping(value="/inspect/point")
|
|
public class InspectPointController {
|
|
|
|
@Autowired
|
|
private InspectPointService service;
|
|
|
|
|
|
@Operation(summary = "新增")
|
|
@PostMapping("/insert")
|
|
public R<InspectPoint> insert(@Validated(Insert.class) @RequestBody InspectPoint dto) {
|
|
return R.ok(service.saveData(dto));
|
|
}
|
|
|
|
@Operation(summary = "修改")
|
|
@PostMapping("/update")
|
|
public R<InspectPoint> update(@Validated(Update.class) @RequestBody InspectPoint 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 = "列表")
|
|
@GetMapping("/list")
|
|
public R<List<InspectPoint>> list() {
|
|
return R.ok(service.lambdaQuery().orderByAsc(InspectPoint::getOrderIndex).list());
|
|
}
|
|
|
|
@Operation(summary = "列表(带巡检项)")
|
|
@GetMapping("/listWithItem")
|
|
public R<List<InspectPoint>> listWithItem() {
|
|
return R.ok(service.listWithItem());
|
|
}
|
|
|
|
} |