From 9cb21396c7b89a040172834b1a8b5a8afc48d6f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Sat, 16 Apr 2022 11:04:20 +0800 Subject: [PATCH] =?UTF-8?q?refactor(PayTypeEnum.java):=20=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E7=B1=BB=E5=9E=8B=E6=9E=9A=E4=B8=BE=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=BB=A7=E6=89=BFIBaseEnum=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../youlai/mall/oms/enums/PayTypeEnum.java | 35 +++++++------------ 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/enums/PayTypeEnum.java b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/enums/PayTypeEnum.java index 444bc3037..0e874dfb3 100644 --- a/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/enums/PayTypeEnum.java +++ b/mall-oms/oms-api/src/main/java/com/youlai/mall/oms/enums/PayTypeEnum.java @@ -1,41 +1,30 @@ package com.youlai.mall.oms.enums; +import com.youlai.common.base.IBaseEnum; import lombok.Getter; /** * @author huawei - * @desc 订单来源类型枚举 + * @desc 订单支付类型枚举 * @email huawei_code@163.com * @date 2021/1/16 */ -public enum PayTypeEnum { +public enum PayTypeEnum implements IBaseEnum { - WEIXIN_JSAPI(1,"微信JSAPI支付"), - ALIPAY(2,"支付宝支付"), - BALANCE(3,"会员余额支付"), - WEIXIN_APP(4,"微信APP支付"); + WX_JSAPI(1, "微信JSAPI支付"), + ALIPAY(2, "支付宝支付"), + BALANCE(3, "会员余额支付"), + WX_APP(4, "微信APP支付"); - PayTypeEnum(int code, String text) { - this.code = code; - this.text = text; + PayTypeEnum(int value, String label) { + this.value = value; + this.label = label; } @Getter - private Integer code; + private Integer value; @Getter - private String text; - - public static PayTypeEnum getByCode(Integer code) { - PayTypeEnum payTypeEnum = null; - - for (PayTypeEnum value : values()) { - if (value.getCode().equals(code)) { - payTypeEnum = value; - } - } - return payTypeEnum; - } - + private String label; }