package cn.com.goldenwater.dcproj.controller.swhsjs; import cn.com.goldenwater.core.web.BaseController; import cn.com.goldenwater.core.web.BaseResponse; import cn.com.goldenwater.dcproj.model.AttSwhsjsBase; import cn.com.goldenwater.dcproj.service.AttSwhsjsBaseService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; /** * @author * @date 2022-2-23 */ @Api(value = "江苏水源地基本信息管理", tags = "江苏水源地基本信息管理") @RestController @RequestMapping("/att/swhsjs/base") public class AttSwhsjsBaseController extends BaseController { @Autowired private AttSwhsjsBaseService attSwhsjsBaseService; @ApiOperation(value = "修改江苏水源地基本信息") @RequestMapping(value = "", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "attSwhsjsBase", value = "AttSwhsjsBase", required = true) @RequestBody AttSwhsjsBase attSwhsjsBase) { int ret = 0; if (StringUtils.isBlank(attSwhsjsBase.getId())) { ret = attSwhsjsBaseService.insert(attSwhsjsBase); } else { ret = attSwhsjsBaseService.update(attSwhsjsBase); } return buildSuccessResponse(attSwhsjsBase); } @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 = attSwhsjsBaseService.delete(id); return buildSuccessResponse(); } @ApiOperation(value = "根据ID获取江苏水源地基本信息(单表)") @RequestMapping(value = "/{id}", method = RequestMethod.GET) public BaseResponse get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { AttSwhsjsBase attSwhsjsBase = attSwhsjsBaseService.get(id); return buildSuccessResponse(attSwhsjsBase); } }