63 lines
1.9 KiB
Java
63 lines
1.9 KiB
Java
package com.gunshi.project.xyt.controller;
|
|
|
|
import com.gunshi.core.result.R;
|
|
import com.gunshi.project.xyt.model.StZqrlB;
|
|
import com.gunshi.project.xyt.service.StZqrlBService;
|
|
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;
|
|
import java.util.List;
|
|
/**
|
|
* 描述: 水位流量关系曲线表
|
|
* author: xusan
|
|
* date: 2024-07-08 17:40:37
|
|
*/
|
|
@Tag(name = "水位流量关系曲线表")
|
|
@RestController
|
|
@RequestMapping(value="/stZqrlB")
|
|
public class StZqrlBController {
|
|
|
|
@Autowired
|
|
private StZqrlBService service;
|
|
|
|
|
|
@Operation(summary = "新增")
|
|
@PostMapping("/insert")
|
|
public R<StZqrlB> insert(@Validated(Insert.class) @RequestBody StZqrlB dto) {
|
|
boolean result = service.save(dto);
|
|
return R.ok(result ? dto : null);
|
|
}
|
|
|
|
@Operation(summary = "修改")
|
|
@PostMapping("/update")
|
|
public R<StZqrlB> update(@Validated(Update.class) @RequestBody StZqrlB dto) {
|
|
boolean result = service.updateById(dto);
|
|
return R.ok(result ? dto : null);
|
|
}
|
|
|
|
@Operation(summary = "删除")
|
|
@GetMapping("/del/{id}")
|
|
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
|
return R.ok(service.removeById(id));
|
|
}
|
|
|
|
@Operation(summary = "列表")
|
|
@PostMapping("/list")
|
|
public R<List<StZqrlB>> list() {
|
|
return R.ok(service.lambdaQuery().orderByDesc(StZqrlB::getModitime).list());
|
|
}
|
|
|
|
@Operation(summary = "分页")
|
|
@PostMapping("/page")
|
|
public R<List<StZqrlB>> page() {
|
|
return R.ok(service.page(null,null));
|
|
}
|
|
|
|
} |