d71aea7165a41282e34a617af3c1eb7b6f592694.svn-base 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package cn.com.goldenwater.dcproj.controller.wagajs;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.BisInspWagajsBdgDmam;
  5. import cn.com.goldenwater.dcproj.service.BisInspWagajsBdgDmamService;
  6. import cn.com.goldenwater.target.CheckException;
  7. import io.swagger.annotations.Api;
  8. import io.swagger.annotations.ApiOperation;
  9. import io.swagger.annotations.ApiParam;
  10. import org.apache.commons.lang3.StringUtils;
  11. import org.slf4j.Logger;
  12. import org.slf4j.LoggerFactory;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.web.bind.annotation.*;
  15. /**
  16. * @author lhc
  17. * @date 2021-5-10
  18. */
  19. @Api(value = "xxx管理", tags = "xxx管理")
  20. @RestController
  21. @RequestMapping("/bis/insp/wagajs/bdg/dmam")
  22. public class BisInspWagajsBdgDmamController extends BaseController {
  23. private Logger logger = LoggerFactory.getLogger(getClass());
  24. @Autowired
  25. private BisInspWagajsBdgDmamService bisInspWagajsBdgDmamService;
  26. @ApiOperation(value = "修改xxx")
  27. @RequestMapping(value = "", method = RequestMethod.POST)
  28. public BaseResponse<BisInspWagajsBdgDmam> insert(@ApiParam(name = "bisInspWagajsBdgDmam", value = "BisInspWagajsBdgDmam", required = true) @RequestBody BisInspWagajsBdgDmam bisInspWagajsBdgDmam) {
  29. // 必填项判断
  30. if (StringUtils.isBlank(bisInspWagajsBdgDmam.getRgstrId())) {
  31. throw new CheckException("缺少登记表编码");
  32. }
  33. bisInspWagajsBdgDmamService.update(bisInspWagajsBdgDmam);
  34. return buildSuccessResponse(bisInspWagajsBdgDmam);
  35. }
  36. @ApiOperation(value = "根据ID删除xxx")
  37. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  38. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  39. int ret = bisInspWagajsBdgDmamService.delete(id);
  40. return buildSuccessResponse();
  41. }
  42. @ApiOperation(value = "根据ID获取xxx(单表)")
  43. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  44. public BaseResponse<BisInspWagajsBdgDmam> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  45. BisInspWagajsBdgDmam bisInspWagajsBdgDmam = bisInspWagajsBdgDmamService.get(id);
  46. return buildSuccessResponse(bisInspWagajsBdgDmam);
  47. }
  48. }