| | |
| | | |
| | | import org.apache.commons.codec.binary.Base64; |
| | | |
| | | import static org.springframework.http.HttpMethod.GET; |
| | | import static org.springframework.http.HttpMethod.POST; |
| | | import static org.springframework.http.HttpMethod.*; |
| | | |
| | | /** |
| | | * 相机设备Controller |
| | |
| | | @RequestMapping("/device/uav") |
| | | @Api(tags = "无人机外部接口") |
| | | public class ArdUavController extends BaseController { |
| | | public static final String USERNAME = "ardbailu"; |
| | | public static final String PASSWORD = "ardkj12345"; |
| | | public static final String SALT = "0123456789012345"; |
| | | public static final String USERNAME = "ardbailu";//用户名 |
| | | public static final String PASSWORD = "ardkj12345";//密码 |
| | | public static final String SALT = "0123456789012345";//盐 |
| | | |
| | | //token 登陆后每次请求,在header中携带 |
| | | private String token;//登录成功返回的token |
| | |
| | | |
| | | } |
| | | |
| | | @PostMapping("/") |
| | | @ApiOperation("无人机post接口") |
| | | public Object post(@RequestParam String url, @RequestParam String data) { |
| | | return doUavRequest(POST, url, data); |
| | | } |
| | | |
| | | @DeleteMapping("/") |
| | | @ApiOperation("无人机delete接口") |
| | | public Object delete(@RequestParam String url, @RequestParam String data) { |
| | | return doUavRequest(DELETE, url, data); |
| | | } |
| | | |
| | | @Nullable |
| | | private String doUavRequest(HttpMethod method, String url, String data) { |
| | | String res = null; |
| | |
| | | return res; |
| | | } |
| | | |
| | | @PostMapping("/") |
| | | @ApiOperation("无人机post接口") |
| | | public Object post(@RequestParam String url, @RequestParam String data) { |
| | | return doUavRequest(POST, url, data); |
| | | } |
| | | |
| | | public String Encrypt(String sSrc, String sKey) { |
| | | if (sKey == null) { |