2fef762017465bddee21db5991e751047d7b5c22.svn-base 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package cn.com.goldenwater.dcproj.controller.keyreg;
  2. import cn.com.goldenwater.dcproj.model.AttEmpwtprjTrack;
  3. import cn.com.goldenwater.dcproj.service.AttEmpwtprjTrackService;
  4. import cn.com.goldenwater.core.web.BaseController;
  5. import cn.com.goldenwater.core.web.BaseResponse;
  6. import cn.com.goldenwater.id.util.UuidUtil;
  7. import io.swagger.annotations.Api;
  8. import io.swagger.annotations.ApiOperation;
  9. import io.swagger.annotations.ApiParam;
  10. import org.slf4j.Logger;
  11. import org.slf4j.LoggerFactory;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.util.Assert;
  14. import org.springframework.web.bind.annotation.PathVariable;
  15. import org.springframework.web.bind.annotation.RequestBody;
  16. import org.springframework.web.bind.annotation.RequestMapping;
  17. import org.springframework.web.bind.annotation.RequestMethod;
  18. import org.springframework.web.bind.annotation.RestController;
  19. /**
  20. * @author lhc
  21. * @date 2019-4-20
  22. */
  23. @Api(value = "172重点水利项目纠错表管理", tags = "172重点水利项目纠错表管理")
  24. @RestController
  25. @RequestMapping("/bis/insp/empwtprj/track")
  26. public class AttEmpwtprjTrackController extends BaseController {
  27. private Logger logger = LoggerFactory.getLogger(getClass());
  28. @Autowired
  29. private AttEmpwtprjTrackService attEmpwtprjTrackService;
  30. @ApiOperation(value = "添加172重点水利项目纠错表")
  31. @RequestMapping(value = "/add", method = RequestMethod.POST)
  32. public BaseResponse<AttEmpwtprjTrack> insert(@ApiParam(name = "attEmpwtprjTrack", value = "AttEmpwtprjTrack", required = true) @RequestBody AttEmpwtprjTrack attEmpwtprjTrack) {
  33. String uuid = UuidUtil.uuid(); // 生成uuid
  34. attEmpwtprjTrack.setId(uuid);
  35. int ret = attEmpwtprjTrackService.insert(attEmpwtprjTrack);
  36. return buildSuccessResponse(attEmpwtprjTrack);
  37. }
  38. @ApiOperation(value = "根据ID删除172重点水利项目纠错表")
  39. @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST)
  40. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  41. int ret = attEmpwtprjTrackService.delete(id);
  42. return buildSuccessResponse();
  43. }
  44. @ApiOperation(value = "更新172重点水利项目纠错表信息")
  45. @RequestMapping(value = "/update", method = RequestMethod.POST)
  46. public BaseResponse<AttEmpwtprjTrack> update(@ApiParam(name = "attEmpwtprjTrack", value = "AttEmpwtprjTrack", required = true) @RequestBody AttEmpwtprjTrack attEmpwtprjTrack) {
  47. Assert.notNull(attEmpwtprjTrack.getId(), "主键id为必填参数");
  48. int ret = attEmpwtprjTrackService.update(attEmpwtprjTrack);
  49. return buildSuccessResponse(attEmpwtprjTrack);
  50. }
  51. @ApiOperation(value = "根据ID获取172重点水利项目纠错表")
  52. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  53. public BaseResponse<AttEmpwtprjTrack> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  54. AttEmpwtprjTrack attEmpwtprjTrack = attEmpwtprjTrackService.get(id);
  55. return buildSuccessResponse(attEmpwtprjTrack);
  56. }
  57. }