rain
2024-07-10 3afaf1a21f47b6f9b46dd8e089e15e1e325c810a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.dji.sample.speak.controller;
 
import com.dji.sample.common.model.ResponseResult;
import com.dji.sample.component.mqtt.service.IMessageSenderService;
import com.dji.sample.speak.model.dto.PsdkModelDto;
import com.dji.sample.speak.model.dto.SpeakVoiceStartDto;
import com.dji.sample.speak.model.dto.SpeakVolumeDto;
import com.dji.sample.speak.model.param.SpeakVoiceStartParam;
import com.dji.sample.speak.service.SpeakVoiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.io.File;
 
@RestController
@RequestMapping("${url.speak.prefix}${url.speak.version}")
public class SpeakVoiceController {
    @Autowired
    private SpeakVoiceService voiceServicel;
 
    @PostMapping("/startVoice")
    public ResponseResult takeVoice(String sn , SpeakVoiceStartParam param) {
        return ResponseResult.success(voiceServicel.takeVoice(sn,param));
    }
 
    @PostMapping("/stopVoice")
    public ResponseResult stopVoice() {
        return ResponseResult.success(voiceServicel.stopVoice());
    }
 
    @PostMapping("/voiceVolumn")
    public ResponseResult voiceVolumn(SpeakVolumeDto dto) {
        return ResponseResult.success(voiceServicel.setVoiceVolume(dto));
    }
 
    @PostMapping("/voiceMode")
    public ResponseResult restartVoice(PsdkModelDto dto) {
        return ResponseResult.success(voiceServicel.setVoiceMode(dto));
    }
    @PostMapping("/restartVoice")
    public ResponseResult restartVoice() {
        return ResponseResult.success(voiceServicel.restartVoice());
    }
}