31a3f0228d852074395a5f7143ddd75b00e448a3.svn-base 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package cn.com.goldenwater.dcproj.controller.xjvill;
  2. import cn.com.goldenwater.dcproj.model.AttXjcwsBase;
  3. import cn.com.goldenwater.dcproj.param.AttXjcwsBaseParam;
  4. import cn.com.goldenwater.dcproj.service.AttXjcwsBaseService;
  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 io.swagger.annotations.Api;
  9. import io.swagger.annotations.ApiOperation;
  10. import io.swagger.annotations.ApiParam;
  11. import org.slf4j.Logger;
  12. import org.slf4j.LoggerFactory;
  13. import org.apache.commons.lang3.StringUtils;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.util.Assert;
  16. import org.springframework.web.bind.annotation.PathVariable;
  17. import org.springframework.web.bind.annotation.RequestBody;
  18. import org.springframework.web.bind.annotation.RequestMapping;
  19. import org.springframework.web.bind.annotation.RequestMethod;
  20. import org.springframework.web.bind.annotation.RequestParam;
  21. import org.springframework.web.bind.annotation.RestController;
  22. import java.util.List;
  23. /**
  24. * @author lhc
  25. * @date 2021-9-9
  26. */
  27. @Api(value = "新疆农村供水工程管理",tags="新疆农村供水工程管理")
  28. @RestController
  29. @RequestMapping("/att/xjcws/base")
  30. public class AttXjcwsBaseController extends BaseController {
  31. @Autowired
  32. private AttXjcwsBaseService attXjcwsBaseService;
  33. @ApiOperation(value = "修改新疆农村供水工程")
  34. @RequestMapping(value = "", method = RequestMethod.POST)
  35. public BaseResponse<AttXjcwsBase> insert(@ApiParam(name = "attXjcwsBase", value = "AttXjcwsBase", required = true) @RequestBody AttXjcwsBase attXjcwsBase) {
  36. int ret = 0;
  37. if(StringUtils.isBlank(attXjcwsBase.getId())){
  38. ret = attXjcwsBaseService.insert(attXjcwsBase);
  39. } else {
  40. ret = attXjcwsBaseService.update(attXjcwsBase);
  41. }
  42. return buildSuccessResponse(attXjcwsBase);
  43. }
  44. @ApiOperation(value = "根据ID删除新疆农村供水工程")
  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 = attXjcwsBaseService.delete(id);
  48. return buildSuccessResponse();
  49. }
  50. @ApiOperation(value = "根据ID获取新疆农村供水工程(单表)")
  51. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  52. public BaseResponse<AttXjcwsBase> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  53. AttXjcwsBase attXjcwsBase = attXjcwsBaseService.get(id);
  54. return buildSuccessResponse(attXjcwsBase);
  55. }
  56. }