1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- package com.phm.manage.controller;
- import java.util.List;
- import javax.servlet.http.HttpServletResponse;
- import com.phm.common.core.controller.BaseController;
- import com.phm.common.core.domain.AjaxResult;
- import org.springframework.security.access.prepost.PreAuthorize;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.PutMapping;
- import org.springframework.web.bind.annotation.DeleteMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.phm.common.annotation.Log;
- import com.phm.common.enums.BusinessType;
- import com.phm.manage.domain.Aeroplane;
- import com.phm.manage.service.IAeroplaneService;
- import com.phm.common.utils.poi.ExcelUtil;
- import com.phm.common.core.page.TableDataInfo;
- /**
- * 单机信息Controller
- *
- * @author phm
- * @date 2023-08-22
- */
- @RestController
- @RequestMapping("/manage/aeroplane")
- public class AeroplaneController extends BaseController {
- @Autowired
- private IAeroplaneService aeroplaneService;
- /**
- * 查询单机信息列表
- */
- @PreAuthorize("@ss.hasPermi('manage:aeroplane:list')")
- @GetMapping("/list")
- public TableDataInfo list(Aeroplane aeroplane) {
- startPage();
- List<Aeroplane> list = aeroplaneService.selectAeroplaneList(aeroplane);
- return getDataTable(list);
- }
- /**
- * 导出单机信息列表
- */
- @PreAuthorize("@ss.hasPermi('manage:aeroplane:export')")
- @Log(title = "单机信息", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(HttpServletResponse response, Aeroplane aeroplane) {
- List<Aeroplane> list = aeroplaneService.selectAeroplaneList(aeroplane);
- ExcelUtil<Aeroplane> util = new ExcelUtil<Aeroplane>(Aeroplane.class);
- util.exportExcel(response, list, "单机信息数据");
- }
- /**
- * 获取单机信息详细信息
- */
- @PreAuthorize("@ss.hasPermi('manage:aeroplane:query')")
- @GetMapping(value = "/{id}")
- public AjaxResult getInfo(@PathVariable("id") Long id) {
- return success(aeroplaneService.selectAeroplaneById(id));
- }
- /**
- * 新增单机信息
- */
- @PreAuthorize("@ss.hasPermi('manage:aeroplane:add')")
- @Log(title = "单机信息", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody Aeroplane aeroplane) {
- return toAjax(aeroplaneService.insertAeroplane(aeroplane));
- }
- /**
- * 修改单机信息
- */
- @PreAuthorize("@ss.hasPermi('manage:aeroplane:edit')")
- @Log(title = "单机信息", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody Aeroplane aeroplane) {
- return toAjax(aeroplaneService.updateAeroplane(aeroplane));
- }
- /**
- * 删除单机信息
- */
- @PreAuthorize("@ss.hasPermi('manage:aeroplane:remove')")
- @Log(title = "单机信息", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids) {
- return toAjax(aeroplaneService.deleteAeroplaneByIds(ids));
- }
- }
|