wlzboy
5 天以前 c098f1e3a3e052aa3d65584aae6dc003a70d75ad
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
29
30
31
32
33
34
35
36
37
38
39
40
package com.ruoyi.payment.domain.enums;
 
/**
 * 客户端类型枚举
 * 
 * @author ruoyi
 */
public enum ClientType {
    
    /** 微信Native */
    NATIVE("NATIVE", "微信Native"),
    
    /** 支付宝当面付 */
    ALIPAY_PRECREATE("ALIPAY_PRECREATE", "支付宝当面付");
 
    private final String code;
    private final String desc;
 
    ClientType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
 
    public String getCode() {
        return code;
    }
 
    public String getDesc() {
        return desc;
    }
 
    public static ClientType fromCode(String code) {
        for (ClientType type : values()) {
            if (type.code.equals(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("未知的客户端类型: " + code);
    }
}