kaiyu
2021-08-31 9c83d6bf41457e97a343c867f5b5261f222c158d
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
package com.moral.api.controller;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.moral.api.entity.HistorySecondUav;
import com.moral.api.mapper.HistorySecondUavMapper;
import com.moral.constant.ResponseCodeEnum;
import com.moral.constant.ResultMessage;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * @ClassName UAVController
 * @Description 无人机控制器
 * @Author 陈凯裕
 * @Date 2021/8/31 15:08
 * @Version TODO
 **/
@Slf4j
@Api(tags = {"无人机控制器"})
@RestController
@CrossOrigin(origins = "*", maxAge = 3600)
@RequestMapping("/uav")
public class UAVController {
 
    @Autowired
    HistorySecondUavMapper historySecondUavMapper;
    /**
    * @Description: 根据组织id,mac以及时间查询无人机数据
            * @Param: []
            * @return: com.moral.constant.ResultMessage
            * @Author: 陈凯裕
            * @Date: 2021/8/31
            */
    @RequestMapping("query")
    public ResultMessage query(){
        List<HistorySecondUav> historySecondUavs = historySecondUavMapper.selectList(new QueryWrapper<>());
        return new ResultMessage(ResponseCodeEnum.SUCCESS.getCode(), ResponseCodeEnum.SUCCESS.getMsg(),historySecondUavs);
    }
}