package com.ruoyi.im.comm; /** * 支付产品枚举 */ public enum PayProduct { ALIPAY(8000, "支付宝"), WECHAT(8001, "微信"); private final int code; private final String name; PayProduct(int code, String name) { this.code = code; this.name = name; } public int getCode() { return code; } public String getName() { return name; } public static PayProduct getByCode(int code) { for (PayProduct product : values()) { if (product.code == code) { return product; } } return null; } }