c4d7150df304b86195a008ec97e41d7b05ed2075.svn-base 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package cn.com.goldenwater.dcproj.controller.ducha;
  2. import cn.com.goldenwater.dcproj.model.BisInspHystpSaf;
  3. import cn.com.goldenwater.dcproj.param.BisInspHystpSafParam;
  4. import cn.com.goldenwater.dcproj.service.BisInspHystpSafService;
  5. import cn.com.goldenwater.core.web.BaseController;
  6. import cn.com.goldenwater.core.web.BaseResponse;
  7. import cn.com.goldenwater.id.util.UuidUtil;
  8. import cn.com.goldenwater.target.CheckException;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiOperation;
  11. import io.swagger.annotations.ApiParam;
  12. import org.apache.commons.lang3.StringUtils;
  13. import org.slf4j.Logger;
  14. import org.slf4j.LoggerFactory;
  15. import org.springframework.beans.factory.annotation.Autowired;
  16. import org.springframework.util.Assert;
  17. import org.springframework.web.bind.annotation.PathVariable;
  18. import org.springframework.web.bind.annotation.RequestBody;
  19. import org.springframework.web.bind.annotation.RequestMapping;
  20. import org.springframework.web.bind.annotation.RequestMethod;
  21. import org.springframework.web.bind.annotation.RequestParam;
  22. import org.springframework.web.bind.annotation.RestController;
  23. import java.util.List;
  24. /**
  25. * @author lhc
  26. * @date 2022-3-23
  27. */
  28. @Api(value = "xxx管理",tags="xxx管理")
  29. @RestController
  30. @RequestMapping("/bis/insp/hystp/saf")
  31. public class BisInspHystpSafController extends BaseController {
  32. private Logger logger = LoggerFactory.getLogger(getClass());
  33. @Autowired
  34. private BisInspHystpSafService bisInspHystpSafService;
  35. @ApiOperation(value = "添加xxx")
  36. @RequestMapping(value = "/", method = RequestMethod.POST)
  37. public BaseResponse<BisInspHystpSaf> insert(@ApiParam(name = "bisInspHystpSaf", value = "BisInspHystpSaf", required = true) @RequestBody BisInspHystpSaf bisInspHystpSaf) {
  38. if (StringUtils.isBlank(bisInspHystpSaf.getRgstrId())) {
  39. throw new CheckException("缺少登记表编码");
  40. }
  41. bisInspHystpSafService.update(bisInspHystpSaf);
  42. return buildSuccessResponse(bisInspHystpSaf);
  43. }
  44. @ApiOperation(value = "根据ID删除xxx")
  45. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  46. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  47. int ret = bisInspHystpSafService.delete(id);
  48. return buildSuccessResponse();
  49. }
  50. @ApiOperation(value = "更新xxx信息")
  51. @RequestMapping(value = "/update", method = RequestMethod.POST)
  52. public BaseResponse<BisInspHystpSaf> update(@ApiParam(name = "bisInspHystpSaf", value = "BisInspHystpSaf", required = true) @RequestBody BisInspHystpSaf bisInspHystpSaf) {
  53. Assert.notNull(bisInspHystpSaf.getId(), "主键id为必填参数");
  54. int ret = bisInspHystpSafService.update(bisInspHystpSaf);
  55. return buildSuccessResponse(bisInspHystpSaf);
  56. }
  57. @ApiOperation(value = "根据ID获取xxx(单表)")
  58. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  59. public BaseResponse<BisInspHystpSaf> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  60. BisInspHystpSaf bisInspHystpSaf = bisInspHystpSafService.get(id);
  61. return buildSuccessResponse(bisInspHystpSaf);
  62. }
  63. }