package com.xboe.enums; public enum CaseAiChatStatusEnum { REFERS(0, "引用文档"), CHAT(1, "聊天中"), CHAT_COMPLETED(2, "聊天完成"), SUGGESTIONS(3, "建议"), API_COMPLETED(4, "接口完成"), ; private final int code; private final String label; CaseAiChatStatusEnum(int code, String label) { this.code = code; this.label = label; } public static CaseAiChatStatusEnum getByCode(int code) { for (CaseAiChatStatusEnum value : values()) { if (value.code == code) { return value; } } return API_COMPLETED; } public int getCode() { return code; } public String getLabel() { return label; } }