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.AttProjectInsuranceRecord; import cn.com.goldenwater.dcproj.param.AttProjectInsuranceRecordParam; import cn.com.goldenwater.dcproj.service.AttProjectInsuranceRecordService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.*; /** * @author lql * @date 2026-4-21 */ @Api(value = "投保记录管理", tags = "投保记录管理") @RestController @RequestMapping("/att/project/insurance/record") public class AttProjectInsuranceRecordController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private AttProjectInsuranceRecordService attProjectInsuranceRecordService; @ApiOperation(value = "添加投保记录") @RequestMapping(value = "/add", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "attProjectInsuranceRecord", value = "AttProjectInsuranceRecord", required = true) @RequestBody AttProjectInsuranceRecord attProjectInsuranceRecord) { int ret = attProjectInsuranceRecordService.insert(attProjectInsuranceRecord); return buildSuccessResponse(attProjectInsuranceRecord); } @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 = attProjectInsuranceRecordService.delete(id); return buildSuccessResponse(); } @ApiOperation(value = "更新投保记录信息") @RequestMapping(value = "/update", method = RequestMethod.POST) public BaseResponse update(@ApiParam(name = "attProjectInsuranceRecord", value = "AttProjectInsuranceRecord", required = true) @RequestBody AttProjectInsuranceRecord attProjectInsuranceRecord) { Assert.notNull(attProjectInsuranceRecord.getId(), "主键id为必填参数"); int ret = attProjectInsuranceRecordService.update(attProjectInsuranceRecord); return buildSuccessResponse(attProjectInsuranceRecord); } @ApiOperation(value = "根据ID获取投保记录(单表)") @RequestMapping(value = "/{id}", method = RequestMethod.GET) public BaseResponse get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { AttProjectInsuranceRecord attProjectInsuranceRecord = attProjectInsuranceRecordService.get(id); return buildSuccessResponse(attProjectInsuranceRecord); } @ApiOperation(value = "根据ID获取投保记录(分页)") @RequestMapping(value = "/list", method = RequestMethod.POST) public BaseResponse pageList(@ApiParam(name = "attProjectInsuranceRecordParam", value = "attProjectInsuranceRecordParam", required = true) @RequestBody AttProjectInsuranceRecordParam param) { return buildSuccessResponse(attProjectInsuranceRecordService.findPageInfo(param)); } }