| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- package cn.com.goldenwater.dcproj.controller.wagajs;
- import cn.com.goldenwater.core.web.BaseController;
- import cn.com.goldenwater.core.web.BaseResponse;
- import cn.com.goldenwater.dcproj.model.BisInspWagajsBdgDmam;
- import cn.com.goldenwater.dcproj.service.BisInspWagajsBdgDmamService;
- import cn.com.goldenwater.target.CheckException;
- 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-5-10
- */
- @Api(value = "xxx管理", tags = "xxx管理")
- @RestController
- @RequestMapping("/bis/insp/wagajs/bdg/dmam")
- public class BisInspWagajsBdgDmamController extends BaseController {
- private Logger logger = LoggerFactory.getLogger(getClass());
- @Autowired
- private BisInspWagajsBdgDmamService bisInspWagajsBdgDmamService;
- @ApiOperation(value = "修改xxx")
- @RequestMapping(value = "", method = RequestMethod.POST)
- public BaseResponse<BisInspWagajsBdgDmam> insert(@ApiParam(name = "bisInspWagajsBdgDmam", value = "BisInspWagajsBdgDmam", required = true) @RequestBody BisInspWagajsBdgDmam bisInspWagajsBdgDmam) {
- // 必填项判断
- if (StringUtils.isBlank(bisInspWagajsBdgDmam.getRgstrId())) {
- throw new CheckException("缺少登记表编码");
- }
- bisInspWagajsBdgDmamService.update(bisInspWagajsBdgDmam);
- return buildSuccessResponse(bisInspWagajsBdgDmam);
- }
- @ApiOperation(value = "根据ID删除xxx")
- @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
- public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- int ret = bisInspWagajsBdgDmamService.delete(id);
- return buildSuccessResponse();
- }
- @ApiOperation(value = "根据ID获取xxx(单表)")
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public BaseResponse<BisInspWagajsBdgDmam> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
- BisInspWagajsBdgDmam bisInspWagajsBdgDmam = bisInspWagajsBdgDmamService.get(id);
- return buildSuccessResponse(bisInspWagajsBdgDmam);
- }
- }
|