7feb821d26e2bf49bc4396441335ae7136a12325.svn-base 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package cn.com.goldenwater.dcproj.controller.rdwpgd;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.AttRdwpgdBase;
  5. import cn.com.goldenwater.dcproj.service.AttRdwpgdBaseService;
  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 hjp
  20. * @date 2022-6-2
  21. */
  22. @Api(value = "农饮工程-基础表管理",tags="农饮工程-基础表管理")
  23. @RestController
  24. @RequestMapping("/att/rdwpgd/base")
  25. public class AttRdwpgdBaseController extends BaseController {
  26. private Logger logger = LoggerFactory.getLogger(getClass());
  27. @Autowired
  28. private AttRdwpgdBaseService attRdwpgdBaseService;
  29. @ApiOperation(value = "添加农饮工程-基础表")
  30. @RequestMapping(value = "/", method = RequestMethod.POST)
  31. public BaseResponse<AttRdwpgdBase> insert(@ApiParam(name = "attRdwpgdBase", value = "AttRdwpgdBase", required = true) @RequestBody AttRdwpgdBase attRdwpgdBase) {
  32. int ret = attRdwpgdBaseService.insert(attRdwpgdBase);
  33. return buildSuccessResponse(attRdwpgdBase);
  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 = attRdwpgdBaseService.delete(id);
  39. return buildSuccessResponse();
  40. }
  41. @ApiOperation(value = "更新农饮工程-基础表信息")
  42. @RequestMapping(value = "/update", method = RequestMethod.POST)
  43. public BaseResponse<AttRdwpgdBase> update(@ApiParam(name = "attRdwpgdBase", value = "AttRdwpgdBase", required = true) @RequestBody AttRdwpgdBase attRdwpgdBase) {
  44. Assert.notNull(attRdwpgdBase.getId(), "主键id为必填参数");
  45. int ret = attRdwpgdBaseService.update(attRdwpgdBase);
  46. return buildSuccessResponse(attRdwpgdBase);
  47. }
  48. @ApiOperation(value = "根据ID获取农饮工程-基础表(单表)")
  49. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  50. public BaseResponse<AttRdwpgdBase> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  51. AttRdwpgdBase attRdwpgdBase = attRdwpgdBaseService.get(id);
  52. return buildSuccessResponse(attRdwpgdBase);
  53. }
  54. }