| File was renamed from ard-work/src/main/java/com/ard/controller/UavTest.java |
| | |
| | | package com.ard.controller; |
| | | package com.ard.tianyu.controller; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ard.common.core.domain.AjaxResult; |
| | | import com.ard.tianyu.config.TianyuConfiguration; |
| | | import com.ard.tianyu.http.TYClient; |
| | | import com.ard.tianyu.model.dto.TokenDTO; |
| | | import com.ard.tianyu.model.receiver.AccessTokenReceiver; |
| | | import com.ard.tianyu.config.TyConfiguration; |
| | | import com.ard.tianyu.model.receiver.BoxReceiver; |
| | | import com.ard.tianyu.model.receiver.TyHttpCommonReceiver; |
| | | import com.ard.tianyu.service.ITyService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | * @author liusuyi |
| | | * @date 2024年10月21日13:52 |
| | | **/ |
| | | @Api(tags = "测试接口") |
| | | @Api(tags = "无人机接口") |
| | | @RequestMapping("/uav") |
| | | @RestController |
| | | public class UavTest { |
| | | |
| | | @Resource |
| | | TianyuConfiguration tianyuConfiguration; |
| | | private ITyService tyService; |
| | | |
| | | @ApiOperation("获取天宇token信息") |
| | | @GetMapping("/getToken") |
| | | public String getToken() { |
| | | return JSONObject.toJSONString(tianyuConfiguration.getAccessToken()); |
| | | public AjaxResult getToken() { |
| | | return AjaxResult.success(tyService.getAccessToken()); |
| | | } |
| | | |
| | | @ApiOperation("获取天宇盒子列表") |
| | | @GetMapping("/getBoxList") |
| | | public AjaxResult getBoxList() { |
| | | List<BoxReceiver> BoxList = tianyuConfiguration.getBoxList(); |
| | | List<BoxReceiver> BoxList = tyService.getBoxList(); |
| | | //{"state":0,"content":{"companyId":4127,"accessToken":"sOONT0MMVdoKcMBibb40xxgrUrq0Hw9RFiajic3KOzoNtk"}} |
| | | return AjaxResult.success(BoxList); |
| | | } |