62 lines
2.0 KiB
Java
62 lines
2.0 KiB
Java
|
|
package com.gunshi.project.hsz.controller;
|
||
|
|
|
||
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||
|
|
import com.gunshi.core.result.R;
|
||
|
|
import com.gunshi.project.hsz.entity.so.TyYearRainfallPageSo;
|
||
|
|
import com.gunshi.project.hsz.entity.vo.TyYearRainfallVo;
|
||
|
|
import com.gunshi.project.hsz.service.TyYearRainfallService;
|
||
|
|
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.util.List;
|
||
|
|
/**
|
||
|
|
* 描述: 典型年降雨资料表
|
||
|
|
* author: xusan
|
||
|
|
* date: 2024-07-08 17:40:37
|
||
|
|
*/
|
||
|
|
@Tag(name = "典型年降雨资料表")
|
||
|
|
@RestController
|
||
|
|
@RequestMapping(value="/tyYearRainfall")
|
||
|
|
public class TyYearRainfallController {
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private TyYearRainfallService service;
|
||
|
|
|
||
|
|
|
||
|
|
@Operation(summary = "新增")
|
||
|
|
@PostMapping("/insert")
|
||
|
|
public R<Boolean> insert(@Validated(Insert.class) @RequestBody TyYearRainfallVo dto) {
|
||
|
|
return R.ok(service.saveData(dto));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "修改")
|
||
|
|
@PostMapping("/update")
|
||
|
|
public R<Boolean> update(@Validated(Update.class) @RequestBody TyYearRainfallVo 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.removeData(id));
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "列表")
|
||
|
|
@PostMapping("/list")
|
||
|
|
public R<List<TyYearRainfallVo>> list() {
|
||
|
|
return R.ok(service.queryList());
|
||
|
|
}
|
||
|
|
|
||
|
|
@Operation(summary = "分页")
|
||
|
|
@PostMapping("/page")
|
||
|
|
public R<Page<TyYearRainfallVo>> pageQuery(@RequestBody TyYearRainfallPageSo tyYearRainfallPageSo) {
|
||
|
|
return R.ok(service.pageQuery(tyYearRainfallPageSo));
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|