UpdateAppController.java 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. package com.ruoyi.web.controller.system;
  2. import com.ruoyi.common.annotation.Log;
  3. import com.ruoyi.common.core.controller.BaseController;
  4. import com.ruoyi.common.core.domain.AjaxResult;
  5. import com.ruoyi.common.core.page.TableDataInfo;
  6. import com.ruoyi.common.enums.BusinessType;
  7. import com.ruoyi.common.utils.poi.ExcelUtil;
  8. import com.ruoyi.system.domain.UpdateApp;
  9. import com.ruoyi.system.service.IUpdateAppService;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.web.bind.annotation.*;
  12. import javax.servlet.http.HttpServletResponse;
  13. import java.util.List;
  14. /**
  15. * 【请填写功能名称】Controller
  16. *
  17. * @author ruoyi
  18. * @date 2023-02-16
  19. */
  20. @RestController
  21. @RequestMapping("/system/app")
  22. public class UpdateAppController extends BaseController
  23. {
  24. @Autowired
  25. private IUpdateAppService updateAppService;
  26. /**
  27. * 查询【请填写功能名称】列表
  28. */
  29. @GetMapping("/list")
  30. public TableDataInfo list(UpdateApp updateApp)
  31. {
  32. startPage();
  33. List<UpdateApp> list = updateAppService.selectUpdateAppList(updateApp);
  34. return getDataTable(list);
  35. }
  36. /**
  37. * 导出【请填写功能名称】列表
  38. */
  39. @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
  40. @PostMapping("/export")
  41. public void export(HttpServletResponse response, UpdateApp updateApp)
  42. {
  43. List<UpdateApp> list = updateAppService.selectUpdateAppList(updateApp);
  44. ExcelUtil<UpdateApp> util = new ExcelUtil<UpdateApp>(UpdateApp.class);
  45. util.exportExcel(response, list, "【请填写功能名称】数据");
  46. }
  47. /**
  48. * 获取【请填写功能名称】详细信息
  49. */
  50. @GetMapping(value = "/{id}")
  51. public AjaxResult getInfo(@PathVariable("id") Long id)
  52. {
  53. return success(updateAppService.selectUpdateAppById(id));
  54. }
  55. /**
  56. * 新增【请填写功能名称】
  57. */
  58. @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
  59. @PostMapping
  60. public AjaxResult add(@RequestBody UpdateApp updateApp)
  61. {
  62. return toAjax(updateAppService.insertUpdateApp(updateApp));
  63. }
  64. /**
  65. * 修改【请填写功能名称】
  66. */
  67. @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
  68. @PostMapping("/put")
  69. public AjaxResult edit(@RequestBody UpdateApp updateApp)
  70. {
  71. return toAjax(updateAppService.updateUpdateApp(updateApp));
  72. }
  73. /**
  74. * 删除【请填写功能名称】
  75. */
  76. @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
  77. @GetMapping("/delete/{ids}")
  78. public AjaxResult remove(@PathVariable Long[] ids)
  79. {
  80. return toAjax(updateAppService.deleteUpdateAppByIds(ids));
  81. }
  82. /**
  83. * 获取当前最新版本数据
  84. */
  85. @GetMapping(value = "/new")
  86. public AjaxResult getInfoNew(UpdateApp updateApp)
  87. {
  88. return success(updateAppService.getInfoNew(updateApp));
  89. }
  90. }