TbScene3dNumNewController.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. package com.fdkankan.task.controller;
  2. import com.mybatisflex.core.paginate.Page;
  3. import org.springframework.web.bind.annotation.DeleteMapping;
  4. import org.springframework.web.bind.annotation.GetMapping;
  5. import org.springframework.web.bind.annotation.PathVariable;
  6. import org.springframework.web.bind.annotation.PostMapping;
  7. import org.springframework.web.bind.annotation.PutMapping;
  8. import org.springframework.web.bind.annotation.RequestBody;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import com.fdkankan.task.entity.TbScene3dNumNew;
  12. import com.fdkankan.task.service.TbScene3dNumNewService;
  13. import org.springframework.web.bind.annotation.RestController;
  14. import java.io.Serializable;
  15. import java.util.List;
  16. /**
  17. * 控制层。
  18. *
  19. * @author Admin
  20. * @since 2023-12-01
  21. */
  22. @RestController
  23. @RequestMapping("/tbScene3dNumNew")
  24. public class TbScene3dNumNewController {
  25. @Autowired
  26. private TbScene3dNumNewService tbScene3dNumNewService;
  27. /**
  28. * 添加。
  29. *
  30. * @param tbScene3dNumNew
  31. * @return {@code true} 添加成功,{@code false} 添加失败
  32. */
  33. @PostMapping("save")
  34. public boolean save(@RequestBody TbScene3dNumNew tbScene3dNumNew) {
  35. return tbScene3dNumNewService.save(tbScene3dNumNew);
  36. }
  37. /**
  38. * 根据主键删除。
  39. *
  40. * @param id 主键
  41. * @return {@code true} 删除成功,{@code false} 删除失败
  42. */
  43. @DeleteMapping("remove/{id}")
  44. public boolean remove(@PathVariable Serializable id) {
  45. return tbScene3dNumNewService.removeById(id);
  46. }
  47. /**
  48. * 根据主键更新。
  49. *
  50. * @param tbScene3dNumNew
  51. * @return {@code true} 更新成功,{@code false} 更新失败
  52. */
  53. @PutMapping("update")
  54. public boolean update(@RequestBody TbScene3dNumNew tbScene3dNumNew) {
  55. return tbScene3dNumNewService.updateById(tbScene3dNumNew);
  56. }
  57. /**
  58. * 查询所有。
  59. *
  60. * @return 所有数据
  61. */
  62. @GetMapping("list")
  63. public List<TbScene3dNumNew> list() {
  64. return tbScene3dNumNewService.list();
  65. }
  66. /**
  67. * 根据主键获取详细信息。
  68. *
  69. * @param id 主键
  70. * @return 详情
  71. */
  72. @GetMapping("getInfo/{id}")
  73. public TbScene3dNumNew getInfo(@PathVariable Serializable id) {
  74. return tbScene3dNumNewService.getById(id);
  75. }
  76. /**
  77. * 分页查询。
  78. *
  79. * @param page 分页对象
  80. * @return 分页对象
  81. */
  82. @GetMapping("page")
  83. public Page<TbScene3dNumNew> page(Page<TbScene3dNumNew> page) {
  84. return tbScene3dNumNewService.page(page);
  85. }
  86. }