63 lines
1.9 KiB
Java
63 lines
1.9 KiB
Java
package com.gunshi.project.hsz.controller;
|
|
|
|
import com.gunshi.core.result.R;
|
|
import com.gunshi.project.hsz.common.model.StPptnR;
|
|
import com.gunshi.project.hsz.service.StPptnRService;
|
|
import com.gunshi.project.hsz.common.validate.markers.Insert;
|
|
import com.gunshi.project.hsz.common.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="/stPptnR")
|
|
public class StPptnRController {
|
|
|
|
@Autowired
|
|
private StPptnRService service;
|
|
|
|
|
|
@Operation(summary = "新增")
|
|
@PostMapping("/insert")
|
|
public R<StPptnR> insert(@Validated(Insert.class) @RequestBody StPptnR dto) {
|
|
boolean result = service.save(dto);
|
|
return R.ok(result ? dto : null);
|
|
}
|
|
|
|
@Operation(summary = "修改")
|
|
@PostMapping("/update")
|
|
public R<StPptnR> update(@Validated(Update.class) @RequestBody StPptnR 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<StPptnR>> list() {
|
|
return R.ok(service.lambdaQuery().list());
|
|
}
|
|
|
|
// @Operation(summary = "分页")
|
|
// @PostMapping("/page")
|
|
public R<List<StPptnR>> page() {
|
|
return R.ok(service.page(null,null));
|
|
}
|
|
|
|
} |