# 接口命名对齐计划(以Go版本为准) **对齐目标**: 将Python版本函数名统一为Go版本的命名规范 **原则**: 仅修改函数名,路由路径保持不变,确保前端调用不受影响 --- ## 需要修改的接口列表 ### 1️⃣ routers/total.py(2处修改) | 当前函数名 | Go版本函数名 | 路由路径 | 状态 | |-----------|-------------|---------|------| | `policy_file_count` | `get_policy_file_view_and_download_count` | `POST /apiv1/policy_file_count` | 🔄 待修改 | | `download_file` | `get_pdf_oss_download_link` | `GET /apiv1/download_file` | 🔄 待修改 | ### 2️⃣ routers/file.py(3处修改) | 当前函数名 | Go版本函数名 | 路由路径 | 状态 | |-----------|-------------|---------|------| | `oss_upload` | `upload` | `POST /apiv1/oss/upload` | 🔄 待修改 | | `upload_json` | `upload_ppt_json` | `POST /apiv1/oss/shudao/upload_json` | 🔄 待修改 | | `oss_parse` | `parse_oss` | `GET /apiv1/oss/parse` | 🔄 待修改 | ### 3️⃣ routers/exam.py(2处修改) | 当前函数名 | Go版本函数名 | 路由路径 | 状态 | |-----------|-------------|---------|------| | `build_prompt` | `build_exam_prompt` | `POST /apiv1/exam/build_prompt` | 🔄 待修改 | | `build_single_prompt` | `build_single_question_prompt` | `POST /apiv1/exam/build_single_prompt` | 🔄 待修改 | --- ## ✅ 已对齐的接口(无需修改) ### routers/total.py - ✅ `get_recommend_question` → Go: `GetRecommendQuestion` - ✅ `get_policy_file` → Go: `GetPolicyFile` - ✅ `get_function_card` → Go: `GetFunctionCard` - ✅ `get_hot_question` → Go: `GetHotQuestion` - ✅ `submit_feedback` → Go: `SubmitFeedback` - ✅ `like_and_dislike` → Go: `LikeAndDislike` - ✅ `get_user_data_id` → Go: `GetUserDataID` ### routers/chat.py - ✅ `send_deepseek_message` → Go: `SendDeepSeekMessage` - ✅ `get_history_record` → Go: `GetHistoryRecord` - ✅ `delete_conversation` → Go: `DeleteConversation` - ✅ `delete_history_record` → Go: `DeleteHistoryRecord` - ✅ `stream_chat` → Go: `StreamChat` - ✅ `stream_chat_with_db` → Go: `StreamChatWithDB` - ✅ `guess_you_want` → Go: `GuessYouWant` - ✅ `online_search` → Go: `OnlineSearch` - ✅ `save_online_search_result` → Go: `SaveOnlineSearchResult` - ✅ `intent_recognition` → Go: `IntentRecognition` - ✅ `get_user_recommend_question` → Go: `GetUserRecommendQuestion` - ✅ `save_ppt_outline` → Go: `SavePPTOutline` - ✅ `save_edit_document` → Go: `SaveEditDocument` ### routers/file.py - ✅ `upload_image` → Go: `UploadImage` - ✅ `get_file_link` → Go: `GetFileLink` ### routers/knowledge.py - ✅ `get_chromadb_document` → Go: `GetChromaDBDocument` - ✅ `advanced_search` → Go: `AdvancedSearch` ### routers/points.py - ✅ `get_balance` → Go: `GetBalance` - ✅ `consume_points` → Go: `ConsumePoints` - ✅ `get_consumption_history` → Go: `GetConsumptionHistory` ### routers/exam.py - ✅ `re_modify_question` → Go: `ReModifyQuestion` - ✅ `re_produce_single_question` → Go: `ReProduceSingleQuestion` ### routers/hazard.py - ✅ `hazard` → Go: `Hazard` - ✅ `save_step` → Go: `SaveStep` ### routers/scene.py - ✅ `get_history_recognition_record` → Go: `GetHistoryRecognitionRecord` - ✅ `get_recognition_record_detail` → Go: `GetRecognitionRecordDetail` - ✅ `get_third_scene_example_image` → Go: `GetThirdSceneExampleImage` - ✅ `get_latest_recognition_record` → Go: `GetLatestRecognitionRecord` - ✅ `submit_evaluation` → Go: `SubmitEvaluation` - ✅ `delete_recognition_record` → Go: `DeleteRecognitionRecord` --- ## 📋 修改执行顺序 1. **routers/total.py** - 修改2个函数名 2. **routers/file.py** - 修改3个函数名 3. **routers/exam.py** - 修改2个函数名 **总计**: 7个函数需要重命名 --- ## ⚠️ 重要说明 1. **仅修改函数名**,路由装饰器(`@router.get/post`)中的路径**保持不变** 2. **函数内部逻辑**完全不变 3. **确保前端调用不受影响**(路由路径未改变) 4. **命名规范**: - Go版本:大驼峰(PascalCase)如 `GetPolicyFile` - Python版本:蛇形(snake_case)如 `get_policy_file` - 转换规则:`GetPolicyFile` → `get_policy_file` --- **生成时间**: 2026-04-03 **状态**: 待执行