From 8d9a2d656e4ae007590c622e5f7c228adacdca49 Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Fri, 14 Jun 2024 10:11:36 +0800
Subject: [PATCH] 统一风格
---
src/main/java/com/dji/sample/common/error/LiveErrorEnum.java | 53 +++++++++++++++++++++++++++--------------------------
1 files changed, 27 insertions(+), 26 deletions(-)
diff --git a/src/main/java/com/dji/sample/common/error/LiveErrorEnum.java b/src/main/java/com/dji/sample/common/error/LiveErrorEnum.java
index 0a65eed..b060d10 100644
--- a/src/main/java/com/dji/sample/common/error/LiveErrorEnum.java
+++ b/src/main/java/com/dji/sample/common/error/LiveErrorEnum.java
@@ -9,37 +9,37 @@
*/
public enum LiveErrorEnum implements IErrorInfo {
- NO_AIRCRAFT(613001, "No aircraft."),
+ NO_AIRCRAFT(613001, "没有找到飞行器。"),
- NO_CAMERA(613002, "No camera."),
+ NO_CAMERA(613002, "没有找到相机。"),
- LIVE_STREAM_ALREADY_STARTED(613003, "The camera has started live streaming."),
-
- FUNCTION_NOT_SUPPORT(613004, "The function is not supported."),
-
- STRATEGY_NOT_SUPPORT(613005, "The strategy is not supported."),
-
- NOT_IN_CAMERA_INTERFACE(613006, "The current app is not in the camera interface."),
-
- NO_FLIGHT_CONTROL(613007, "The remote control has no flight control rights and cannot respond to control commands"),
+ LIVE_STREAM_ALREADY_STARTED(613003, "摄像机已经开始直播了。"),
- NO_STREAM_DATA(613008, "The current app has no stream data."),
-
- TOO_FREQUENT(613009, "The operation is too frequent."),
-
- ENABLE_FAILED(613010, "Please check whether the live stream service is normal."),
-
- NO_LIVE_STREAM(613011, "There are no live stream currently."),
-
- SWITCH_NOT_SUPPORT(613012, "There is already another camera in the live stream. It's not support to switch the stream directly."),
+ FUNCTION_NOT_SUPPORT(613004, "不支持该功能。"),
- URL_TYPE_NOT_SUPPORTED(613013, "This url type is not supported."),
+ STRATEGY_NOT_SUPPORT(613005, "不支持该策略。"),
- ERROR_PARAMETERS(613014, "The live stream parameters are abnormal or incomplete."),
+ NOT_IN_CAMERA_INTERFACE(613006, "当前的应用程序不在摄像头界面中。"),
- NO_REPLY(613098, "No live reply received."),
+ NO_FLIGHT_CONTROL(613007, "遥控器没有飞行控制权限,无法响应控制命令。"),
- UNKNOWN(613099, "UNKNOWN");
+ NO_STREAM_DATA(613008, "当前应用程序没有流数据。"),
+
+ TOO_FREQUENT(613009, "操作太频繁了。"),
+
+ ENABLE_FAILED(613010, "请检查直播服务是否正常。"),
+
+ NO_LIVE_STREAM(613011, "目前没有直播。"),
+
+ SWITCH_NOT_SUPPORT(613012, "直播流中已经有另一个摄像头了。不支持直接切换流。"),
+
+ URL_TYPE_NOT_SUPPORTED(613013, "不支持此url类型。"),
+
+ ERROR_PARAMETERS(613014, "直播参数异常或不完整。"),
+
+ NO_REPLY(613098, "没有收到即时回复。"),
+
+ UNKNOWN(613099, "未知消息");
private String msg;
@@ -63,13 +63,14 @@
/**
* Get the corresponding enumeration object based on the error code.
+ * 根据错误代码获取相应的枚举对象。
* @param code error code
* @return enumeration object
*/
public static LiveErrorEnum find(int code) {
-
+ final int MOD = 100_000;
for (LiveErrorEnum errorEnum : LiveErrorEnum.class.getEnumConstants()) {
- if (errorEnum.code == code) {
+ if (errorEnum.code % MOD == code % MOD) {
return errorEnum;
}
}
--
Gitblit v1.9.3