b3ffeefe3c9a94dc8a8fdb73bf57c46e62086653.svn-base 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package cn.com.goldenwater.dcproj.controller.stnd;
  2. import cn.com.goldenwater.dcproj.model.BisInspStndRgstr;
  3. import cn.com.goldenwater.dcproj.service.BisInspStndRgstrService;
  4. import cn.com.goldenwater.core.web.BaseController;
  5. import cn.com.goldenwater.core.web.BaseResponse;
  6. import io.swagger.annotations.Api;
  7. import io.swagger.annotations.ApiOperation;
  8. import io.swagger.annotations.ApiParam;
  9. import org.slf4j.Logger;
  10. import org.slf4j.LoggerFactory;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.util.Assert;
  13. import org.springframework.web.bind.annotation.PathVariable;
  14. import org.springframework.web.bind.annotation.RequestBody;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.RequestMethod;
  17. import org.springframework.web.bind.annotation.RestController;
  18. /**
  19. * @author lhc
  20. * @date 2020-3-25
  21. */
  22. @Api(value = "小水库标准化登记表管理",tags="小水库标准化登记表管理")
  23. @RestController
  24. @RequestMapping("/bis/insp/stnd/rgstr")
  25. public class BisInspStndRgstrController extends BaseController {
  26. private Logger logger = LoggerFactory.getLogger(getClass());
  27. @Autowired
  28. private BisInspStndRgstrService bisInspStndRgstrService;
  29. @ApiOperation(value = "添加小水库标准化登记表")
  30. @RequestMapping(value = "/add", method = RequestMethod.POST)
  31. public BaseResponse<BisInspStndRgstr> insert(@ApiParam(name = "bisInspStndRgstr", value = "BisInspStndRgstr", required = true) @RequestBody BisInspStndRgstr bisInspStndRgstr) {
  32. int ret = bisInspStndRgstrService.insert(bisInspStndRgstr);
  33. return buildSuccessResponse(bisInspStndRgstr);
  34. }
  35. @ApiOperation(value = "根据ID删除小水库标准化登记表")
  36. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  37. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  38. int ret = bisInspStndRgstrService.delete(id);
  39. return buildSuccessResponse();
  40. }
  41. @ApiOperation(value = "更新小水库标准化登记表信息")
  42. @RequestMapping(value = "/update", method = RequestMethod.POST)
  43. public BaseResponse<BisInspStndRgstr> update(@ApiParam(name = "bisInspStndRgstr", value = "BisInspStndRgstr", required = true) @RequestBody BisInspStndRgstr bisInspStndRgstr) {
  44. Assert.notNull(bisInspStndRgstr.getId(), "主键id为必填参数");
  45. int ret = bisInspStndRgstrService.update(bisInspStndRgstr);
  46. return buildSuccessResponse(bisInspStndRgstr);
  47. }
  48. @ApiOperation(value = "根据ID获取小水库标准化登记表(单表)")
  49. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  50. public BaseResponse<BisInspStndRgstr> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  51. BisInspStndRgstr bisInspStndRgstr = bisInspStndRgstrService.get(id);
  52. return buildSuccessResponse(bisInspStndRgstr);
  53. }
  54. }