c18a0f3bccec8b0ef371230d94bc2279433fef7a.svn-base 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package cn.com.goldenwater.dcproj.controller.swhsjs;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.AttSwhsjsBase;
  5. import cn.com.goldenwater.dcproj.service.AttSwhsjsBaseService;
  6. import io.swagger.annotations.Api;
  7. import io.swagger.annotations.ApiOperation;
  8. import io.swagger.annotations.ApiParam;
  9. import org.apache.commons.lang3.StringUtils;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.web.bind.annotation.*;
  12. /**
  13. * @author
  14. * @date 2022-2-23
  15. */
  16. @Api(value = "江苏水源地基本信息管理", tags = "江苏水源地基本信息管理")
  17. @RestController
  18. @RequestMapping("/att/swhsjs/base")
  19. public class AttSwhsjsBaseController extends BaseController {
  20. @Autowired
  21. private AttSwhsjsBaseService attSwhsjsBaseService;
  22. @ApiOperation(value = "修改江苏水源地基本信息")
  23. @RequestMapping(value = "", method = RequestMethod.POST)
  24. public BaseResponse<AttSwhsjsBase> insert(@ApiParam(name = "attSwhsjsBase", value = "AttSwhsjsBase", required = true)
  25. @RequestBody AttSwhsjsBase attSwhsjsBase) {
  26. int ret = 0;
  27. if (StringUtils.isBlank(attSwhsjsBase.getId())) {
  28. ret = attSwhsjsBaseService.insert(attSwhsjsBase);
  29. } else {
  30. ret = attSwhsjsBaseService.update(attSwhsjsBase);
  31. }
  32. return buildSuccessResponse(attSwhsjsBase);
  33. }
  34. @ApiOperation(value = "根据ID删除江苏水源地基本信息")
  35. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  36. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  37. int ret = attSwhsjsBaseService.delete(id);
  38. return buildSuccessResponse();
  39. }
  40. @ApiOperation(value = "根据ID获取江苏水源地基本信息(单表)")
  41. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  42. public BaseResponse<AttSwhsjsBase> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  43. AttSwhsjsBase attSwhsjsBase = attSwhsjsBaseService.get(id);
  44. return buildSuccessResponse(attSwhsjsBase);
  45. }
  46. }