| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- package cn.com.goldenwater.dcproj.controller.anze;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.model.AttProjectInsurance;
- import cn.com.goldenwater.dcproj.param.AttProjectInsuranceParam;
- import cn.com.goldenwater.dcproj.service.AttProjectInsuranceService;
- import com.github.pagehelper.PageInfo;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import io.swagger.annotations.ApiParam;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.util.Assert;
- import org.springframework.web.bind.annotation.*;
- /**
- * @author lql
- * @date 2026-4-21
- */
- @Slf4j
- @Api(value = "水利工程管理", tags = "水利工程管理")
- @RestController
- @RequestMapping("/att/project/insurance")
- public class AttProjectInsuranceController extends BaseController {
- @Autowired
- private AttProjectInsuranceService attProjectInsuranceService;
- @ApiOperation(value = "添加水利工程")
- @RequestMapping(value = "/add", method = RequestMethod.POST)
- public BaseResponse<AttProjectInsurance> insert(@ApiParam(name = "attProjectInsurance", value = "AttProjectInsurance", required = true) @RequestBody AttProjectInsurance attProjectInsurance) {
- int ret = attProjectInsuranceService.insert(attProjectInsurance);
- return buildSuccessResponse(attProjectInsurance);
- }
- @ApiOperation(value = "根据ID删除水利工程")
- @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
- public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- int ret = attProjectInsuranceService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "更新水利工程信息")
- @RequestMapping(value = "/update", method = RequestMethod.POST)
- public BaseResponse<AttProjectInsurance> update(@ApiParam(name = "attProjectInsurance", value = "AttProjectInsurance", required = true) @RequestBody AttProjectInsurance attProjectInsurance) {
- Assert.notNull(attProjectInsurance.getId(), "主键id为必填参数");
- int ret = attProjectInsuranceService.update(attProjectInsurance);
- return buildSuccessResponse(attProjectInsurance);
- }
- @ApiOperation(value = "根据ID获取水利工程(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<AttProjectInsurance> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- AttProjectInsurance attProjectInsurance = attProjectInsuranceService.get(id);
- return buildSuccessResponse(attProjectInsurance);
- }
- @ApiOperation(value = "根据ID获取水利工程(分页)")
- @RequestMapping(value = "/list", method = RequestMethod.POST)
- public BaseResponse<PageInfo> pageList(@ApiParam(name = "attProjectInsuranceParam", value = "attProjectInsuranceParam", required = true)
- @RequestBody AttProjectInsuranceParam param) {
- PageInfo attProjectInsurance = attProjectInsuranceService.findPageInfo(param);
- return buildSuccessResponse(attProjectInsurance);
- }
- }
|