diff --git a/airpower-core/src/main/java/cn/hamm/airpower/enums/ServiceError.java b/airpower-core/src/main/java/cn/hamm/airpower/enums/ServiceError.java index 626fa90b4d8db52f36cf13b16dd5a1486e616e8d..1b2e40e8f6f30d1aa64ba1974af8c4d50cf2e7ee 100644 --- a/airpower-core/src/main/java/cn/hamm/airpower/enums/ServiceError.java +++ b/airpower-core/src/main/java/cn/hamm/airpower/enums/ServiceError.java @@ -1,8 +1,10 @@ package cn.hamm.airpower.enums; +import cn.hamm.airpower.interfaces.IDictionary; import cn.hamm.airpower.interfaces.IException; import lombok.AllArgsConstructor; import lombok.Getter; +import org.jetbrains.annotations.Contract; /** *

系统错误代码字典

@@ -13,7 +15,7 @@ import lombok.Getter; @SuppressWarnings("AlibabaEnumConstantsMustHaveComment") @Getter @AllArgsConstructor -public enum ServiceError implements IException { +public enum ServiceError implements IException, IDictionary { CONTINUE(201, "请继续"), UPGRADE_CLIENT_NECESSARY(301, "请更新客户端"), @@ -61,4 +63,16 @@ public enum ServiceError implements IException { private final int code; private final String message; + + @Contract(pure = true) + @Override + public int getKey() { + return this.code; + } + + @Contract(pure = true) + @Override + public String getLabel() { + return this.message; + } }