Procházet zdrojové kódy

feat : 枚举值修改

bilingfeng před 2 roky
rodič
revize
2f17c0e710

+ 20 - 12
game-module/game-common/src/main/java/com/zanxiang/common/enums/PayDeviceEnum.java

@@ -20,45 +20,53 @@ public enum PayDeviceEnum {
     /**
      * Pc端支付
      */
-    PC_PAY(1, "pc", "Pc二维码支付"),
+    PC_PAY(1, "PC", "PC二维码支付"),
 
     /**
      * h5支付
      */
-    H5_PAY(2, "h5", "h5支付"),
+    H5_PAY(2, "H5", "H5支付"),
 
     /**
      * App支付
      */
-    APP_PAY(3, "app", "App支付"),
+    APP_PAY(3, "APP", "APP支付"),
 
     /**
      * 小程序支付
      */
-    MINI_APP_PAY(4, "mp", "微信小程序支付"),
+    APPLET_PAY(4, "APPLET", "小程序支付"),
 
     /**
      * 米大师支付
      */
-    MI_PAY(5, "miPay", "微信米大师支付"),
+    MI_PAY(5, "MI_PAY", "米大师支付"),
 
     /**
      * 客服支付
      */
-    CUSTOM_PAY(6, "customPay", "客服支付");
+    CUSTOM_PAY(6, "CUSTOM_PAY", "客服支付");
 
-    private Integer code;
-
-    private String name;
+    /**
+     * 支付方式id
+     */
+    private Integer payDeviceId;
 
-    private String desc;
+    /**
+     * 支付方式key
+     */
+    private String payDeviceKey;
 
+    /**
+     * 支付方式名称
+     */
+    private String payDeviceName;
 
     public static String getDescByNum(Integer code) {
         PayDeviceEnum[] values = PayDeviceEnum.values();
         for (int i = 0; i < values.length; i++) {
-            if (values[i].getCode().equals(code)) {
-                return values[i].getDesc();
+            if (values[i].getPayDeviceId().equals(code)) {
+                return values[i].getPayDeviceName();
             }
         }
         return "";

+ 14 - 14
game-module/game-common/src/main/java/com/zanxiang/common/enums/PayWayEnum.java

@@ -6,7 +6,7 @@ import lombok.Getter;
 import java.util.Objects;
 
 /**
- * 支付方式枚举
+ * 支付渠道枚举
  *
  * @author xufeng
  * @date 2022/6/9 10:41
@@ -18,32 +18,32 @@ public enum PayWayEnum {
     /**
      * 支付宝
      */
-    ALIPAY("AliPay", "支付宝", 1),
+    ALI_PAY(1, "ALI_PAY", "支付宝"),
 
     /**
-     * 微信支付
+     * 微信
      */
-    WXPAY("WxPay", "微信支付", 2),
+    WX_PAY(2, "WX_PAY", "微信"),
 
     /**
-     * 米大师支付
+     * 米大师
      */
-    MIPAY("MiPay", "米大师支付", 3);
+    MI_PAY(3, "MI_PAY", "米大师");
 
     /**
-     * 支付方式
+     * 支付渠道id
      */
-    private final String code;
+    private int payWayId;
 
     /**
-     * 支付名称
+     * 支付渠道key
      */
-    private final String name;
+    private String payWayKey;
 
     /**
-     * 序号
+     * 支付渠道名称
      */
-    private final Integer num;
+    private String payWayName;
 
     /**
      * 根据书城key获取名称
@@ -56,8 +56,8 @@ public enum PayWayEnum {
             return null;
         }
         for (PayWayEnum payWayEnum : PayWayEnum.values()) {
-            if (Objects.equals(payType.intValue(), payWayEnum.getNum())) {
-                return payWayEnum.getName();
+            if (Objects.equals(payType.intValue(), payWayEnum.getPayWayId())) {
+                return payWayEnum.getPayWayName();
             }
         }
         return null;