GenTableRelationController.java 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package com.boman.gen.controller;
  2. import com.boman.common.core.utils.SecurityUtils;
  3. import com.boman.common.core.web.controller.BaseController;
  4. import com.boman.domain.dto.AjaxResult;
  5. import com.boman.domain.TableDataInfo;
  6. import com.boman.domain.GenTableRelation;
  7. import com.boman.gen.service.IGenTableRelationService;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.validation.annotation.Validated;
  10. import org.springframework.web.bind.annotation.*;
  11. import java.util.List;
  12. /**关联关系表
  13. * @author tjf
  14. * @Date: 2021/03/25/16:02
  15. */
  16. @RequestMapping("/genTableRelation")
  17. @RestController
  18. public class GenTableRelationController extends BaseController {
  19. @Autowired
  20. private IGenTableRelationService genTableRelationService;
  21. /**
  22. * 查询关联关系表列表
  23. */
  24. @GetMapping("/list")
  25. public TableDataInfo genTableRelationList(GenTableRelation genTableRelation) {
  26. startPage();
  27. List<GenTableRelation> list = genTableRelationService.selectGenTableRelationList(genTableRelation);
  28. return getDataTable(list);
  29. }
  30. /**
  31. * 根据关联关系表编号获取详细信息
  32. */
  33. @GetMapping(value = "/{id}")
  34. public AjaxResult getInfo(@PathVariable Long id)
  35. {
  36. return AjaxResult.success(genTableRelationService.selectGenTableRelationById(id));
  37. }
  38. /**
  39. * 新增关联关系表
  40. */
  41. @PostMapping
  42. public AjaxResult add(@Validated @RequestBody GenTableRelation genTableRelation)
  43. {
  44. genTableRelation.setCreateBy(SecurityUtils.getUsername());
  45. return toAjax(genTableRelationService.insertGenTableRelation(genTableRelation));
  46. }
  47. /**
  48. * 修改关联关系表
  49. */
  50. @PutMapping
  51. public AjaxResult edit(@Validated @RequestBody GenTableRelation genTableRelation)
  52. {
  53. genTableRelation.setUpdateBy(SecurityUtils.getUsername());
  54. return toAjax(genTableRelationService.updateGenTableRelation(genTableRelation));
  55. }
  56. /**
  57. * 删除关联关系表
  58. */
  59. @DeleteMapping("/{ids}")
  60. public AjaxResult remove(@PathVariable Long[] ids)
  61. {
  62. return toAjax(genTableRelationService.deleteGenTableRelation(ids));
  63. }
  64. }