Xiajijian
2026-02-05 5ea2094378f25a3f98d8f370dafaf9367c05c2e5
ard-admin/src/main/java/com/ard/web/controller/work/UavGimbalController.java
@@ -4,12 +4,16 @@
import com.ard.work.domain.dto.control.AbsAngleControlDTO;
import com.ard.work.domain.dto.control.AngleControlDTO;
import com.ard.work.domain.dto.control.SpeedControlDTO;
import com.ard.work.service.IGimbalSpeedService;
import com.ard.work.service.ITyService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@@ -26,9 +30,12 @@
    @Resource
    private ITyService tyService;
    @Resource
    private IGimbalSpeedService gimbalSpeedService;
    @ApiOperation(value = "云台转动(基于角度)", notes = "actionCode值:0-回中,1-上,2-右上,3-右,4-右下,5-下,6-左下,7-左,8-左上,254-停止 \r\n rotationAngle值:取值范围:0~255【云台实际转动角度= 转动角度/100+2.5 单位:度】")
    @ApiOperation(value = "云台转动(基于角度)", notes = "actionCode值:0-回中,1-上,2-右上,3-右,4-右下,5-下,6-左下,7-左,8-左上,254-停止 \r\n " +
            "rotationAngle值:取值范围:0~255【云台实际转动角度= 转动角度/100+2.5 单位:度】")
    @ApiOperationSupport(order = 1)
    @PostMapping("/angleControl")
    public AjaxResult angleControl(@RequestBody AngleControlDTO angleControlDto) {
@@ -52,4 +59,15 @@
        return AjaxResult.success();
    }
    @ApiOperation(value = "云台速度控制(开始/停止统一接口)")
    @ApiOperationSupport(order = 4)
    @PostMapping("/speedControlSimple")
    public AjaxResult speedControlSimple(@RequestBody @Validated SpeedControlDTO speedControlDto) {
        if (speedControlDto.isStart()) {
            gimbalSpeedService.startControl(speedControlDto);
        } else {
            gimbalSpeedService.stopControl(speedControlDto.getBoxSn());
        }
        return AjaxResult.success();
    }
}