f2ad7873c2316643dc54810490631cc9a7ba195b.svn-base 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package cn.com.goldenwater.dcproj.controller.waga;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.AttWagaCrrct;
  5. import cn.com.goldenwater.dcproj.service.AttWagaCrrctService;
  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.*;
  15. /**
  16. * @author lune
  17. * @date 2019-4-22
  18. */
  19. @Api(value = "WAGA 水闸基础信息纠错管理", tags = "WAGA 水闸基础信息纠错管理")
  20. @RestController
  21. @RequestMapping("/att/waga/crrct")
  22. public class AttWagaCrrctController extends BaseController {
  23. private Logger logger = LoggerFactory.getLogger(getClass());
  24. @Autowired
  25. private AttWagaCrrctService attWagaCrrctService;
  26. @ApiOperation(value = "添加水闸基础信息纠错管理")
  27. @RequestMapping(value = "", method = RequestMethod.POST)
  28. public BaseResponse<String> insert(@ApiParam(name = "attWagaCrrct", value = "AttWagaCrrct", required = true) @RequestBody AttWagaCrrct attWagaCrrct) {
  29. String uuid = UuidUtil.uuid(); // 生成uuid
  30. attWagaCrrct.setId(uuid);
  31. attWagaCrrctService.insert(attWagaCrrct);
  32. return buildSuccessResponse(uuid);
  33. }
  34. @ApiOperation(value = "根据ID删除水闸基础信息纠错管理")
  35. @RequestMapping(value = "/del/{id}", method = RequestMethod.GET)
  36. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  37. attWagaCrrctService.delete(id);
  38. return buildSuccessResponse();
  39. }
  40. @ApiOperation(value = "更新水闸基础信息纠错管理信息")
  41. @RequestMapping(value = "/update", method = RequestMethod.POST)
  42. public BaseResponse update(@ApiParam(name = "attWagaCrrct", value = "AttWagaCrrct", required = true) @RequestBody AttWagaCrrct attWagaCrrct) {
  43. Assert.notNull(attWagaCrrct.getId(), "主键id为必填参数");
  44. attWagaCrrctService.update(attWagaCrrct);
  45. return buildSuccessResponse();
  46. }
  47. @ApiOperation(value = "根据ID获取水闸基础信息纠错管理信息")
  48. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  49. public BaseResponse<AttWagaCrrct> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  50. AttWagaCrrct attWagaCrrct = attWagaCrrctService.get(id);
  51. return buildSuccessResponse(attWagaCrrct);
  52. }
  53. }