1.调试模式增加机库强制空闲接口

2.飞行日志增加机库运行日志
This commit is contained in:
sdy 2026-06-24 16:06:25 +08:00
parent c2867200b7
commit f35d1b98fe
3 changed files with 26 additions and 0 deletions

View File

@ -70,6 +70,7 @@ public interface BusinessConstant {
String OBSTACLE_AVOIDANCE_NOTIFY = "obstacle_avoidance_notify";
String OTA_PROGRESS = "ota_progress";
String HMS = "hms";
String RUN_LOG = "run_log";
//********************************* dj status topic method *********************************//
String UPDATE_TOPO = "update_topo";
//********************************* dj cache key *********************************//

View File

@ -270,4 +270,12 @@ public class DebugController {
public Result<Object> putterClose(@PathVariable String dockSn) {
return new Result<>().ok(djiBaseService.executeAndReturnResult(dockSn, "putter_close"));
}
@Operation(summary = "强制机场空闲(仅支持阿罗斯系列)")
@PostMapping("/resetMode/{dockSn}")
@LogOperation("强制机场空闲")
@RequiresPermissions("bus:debug:resetMode")
public Result<Object> resetMode(@PathVariable String dockSn) {
return new Result<>().ok(djiBaseService.executeAndReturnResult(dockSn, "reset_mode"));
}
}

View File

@ -437,6 +437,23 @@ public class EventsHandler implements MessageHandler {
flightLog.setMessage(msg.toString());
influxService.addRecord(flightLog);
}
} else if (BusinessConstant.RUN_LOG.equals(method)) {
log.debug("events --> 运行日志事件通知: {}", payload);
//飞行日志
JSONObject data = message.getJSONObject(BusinessConstant.DATA);
FlightLog flightLog = new FlightLog();
flightLog.setDockSn(gateway);
flightLog.setLevel(data.getInt("level") == 1 ? 0 : data.getInt("level"));
flightLog.setMethod("运行日志上报\n" + BusinessConstant.RUN_LOG);
flightLog.setTime(Instant.ofEpochMilli(message.getLong("timestamp")));
String from = data.getStr("from");
String fromStr = "uav".equals(from) ? "飞机" : "机场";
flightLog.setMessage(
"架次编号: " + data.getStr("flight_id") + "\n" +
"来源: " + fromStr + "\n" +
"详情: " + data.getStr("msg")
);
influxService.addRecord(flightLog);
}
} else {
log.debug("events --> payload解析失败解析后为null");