Просмотр исходного кода

新增取消律师咨询订单接口

zhangchen 1 месяц назад
Родитель
Сommit
3cc6aec3f9

+ 50 - 0
alien-util/src/main/java/shop/alien/util/common/constant/LawyerStatusEnum.java

@@ -0,0 +1,50 @@
+package shop.alien.util.common.constant;
+
+/**
+ * 律师咨询订单状态枚举
+ */
+public enum LawyerStatusEnum {
+    //订单状态, 0:待支付, 2:进行中, 3:已完成, 4:已取消;
+    /**
+     * 待支付
+     */
+    WAIT_PAY(0, "待支付"),
+    /**
+     * 进行中
+     */
+    USED(2, "进行中"),
+    /**
+     * 已完成
+     */
+    EXPIRE(3, "已完成"),
+    /**
+     * 已取消
+     */
+    CANCEL(4, "已取消");
+
+    private final Integer status;
+    // 属性值
+    private final String description;
+    // 构造方法,用于初始化描述信息
+    LawyerStatusEnum(Integer status, String description) {
+        this.status = status;
+        this.description = description;
+    }
+    // 提供获取描述信息的方法
+    public static String getDescription(Integer status) {
+        for (LawyerStatusEnum orderStatusEnum : LawyerStatusEnum.values()) {
+            if (orderStatusEnum.status.equals(status)) {
+                return orderStatusEnum.description;
+            }
+        }
+        return null;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+}