package cn.com.goldenwater.dcproj.controller.keychkqh; import cn.com.goldenwater.core.web.BaseController; import cn.com.goldenwater.core.web.BaseResponse; import cn.com.goldenwater.dcproj.model.BisInspKeychkqhSection; import cn.com.goldenwater.dcproj.service.BisInspKeychkqhSectionService; 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.*; import java.util.List; /** * @author lhc * @date 2021-6-25 */ @Api(value = "青海水利工程建设-质量检查登记表标段管理", tags = "青海水利工程建设-质量检查登记表标段管理") @RestController @RequestMapping("/bis/insp/keychkqh/section") public class BisInspKeychkqhSectionController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private BisInspKeychkqhSectionService bisInspKeychkqhSectionService; @ApiOperation(value = "修改青海水利工程建设-质量检查登记表标段") @RequestMapping(value = "", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "bisInspKeychkqhSection", value = "BisInspKeychkqhSection", required = true) @RequestBody BisInspKeychkqhSection bisInspKeychkqhSection) { int ret = 0; if (StringUtils.isBlank(bisInspKeychkqhSection.getId())) { ret = bisInspKeychkqhSectionService.insert(bisInspKeychkqhSection); } else { ret = bisInspKeychkqhSectionService.update(bisInspKeychkqhSection); } return buildSuccessResponse(bisInspKeychkqhSection); } @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 = bisInspKeychkqhSectionService.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) { BisInspKeychkqhSection bisInspKeychkqhSection = bisInspKeychkqhSectionService.get(id); return buildSuccessResponse(bisInspKeychkqhSection); } @ApiOperation(value = "指定登记表下的所有标段") @RequestMapping(value = "/listByRegId/{id}", method = RequestMethod.GET) public BaseResponse> listByRegId(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { return buildSuccessResponse(bisInspKeychkqhSectionService.listByRegId(id)); } }