package cn.com.goldenwater.dcproj.controller.dstfldqh; import cn.com.goldenwater.core.web.BaseController; import cn.com.goldenwater.core.web.BaseResponse; import cn.com.goldenwater.dcproj.model.BisInspDstfldqhNote; import cn.com.goldenwater.dcproj.service.BisInspDstfldqhNoteService; 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-10 */ @Api(value = "青海水毁督查情况管理", tags = "青海水毁督查情况管理") @RestController @RequestMapping("/bis/insp/dstfldqh/note") public class BisInspDstfldqhNoteController extends BaseController { private Logger logger = LoggerFactory.getLogger(getClass()); @Autowired private BisInspDstfldqhNoteService bisInspDstfldqhNoteService; @ApiOperation(value = "添加青海水毁督查情况") @RequestMapping(value = "", method = RequestMethod.POST) public BaseResponse insert(@ApiParam(name = "bisInspDstfldqhNote", value = "BisInspDstfldqhNote", required = true) @RequestBody BisInspDstfldqhNote bisInspDstfldqhNote) { bisInspDstfldqhNote.setPersId(getCurrentPersId()); if (StringUtils.isBlank(bisInspDstfldqhNote.getId())) { bisInspDstfldqhNoteService.insert(bisInspDstfldqhNote); } else { bisInspDstfldqhNoteService.update(bisInspDstfldqhNote); } return buildSuccessResponse(bisInspDstfldqhNote); } @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 = bisInspDstfldqhNoteService.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) { BisInspDstfldqhNote bisInspDstfldqhNote = bisInspDstfldqhNoteService.get(id); return buildSuccessResponse(bisInspDstfldqhNote); } }