113e587aa03a108a7d7216bf812cca7750414a5a.svn-base 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package cn.com.goldenwater.dcproj.controller.anze;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.AttProjectInsurance;
  5. import cn.com.goldenwater.dcproj.param.AttProjectInsuranceParam;
  6. import cn.com.goldenwater.dcproj.service.AttProjectInsuranceService;
  7. import com.github.pagehelper.PageInfo;
  8. import io.swagger.annotations.Api;
  9. import io.swagger.annotations.ApiOperation;
  10. import io.swagger.annotations.ApiParam;
  11. import lombok.extern.slf4j.Slf4j;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.util.Assert;
  14. import org.springframework.web.bind.annotation.*;
  15. /**
  16. * @author lql
  17. * @date 2026-4-21
  18. */
  19. @Slf4j
  20. @Api(value = "水利工程管理", tags = "水利工程管理")
  21. @RestController
  22. @RequestMapping("/att/project/insurance")
  23. public class AttProjectInsuranceController extends BaseController {
  24. @Autowired
  25. private AttProjectInsuranceService attProjectInsuranceService;
  26. @ApiOperation(value = "添加水利工程")
  27. @RequestMapping(value = "/add", method = RequestMethod.POST)
  28. public BaseResponse<AttProjectInsurance> insert(@ApiParam(name = "attProjectInsurance", value = "AttProjectInsurance", required = true) @RequestBody AttProjectInsurance attProjectInsurance) {
  29. int ret = attProjectInsuranceService.insert(attProjectInsurance);
  30. return buildSuccessResponse(attProjectInsurance);
  31. }
  32. @ApiOperation(value = "根据ID删除水利工程")
  33. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  34. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  35. int ret = attProjectInsuranceService.delete(id);
  36. return buildSuccessResponse();
  37. }
  38. @ApiOperation(value = "更新水利工程信息")
  39. @RequestMapping(value = "/update", method = RequestMethod.POST)
  40. public BaseResponse<AttProjectInsurance> update(@ApiParam(name = "attProjectInsurance", value = "AttProjectInsurance", required = true) @RequestBody AttProjectInsurance attProjectInsurance) {
  41. Assert.notNull(attProjectInsurance.getId(), "主键id为必填参数");
  42. int ret = attProjectInsuranceService.update(attProjectInsurance);
  43. return buildSuccessResponse(attProjectInsurance);
  44. }
  45. @ApiOperation(value = "根据ID获取水利工程(单表)")
  46. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  47. public BaseResponse<AttProjectInsurance> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  48. AttProjectInsurance attProjectInsurance = attProjectInsuranceService.get(id);
  49. return buildSuccessResponse(attProjectInsurance);
  50. }
  51. @ApiOperation(value = "根据ID获取水利工程(分页)")
  52. @RequestMapping(value = "/list", method = RequestMethod.POST)
  53. public BaseResponse<PageInfo> pageList(@ApiParam(name = "attProjectInsuranceParam", value = "attProjectInsuranceParam", required = true)
  54. @RequestBody AttProjectInsuranceParam param) {
  55. PageInfo attProjectInsurance = attProjectInsuranceService.findPageInfo(param);
  56. return buildSuccessResponse(attProjectInsurance);
  57. }
  58. }