package cn.com.goldenwater.dcproj.controller.rsfcoqh; import cn.com.goldenwater.core.web.BaseController; import cn.com.goldenwater.core.web.BaseResponse; import cn.com.goldenwater.dcproj.model.BisInspRsfcoqhPres; import cn.com.goldenwater.dcproj.service.BisInspRsfcoqhPresService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.apache.commons.lang3.StringUtils; 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 lhc * @date 2021-6-10 */ @Api(value = "水库安全度汛检查表管理", tags = "水库安全度汛检查表管理") @RestController @RequestMapping("/bis/insp/rsfcoqh/pres") public class BisInspRsfcoqhPresController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private BisInspRsfcoqhPresService bisInspRsfcoqhPresService; @ApiOperation(value = "添加水库安全度汛检查表") @RequestMapping(value = "", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "bisInspRsfcoqhPres", value = "BisInspRsfcoqhPres", required = true) @RequestBody BisInspRsfcoqhPres bisInspRsfcoqhPres) { bisInspRsfcoqhPres.setPersId(getCurrentPersId()); if (StringUtils.isBlank(bisInspRsfcoqhPres.getId())) { bisInspRsfcoqhPresService.insert(bisInspRsfcoqhPres); } else { bisInspRsfcoqhPresService.update(bisInspRsfcoqhPres); } return buildSuccessResponse(bisInspRsfcoqhPres); } @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 = bisInspRsfcoqhPresService.delete(id); return buildSuccessResponse(); } @ApiOperation(value = "更新水库安全度汛检查表信息") @RequestMapping(value = "/update", method = RequestMethod.POST) public BaseResponse update(@ApiParam(name = "bisInspRsfcoqhPres", value = "BisInspRsfcoqhPres", required = true) @RequestBody BisInspRsfcoqhPres bisInspRsfcoqhPres) { Assert.notNull(bisInspRsfcoqhPres.getId(), "主键id为必填参数"); int ret = bisInspRsfcoqhPresService.update(bisInspRsfcoqhPres); return buildSuccessResponse(bisInspRsfcoqhPres); } @ApiOperation(value = "根据ID获取水库安全度汛检查表(单表)") @RequestMapping(value = "/{id}", method = RequestMethod.GET) public BaseResponse get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { BisInspRsfcoqhPres bisInspRsfcoqhPres = bisInspRsfcoqhPresService.get(id); return buildSuccessResponse(bisInspRsfcoqhPres); } }