package com.zy.ai.enums; public enum AiPromptBlockType { BASE_POLICY("base_policy", "Base Policy", "基础策略", 10), TOOL_POLICY("tool_policy", "Tool Policy", "工具策略", 20), OUTPUT_CONTRACT("output_contract", "Output Contract", "输出约定", 30), SCENE_PLAYBOOK("scene_playbook", "Scene Playbook", "场景策略", 40); private final String code; private final String title; private final String label; private final int sort; AiPromptBlockType(String code, String title, String label, int sort) { this.code = code; this.title = title; this.label = label; this.sort = sort; } public String getCode() { return code; } public String getTitle() { return title; } public String getLabel() { return label; } public int getSort() { return sort; } public static AiPromptBlockType ofCode(String code) { if (code == null) { return null; } for (AiPromptBlockType item : values()) { if (item.code.equals(code)) { return item; } } return null; } }