AeroplaneController.java 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package com.phm.manage.controller;
  2. import java.util.List;
  3. import javax.servlet.http.HttpServletResponse;
  4. import com.phm.common.core.controller.BaseController;
  5. import com.phm.common.core.domain.AjaxResult;
  6. import org.springframework.security.access.prepost.PreAuthorize;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.GetMapping;
  9. import org.springframework.web.bind.annotation.PostMapping;
  10. import org.springframework.web.bind.annotation.PutMapping;
  11. import org.springframework.web.bind.annotation.DeleteMapping;
  12. import org.springframework.web.bind.annotation.PathVariable;
  13. import org.springframework.web.bind.annotation.RequestBody;
  14. import org.springframework.web.bind.annotation.RequestMapping;
  15. import org.springframework.web.bind.annotation.RestController;
  16. import com.phm.common.annotation.Log;
  17. import com.phm.common.enums.BusinessType;
  18. import com.phm.manage.domain.Aeroplane;
  19. import com.phm.manage.service.IAeroplaneService;
  20. import com.phm.common.utils.poi.ExcelUtil;
  21. import com.phm.common.core.page.TableDataInfo;
  22. /**
  23. * 单机信息Controller
  24. *
  25. * @author phm
  26. * @date 2023-08-22
  27. */
  28. @RestController
  29. @RequestMapping("/manage/aeroplane")
  30. public class AeroplaneController extends BaseController {
  31. @Autowired
  32. private IAeroplaneService aeroplaneService;
  33. /**
  34. * 查询单机信息列表
  35. */
  36. @PreAuthorize("@ss.hasPermi('manage:aeroplane:list')")
  37. @GetMapping("/list")
  38. public TableDataInfo list(Aeroplane aeroplane) {
  39. startPage();
  40. List<Aeroplane> list = aeroplaneService.selectAeroplaneList(aeroplane);
  41. return getDataTable(list);
  42. }
  43. /**
  44. * 导出单机信息列表
  45. */
  46. @PreAuthorize("@ss.hasPermi('manage:aeroplane:export')")
  47. @Log(title = "单机信息", businessType = BusinessType.EXPORT)
  48. @PostMapping("/export")
  49. public void export(HttpServletResponse response, Aeroplane aeroplane) {
  50. List<Aeroplane> list = aeroplaneService.selectAeroplaneList(aeroplane);
  51. ExcelUtil<Aeroplane> util = new ExcelUtil<Aeroplane>(Aeroplane.class);
  52. util.exportExcel(response, list, "单机信息数据");
  53. }
  54. /**
  55. * 获取单机信息详细信息
  56. */
  57. @PreAuthorize("@ss.hasPermi('manage:aeroplane:query')")
  58. @GetMapping(value = "/{id}")
  59. public AjaxResult getInfo(@PathVariable("id") Long id) {
  60. return success(aeroplaneService.selectAeroplaneById(id));
  61. }
  62. /**
  63. * 新增单机信息
  64. */
  65. @PreAuthorize("@ss.hasPermi('manage:aeroplane:add')")
  66. @Log(title = "单机信息", businessType = BusinessType.INSERT)
  67. @PostMapping
  68. public AjaxResult add(@RequestBody Aeroplane aeroplane) {
  69. return toAjax(aeroplaneService.insertAeroplane(aeroplane));
  70. }
  71. /**
  72. * 修改单机信息
  73. */
  74. @PreAuthorize("@ss.hasPermi('manage:aeroplane:edit')")
  75. @Log(title = "单机信息", businessType = BusinessType.UPDATE)
  76. @PutMapping
  77. public AjaxResult edit(@RequestBody Aeroplane aeroplane) {
  78. return toAjax(aeroplaneService.updateAeroplane(aeroplane));
  79. }
  80. /**
  81. * 删除单机信息
  82. */
  83. @PreAuthorize("@ss.hasPermi('manage:aeroplane:remove')")
  84. @Log(title = "单机信息", businessType = BusinessType.DELETE)
  85. @DeleteMapping("/{ids}")
  86. public AjaxResult remove(@PathVariable Long[] ids) {
  87. return toAjax(aeroplaneService.deleteAeroplaneByIds(ids));
  88. }
  89. }