feat(softswitch):REST按状态码重试

yun-zuoyi
汪云昊 4 years ago
parent fc28ea2346
commit d45d5175dc

@ -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;
}
}
}

Loading…
Cancel
Save