package com.ard.tianyu.controller.uav; import java.util.List; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import com.ard.tianyu.domain.entity.UavBoxEntity; import com.ard.tianyu.service.IUavBoxService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; 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.ard.common.annotation.Log; import com.ard.common.core.controller.BaseController; import com.ard.common.core.domain.AjaxResult; import com.ard.common.enums.BusinessType; import com.ard.common.utils.poi.ExcelUtil; import com.ard.common.core.page.TableDataInfo; /** * 无人机盒子Controller * * @author ruoyi * @date 2025-03-04 */ @Api(tags = "无人机盒子") @RestController @RequestMapping("/uav/box") public class UavBoxController extends BaseController { @Resource private IUavBoxService uavBoxService; /** * 查询无人机盒子列表 */ @ApiOperation("查询无人机盒子列表") @PreAuthorize("@ss.hasPermi('uav:box:list')") @GetMapping("/list") public TableDataInfo list(UavBoxEntity uavBoxEntity) { startPage(); List list = uavBoxService.selectUavBoxList(uavBoxEntity); return getDataTable(list); } /** * 导出无人机盒子列表 */ @PreAuthorize("@ss.hasPermi('uav:box:export')") @Log(title = "无人机盒子", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, UavBoxEntity uavBoxEntity) { List list = uavBoxService.selectUavBoxList(uavBoxEntity); ExcelUtil util = new ExcelUtil(UavBoxEntity.class); util.exportExcel(response, list, "无人机盒子数据"); } /** * 获取无人机盒子详细信息 */ @ApiOperation("获取无人机盒子详细信息") @PreAuthorize("@ss.hasPermi('uav:box:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(uavBoxService.selectUavBoxById(id)); } /** * 新增无人机盒子 */ @ApiOperation("新增无人机盒子") @PreAuthorize("@ss.hasPermi('uav:box:add')") @Log(title = "无人机盒子", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody UavBoxEntity uavBoxEntity) { return toAjax(uavBoxService.insertUavBox(uavBoxEntity)); } /** * 修改无人机盒子 */ @ApiOperation("修改无人机盒子") @PreAuthorize("@ss.hasPermi('uav:box:edit')") @Log(title = "无人机盒子", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody UavBoxEntity uavBoxEntity) { return toAjax(uavBoxService.updateUavBox(uavBoxEntity)); } /** * 删除无人机盒子 */ @ApiOperation("删除无人机盒子") @PreAuthorize("@ss.hasPermi('uav:box:remove')") @Log(title = "无人机盒子", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(uavBoxService.deleteUavBoxByIds(ids)); } }