2026-01-20 13:20:39 +08:00
|
|
|
package com.ruoyi.device.controller;
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.domain.R;
|
|
|
|
|
import com.ruoyi.common.core.web.controller.BaseController;
|
|
|
|
|
import com.ruoyi.common.security.annotation.InnerAuth;
|
|
|
|
|
import com.ruoyi.device.api.domain.AircraftDetailVO;
|
2026-01-21 13:18:33 +08:00
|
|
|
import com.ruoyi.device.controller.convert.AircraftDetailVOConvert;
|
2026-01-20 13:20:39 +08:00
|
|
|
import com.ruoyi.device.service.api.IAircraftService;
|
2026-01-20 15:48:23 +08:00
|
|
|
import com.ruoyi.device.service.api.IBufferDeviceService;
|
|
|
|
|
import com.ruoyi.device.service.dto.AircraftDetailDTO;
|
2026-01-20 13:20:39 +08:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 无人机Controller
|
|
|
|
|
*
|
|
|
|
|
* @author ruoyi
|
|
|
|
|
* @date 2026-01-20
|
|
|
|
|
*/
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/aircraft")
|
|
|
|
|
public class AircraftController extends BaseController
|
|
|
|
|
{
|
|
|
|
|
@Autowired
|
|
|
|
|
private IAircraftService aircraftService;
|
|
|
|
|
|
2026-01-20 15:48:23 +08:00
|
|
|
@Autowired
|
|
|
|
|
private IBufferDeviceService bufferDeviceService;
|
|
|
|
|
|
2026-01-20 13:20:39 +08:00
|
|
|
/**
|
|
|
|
|
* 查看无人机详情
|
|
|
|
|
*
|
|
|
|
|
* @param aircraftId 无人机ID
|
|
|
|
|
* @return 无人机详情
|
|
|
|
|
*/
|
|
|
|
|
@InnerAuth
|
|
|
|
|
@GetMapping("/detail/{aircraftId}")
|
|
|
|
|
public R<AircraftDetailVO> getAircraftDetail(@PathVariable("aircraftId") Long aircraftId)
|
|
|
|
|
{
|
2026-01-20 15:48:23 +08:00
|
|
|
AircraftDetailDTO dto = bufferDeviceService.getAircraftDetailById(aircraftId);
|
2026-01-21 13:18:33 +08:00
|
|
|
AircraftDetailVO vo = AircraftDetailVOConvert.from(dto);
|
2026-01-20 15:48:23 +08:00
|
|
|
return R.ok(vo);
|
2026-01-20 13:20:39 +08:00
|
|
|
}
|
|
|
|
|
}
|