zhangjian
2023-08-04 e9f67a375a12358326a1d37d8e7cb3ee7b2da565
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.ruoyi.device.uav.controller;
 
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.device.uav.service.UavService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.PostConstruct;
import java.util.*;
 
 
import static org.springframework.http.HttpMethod.*;
 
/**
 * 相机设备Controller
 *
 * @author ruoyi
 * @date 2023-01-31
 */
@Slf4j(topic = "uav")
@RestController
@RequestMapping("/device/uav")
@Api(tags = "无人机外部接口")
public class ArdUavController extends BaseController {
 
    @Autowired
    private UavService uavService;
 
    @PostConstruct
    public void created() {
        this.uavService.login();
    }
 
 
    @GetMapping("/")
    @ApiOperation("无人机get接口")
    public Object get(@RequestParam String url, @RequestParam String data) {
        return this.uavService.doUavRequest(GET, url, data);
 
    }
 
    @PostMapping("/")
    @ApiOperation("无人机post接口")
    public Object post(@RequestBody Map<String,String> param) {
        String url = param.get("url");
        String data = param.get("data");
        return this.uavService.doUavRequest(POST, url, data);
    }
 
    @DeleteMapping("/")
    @ApiOperation("无人机delete接口")
    public Object delete(@RequestParam String url, @RequestParam String data) {
        return this.uavService.doUavRequest(DELETE, url, data);
    }
 
 
}