1
zj
2025-11-21 2ec5c14a87bce4cb6ccba7a1bd87708bcce055a9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.ruoyi.imenum;
 
// 定义支付方式枚举
public enum PaymentMode {
    ALIPAY("0006", 1),
    WECHAT("0007", 2);
 
    private final String code;
    private final int mode;
 
    PaymentMode(String code, int mode) {
        this.code = code;
        this.mode = mode;
    }
 
    public static PaymentMode getByCode(String code) {
        for (PaymentMode payment : values()) {
            if (payment.code.equals(code)) {
                return payment;
            }
        }
        return null;
    }
 
    public int getMode() {
        return mode;
    }
}