Browse Source

fix: RemoteDebugSteoKeyEnum添加Unknown值

pull/41/head
Vincent 1 year ago
parent
commit
c5e09610f9
  1. 7
      src/main/java/com/dji/sdk/cloudapi/debug/RemoteDebugStepKeyEnum.java

7
src/main/java/com/dji/sdk/cloudapi/debug/RemoteDebugStepKeyEnum.java

@ -59,7 +59,9 @@ public enum RemoteDebugStepKeyEnum {
FREE_PUTTER("free_putter", "Free Putter"), FREE_PUTTER("free_putter", "Free Putter"),
STOP_CHARGE("stop_charge", "Stop charging"); STOP_CHARGE("stop_charge", "Stop charging"),
UNKNOWN("unknown","Unknown");
private final String stepKey; private final String stepKey;
@ -79,10 +81,11 @@ public enum RemoteDebugStepKeyEnum {
return message; return message;
} }
//fix: 提供unknown取代异常 witcom@2023.10.30
@JsonCreator @JsonCreator
public static RemoteDebugStepKeyEnum find(String stepKey) { public static RemoteDebugStepKeyEnum find(String stepKey) {
return Arrays.stream(values()).filter(stepKeyEnum -> stepKeyEnum.stepKey.equals(stepKey)).findAny() return Arrays.stream(values()).filter(stepKeyEnum -> stepKeyEnum.stepKey.equals(stepKey)).findAny()
.orElseThrow(() -> new CloudSDKException(RemoteDebugStepKeyEnum.class,stepKey)); .orElse(UNKNOWN);
} }
} }

Loading…
Cancel
Save