package cn.com.goldenwater.dcproj.controller; import cn.com.goldenwater.core.web.BaseController; import cn.com.goldenwater.core.web.BaseResponse; import cn.com.goldenwater.dcproj.model.BisInspVill2021Usr; import cn.com.goldenwater.dcproj.service.BisInspVill2021UsrService; 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.web.bind.annotation.*; /** * @author lhc * @date 2021-6-16 */ @Api(value = "097 2021农饮-用水户管理", tags = "097 2021农饮-用水户管理") @RestController @RequestMapping("/bis/insp/vill2021/usr") public class BisInspVill2021UsrController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private BisInspVill2021UsrService bisInspVill2021UsrService; @ApiOperation(value = "修改097 2021农饮-用水户") @RequestMapping(value = "", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "bisInspVill2021Usr", value = "BisInspVill2021Usr", required = true) @RequestBody BisInspVill2021Usr bisInspVill2021Usr) { bisInspVill2021Usr.setPersId(getCurrentPersId()); int ret = 0; if (StringUtils.isBlank(bisInspVill2021Usr.getId())) { ret = bisInspVill2021UsrService.insert(bisInspVill2021Usr); } else { ret = bisInspVill2021UsrService.update(bisInspVill2021Usr); } return buildSuccessResponse(bisInspVill2021Usr); } @ApiOperation(value = "根据ID删除097 2021农饮-用水户") @RequestMapping(value = "delete/{id}", method = RequestMethod.POST) public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { int ret = bisInspVill2021UsrService.delete(id); return buildSuccessResponse(); } @ApiOperation(value = "根据ID获取097 2021农饮-用水户(单表)") @RequestMapping(value = "/{id}", method = RequestMethod.GET) public BaseResponse get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { BisInspVill2021Usr bisInspVill2021Usr = bisInspVill2021UsrService.get(id); return buildSuccessResponse(bisInspVill2021Usr); } }