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.StZvarlB;
|
|
import com.gunshi.project.xyt.service.StZvarlBService;
|
|
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="/stZvarlB")
|
|
public class StZvarlBController {
|
|
|
|
@Autowired
|
|
private StZvarlBService service;
|
|
|
|
|
|
@Operation(summary = "新增")
|
|
@PostMapping("/insert")
|
|
public R<StZvarlB> insert(@Validated(Insert.class) @RequestBody StZvarlB dto) {
|
|
boolean result = service.save(dto);
|
|
return R.ok(result ? dto : null);
|
|
}
|
|
|
|
@Operation(summary = "修改")
|
|
@PostMapping("/update")
|
|
public R<StZvarlB> update(@Validated(Update.class) @RequestBody StZvarlB 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<StZvarlB>> list() {
|
|
return R.ok(service.lambdaQuery().orderByDesc(StZvarlB::getMstm).list());
|
|
}
|
|
|
|
@Operation(summary = "分页")
|
|
@PostMapping("/page")
|
|
public R<List<StZvarlB>> page() {
|
|
return R.ok(service.page(null,null));
|
|
}
|
|
|
|
} |