[add]排水量逻辑新增
This commit is contained in:
parent
e9ae9ebb0d
commit
a796117f96
@ -1,8 +1,13 @@
|
|||||||
package com.jdc.jdcproject.controller;
|
package com.jdc.jdcproject.controller;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import com.jdc.jdcproject.entity.DicekePrecipitation;
|
||||||
import org.springframework.stereotype.Controller;
|
import com.jdc.jdcproject.service.IDicekePrecipitationService;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import com.jdc.jdcproject.utils.Result;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -16,4 +21,49 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@RequestMapping("/dicekePrecipitation")
|
@RequestMapping("/dicekePrecipitation")
|
||||||
public class DicekePrecipitationController {
|
public class DicekePrecipitationController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDicekePrecipitationService dicekePrecipitationService;
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "查询所有降水量信息")
|
||||||
|
@GetMapping("findAllPrecipitation")
|
||||||
|
public Result findAllPrecipitation() {
|
||||||
|
List<DicekePrecipitation> precipitationList = dicekePrecipitationService.list();
|
||||||
|
return Result.successResult().data("precipitation",precipitationList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Operation(summary = "修改降水量信息")
|
||||||
|
@PostMapping("updatePrecipitation")
|
||||||
|
public Result updatePrecipitation(@RequestBody DicekePrecipitation precipitation) {
|
||||||
|
boolean updateflag = dicekePrecipitationService.updateById(precipitation);
|
||||||
|
if (updateflag) {
|
||||||
|
return Result.successResult();
|
||||||
|
} else {
|
||||||
|
return Result.errorResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "删除降水量信息")
|
||||||
|
@DeleteMapping("deletePrecipitation/{id}")
|
||||||
|
public Result deletePlateArea(@PathVariable String id) {
|
||||||
|
boolean updateflag = dicekePrecipitationService.removeById(id);
|
||||||
|
if (updateflag) {
|
||||||
|
return Result.successResult();
|
||||||
|
} else {
|
||||||
|
return Result.errorResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "新增降水量信息")
|
||||||
|
@PostMapping("addPrecipitation")
|
||||||
|
public Result addPlateArea(@RequestBody DicekePrecipitation precipitation) {
|
||||||
|
boolean updateflag = dicekePrecipitationService.save(precipitation);
|
||||||
|
if (updateflag) {
|
||||||
|
return Result.successResult();
|
||||||
|
} else {
|
||||||
|
return Result.errorResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user