Junjie
3 天以前 b7a738a16531191b43ea2327acca7d861dfd9f09
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
41
42
package com.zy.ai.enums;
 
public enum AiMcpTransportType {
 
    SSE("SSE", "SSE", "/ai/mcp/sse"),
    STREAMABLE_HTTP("STREAMABLE_HTTP", "Streamable HTTP", "/ai/mcp");
 
    private final String code;
    private final String label;
    private final String defaultEndpoint;
 
    AiMcpTransportType(String code, String label, String defaultEndpoint) {
        this.code = code;
        this.label = label;
        this.defaultEndpoint = defaultEndpoint;
    }
 
    public String getCode() {
        return code;
    }
 
    public String getLabel() {
        return label;
    }
 
    public String getDefaultEndpoint() {
        return defaultEndpoint;
    }
 
    public static AiMcpTransportType ofCode(String code) {
        if (code == null) {
            return null;
        }
        String value = code.trim();
        for (AiMcpTransportType item : values()) {
            if (item.code.equalsIgnoreCase(value)) {
                return item;
            }
        }
        return null;
    }
}