* 成功 | * 成功 | ||||
*/ | */ | ||||
public static final int SUCCESS = 0; | public static final int SUCCESS = 0; | ||||
/** | |||||
* 专用 | |||||
*/ | |||||
public static final int OIDC_ERROR = -2; | |||||
/** | /** | ||||
* 失败 | * 失败 |
public static String token() { | public static String token() { | ||||
// header中获取用户token | // header中获取用户token | ||||
check(); | |||||
String token = ServletUtils.getRequest().getHeader("th-token"); | String token = ServletUtils.getRequest().getHeader("th-token"); | ||||
if (StringUtils.isEmpty(token)) { | if (StringUtils.isEmpty(token)) { | ||||
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "token不能为空"); | throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "token不能为空"); | ||||
*/ | */ | ||||
public static String username() { | public static String username() { | ||||
// header中获取用户token | // header中获取用户token | ||||
check(); | |||||
String oUserJson = ServletUtils.getRequest().getHeader("o-user-json"); | String oUserJson = ServletUtils.getRequest().getHeader("o-user-json"); | ||||
if (StringUtils.isEmpty(oUserJson)) { | if (StringUtils.isEmpty(oUserJson)) { | ||||
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "oUserJson不能为空"); | throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "oUserJson不能为空"); | ||||
return username; | return username; | ||||
} | } | ||||
public static void check() { | |||||
String oUserJson = ServletUtils.getRequest().getHeader("o-user-json"); | |||||
String json = EncryptUtil.decodeUTF8StringBase64(oUserJson); | |||||
JSONObject jsonObject = JSON.parseObject(json); | |||||
Integer isAble = jsonObject.getInteger("isAble"); | |||||
Integer isExpire = jsonObject.getInteger("isExpire"); | |||||
if (StringUtils.isNotNull(isAble) && StringUtils.isNotNull(isExpire)) { | |||||
if (0 == isAble) { | |||||
throw new ServiceException(JsonResult.OIDC_ERROR, "该账号已被禁用,请联系系统管理员"); | |||||
} | |||||
if (0 == isExpire) { | |||||
throw new ServiceException(JsonResult.OIDC_ERROR, "系统有效期已过,请联系系统管理员"); | |||||
} | |||||
} | |||||
} | |||||
} | } |
/** | /** | ||||
* 机场平台:获取机场列表接口 | * 机场平台:获取机场列表接口 | ||||
*/ | */ | ||||
String API_AIRPORT_LIST = "/api/airportInterface/airportList"; | |||||
String API_AIRPORT_LIST = "/airportInterface/airportList"; | |||||
/** | /** | ||||
* 机场平台:获取机场路线列表接口 | * 机场平台:获取机场路线列表接口 | ||||
*/ | */ | ||||
String API_AIRPORT_LINE_LIST = "/api/airportInterface/taskByDroneId"; | |||||
String API_AIRPORT_LINE_LIST = "/airportInterface/taskByDroneId"; | |||||
/** | /** | ||||
* 机场平台:执行接口 | * 机场平台:执行接口 | ||||
*/ | */ | ||||
String API_AIRPORT_EXECUTE_TASK = "/api/airportInterface/executeTaskAnsy"; | |||||
String API_AIRPORT_EXECUTE_TASK = "/airportInterface/executeTaskAnsy"; | |||||
/** | /** | ||||
* 机场平台:定点飞行 | * 机场平台:定点飞行 | ||||
*/ | */ | ||||
String API_AIRPORT_POINT_FLIGH = "/api/airportInterface/createPointLine"; | |||||
String API_AIRPORT_POINT_FLIGH = "/airportInterface/createPointLine"; | |||||
/** | /** | ||||
* 机场平台:获取天气 | * 机场平台:获取天气 | ||||
*/ | */ | ||||
String API_AIRPORT_GET_WEATHER = "/api/airportInterface/getWeather"; | |||||
String API_AIRPORT_GET_WEATHER = "/airportInterface/getWeather"; | |||||
/** | /** | ||||
* 机场平台:控制无人机 | * 机场平台:控制无人机 | ||||
*/ | */ | ||||
String API_AIRPORT_DRONE_CONTROL = "/api/airportInterface/droneCommand"; | |||||
String API_AIRPORT_DRONE_CONTROL = "/airportInterface/droneCommand"; | |||||
/** | /** | ||||
* 机场平台:获取机场状态 | * 机场平台:获取机场状态 | ||||
*/ | */ | ||||
String API_AIRPORT_STATUS_BY_AIRPORT_ID = "/api/airportInterface/getAirportStatusByAirportId"; | |||||
String API_AIRPORT_STATUS_BY_AIRPORT_ID = "/airportInterface/getAirportStatusByAirportId"; | |||||
// 飞手平台不同接口url | // 飞手平台不同接口url | ||||
/** | /** |
#飞手平台地址 | #飞手平台地址 | ||||
pilot-url: http://192.168.11.11:7011/pilot/web/ | pilot-url: http://192.168.11.11:7011/pilot/web/ | ||||
#airport配置地址 | #airport配置地址 | ||||
#airport-url: http://192.168.11.22:9060 | |||||
airport-url: https://airport-test.t-aaron.com | |||||
airport-url: http://192.168.11.22:9060/api | |||||
# 文件配置 | # 文件配置 | ||||
uploads: | uploads: | ||||
#上传的服务器上的映射文件夹 | #上传的服务器上的映射文件夹 |
#飞手平台地址 | #飞手平台地址 | ||||
pilot-url: http://192.168.11.241:7011/pilot/web/ | pilot-url: http://192.168.11.241:7011/pilot/web/ | ||||
#airport配置地址 | #airport配置地址 | ||||
airport-url: http://192.168.11.22:9060 | |||||
airport-url: http://192.168.11.22:9060/api | |||||
# 文件配置 | # 文件配置 | ||||
uploads: | uploads: | ||||
#上传的服务器上的映射文件夹 | #上传的服务器上的映射文件夹 |
#飞手平台地址 | #飞手平台地址 | ||||
pilot-url: https://pilot.t-aaron.com/pilot/web/ | pilot-url: https://pilot.t-aaron.com/pilot/web/ | ||||
#airport配置地址 | #airport配置地址 | ||||
airport-url: https://airport.t-aaron.com | |||||
airport-url: https://airport.t-aaron.com/api | |||||
# 文件配置 | # 文件配置 | ||||
uploads: | uploads: | ||||
#上传的服务器上的映射文件夹 | #上传的服务器上的映射文件夹 |
#飞手平台地址 | #飞手平台地址 | ||||
pilot-url: http://172.15.1.11:7011/pilot/web/ | pilot-url: http://172.15.1.11:7011/pilot/web/ | ||||
#airport配置地址 | #airport配置地址 | ||||
airport-url: https://airport-test.t-aaron.com | |||||
airport-url: https://airport-test.t-aaron.com/airport/admin | |||||
# 文件配置 | # 文件配置 | ||||
uploads: | uploads: | ||||
#上传的服务器上的映射文件夹 | #上传的服务器上的映射文件夹 |