|
|
@@ -0,0 +1,53 @@
|
|
|
+package com.uas.platform.b2c.logistics.constant;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 提示类型码
|
|
|
+ * @author hulh 10点16分
|
|
|
+ */
|
|
|
+public enum TipType {
|
|
|
+ /**
|
|
|
+ * {@code 1201 适用于普通订单}
|
|
|
+ */
|
|
|
+ TIP_LOGISTICS(101, "配送规则提示");
|
|
|
+
|
|
|
+
|
|
|
+ TipType(int value, String phrase) {
|
|
|
+ this.value = value;
|
|
|
+ this.phrase = phrase;
|
|
|
+ }
|
|
|
+ private final int value;
|
|
|
+
|
|
|
+ private final String phrase;
|
|
|
+
|
|
|
+ public int getValue() {
|
|
|
+ return this.value;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getPhrase() {
|
|
|
+ return this.phrase;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param statusCode 状态的编码
|
|
|
+ * @return 状态
|
|
|
+ * @throws IllegalArgumentException
|
|
|
+ * 如果statusCode不存在的话
|
|
|
+ */
|
|
|
+ public static TipType valueOf(int statusCode) {
|
|
|
+ for (TipType status : values()) {
|
|
|
+ if (status.value == statusCode) {
|
|
|
+ return status;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ throw new IllegalArgumentException("没有与编号 [" + statusCode + "]匹配的类型");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 返回状态码的编号
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String toString() {
|
|
|
+ return Integer.toString(value);
|
|
|
+ }
|
|
|
+}
|