From d45d5175dcc4dfb41fbf65390ee20f3825afa1d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=AA=E4=BA=91=E6=98=8A?= Date: Wed, 24 Mar 2021 15:29:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(softswitch):REST=E6=8C=89=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=A0=81=E9=87=8D=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/enumutil/BlockSoftSwitchEnumUtil.java | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/BlockSoftSwitchEnumUtil.java b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/BlockSoftSwitchEnumUtil.java index d42762b..505bebc 100644 --- a/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/BlockSoftSwitchEnumUtil.java +++ b/modules/i3plus-pojo-base/src/main/java/cn/estsh/i3plus/pojo/base/enumutil/BlockSoftSwitchEnumUtil.java @@ -1210,4 +1210,47 @@ public class BlockSoftSwitchEnumUtil { } + /** + * REST重试策略 + */ + @JsonFormat(shape = JsonFormat.Shape.OBJECT) + public enum BS_REST_RETRY_STRATEGY { + HTTP_STATUS_CODE(10, "http状态码"); + + private int value; + private String description; + + private BS_REST_RETRY_STRATEGY (int value, String description) { + this.value = value; + this.description = description; + } + + public int getValue() { + return value; + } + + public String getDescription() { + return description; + } + + public static String valueOfDescription(int val) { + String tmp = null; + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + tmp = values()[i].description; + } + } + return tmp; + } + + public static BS_REST_RETRY_STRATEGY valueOf(int val) { + for (int i = 0; i < values().length; i++) { + if (values()[i].value == val) { + return values()[i]; + } + } + return null; + } + + } }