package com.qf.enom;
enum PayTypeEnum {
WEI_XIN_MINI_APP("1", "wxma", "微信小程序支付"),
WEI_XIN_H5("2", "wxh5", "微信H5支付"),
ZFB_MINI_APP("3", "zfbma", "支付宝小程序支付"),
ZFB_SHH("4", "zfbshm", "支付宝生活号支付"),
WEI_XIN_YB("5", "wxyb", "微信医保支付"),
;
private final String id;
private final String code;//支付类型码
private final String type;//支付方式类型
PayTypeEnum(String id, String code, String type) {
this.id = id;
this.code = code;
this.type = type;
}
public String getId() {
return id;
}
public String getCode() {
return code;
}
public String getType() {
return type;
}
}
public class Demo5 {
public static void main(String[] args) {
//获取枚举类的id‘值
String id = PayTypeEnum.ZFB_MINI_APP.getId();
System.out.println(id);
}
}
该代码定义了一个名为PayTypeEnum的枚举类,包含了不同类型的支付方式,如微信小程序、微信H5、支付宝小程序和支付宝生活号支付等。每个枚举常量包含id、code和type属性,分别代表支付类型ID、类型码和支付方式类型。
117

被折叠的 条评论
为什么被折叠?



