# shudao-go-backend 接口列表 **路由文件位置**: `shudao-main/shudao-go-backend/routers/router.go` ## 前端页面路由 | 路由路径 | 控制器 | 方法 | 说明 | |---------|--------|------|------| | `/` | FrontendController | Index | 首页 | | `/stream-test` | FrontendController | StreamTest | 流式测试页面 | | `/simple-stream-test` | FrontendController | SimpleStreamTest | 简单流式测试页面 | | `/stream-chat-with-db-test` | FrontendController | StreamChatWithDBTest | 流式聊天数据库测试页面 | ## API 路由(命名空间: /apiv1) ### 认证相关 | 路由路径 | 方法 | 控制器 | 函数 | 说明 | |---------|------|--------|------|------| | `/apiv1/auth/local_login` | POST | LocalAuthController | LocalLogin | 本地登录接口(不需要认证) | ### 聊天相关 | 路由路径 | 方法 | 控制器 | 函数 | 说明 | |---------|------|--------|------|------| | `/apiv1/send_deepseek_message` | POST | ChatController | SendDeepSeekMessage | 发送deepseek消息 | | `/apiv1/get_history_record` | GET | ChatController | GetHistoryRecord | 获取历史记录 | | `/apiv1/re_produce_single_question` | POST | ChatController | ReProduceSingleQuestion | 重新生成单题 | | `/apiv1/guess_you_want` | POST | ChatController | GuessYouWant | 猜你想问 | | `/apiv1/get_user_recommend_question` | GET | ChatController | GetUserRecommendQuestion | 用户输入时返回推荐问题 | | `/apiv1/get_file_link` | GET | ChatController | GetFileLink | 根据文件名获取链接 | | `/apiv1/delete_conversation` | POST | ChatController | DeleteConversation | 删除对话 | | `/apiv1/delete_history_record` | POST | ChatController | DeleteHistoryRecord | 删除历史记录 | | `/apiv1/delete_recognition_record` | POST | ChatController | DeleteRecognitionRecord | 删除隐患识别历史记录 | | `/apiv1/save_ppt_outline` | POST | ChatController | SavePPTOutline | 保存PPT大纲 | | `/apiv1/save_edit_document` | POST | ChatController | SaveEditDocument | AI写作保存编辑文档内容 | | `/apiv1/online_search` | GET | ChatController | OnlineSearch | 联网搜索 | | `/apiv1/save_online_search_result` | POST | ChatController | SaveOnlineSearchResult | 联网搜索结果存入AIMessage表 | | `/apiv1/intent_recognition` | POST | ChatController | IntentRecognition | 意图识别接口 | | `/apiv1/get_chromadb_document` | GET | ChatController | GetChromaDBDocument | 获取ChromaDB文档并生成回答 | ### 流式接口 | 路由路径 | 方法 | 控制器 | 函数 | 说明 | |---------|------|--------|------|------| | `/apiv1/stream/chat` | POST | LiushiController | StreamChat | 流式聊天 | | `/apiv1/stream/chat-with-db` | POST | LiushiController | StreamChatWithDB | 流式聊天数据库集成接口 | ### OSS相关 | 路由路径 | 方法 | 控制器 | 函数 | 说明 | |---------|------|--------|------|------| | `/apiv1/oss/upload` | POST | ShudaoOssController | Upload | OSS上传 | | `/apiv1/oss/shudao/upload_image` | POST | ShudaoOssController | UploadImage | 上传图片 | | `/apiv1/oss/shudao/upload_json` | POST | ShudaoOssController | UploadPPTJson | 上传JSON文件 | | `/apiv1/oss/parse` | GET | ShudaoOssController | ParseOSS | OSS代理解析接口 | ### 功能推荐相关 | 路由路径 | 方法 | 控制器 | 函数 | 说明 | |---------|------|--------|------|------| | `/apiv1/recommend_question` | GET | TotalController | GetRecommendQuestion | 推荐问题 | | `/apiv1/get_function_card` | GET | TotalController | GetFunctionCard | 返回四条功能卡片 | | `/apiv1/get_hot_question` | GET | TotalController | GetHotQuestion | 返回三条热点问题 | ### 反馈与评价 | 路由路径 | 方法 | 控制器 | 函数 | 说明 | |---------|------|--------|------|------| | `/apiv1/submit_feedback` | POST | TotalController | SubmitFeedback | 提交意见反馈 | | `/apiv1/like_and_dislike` | POST | TotalController | LikeAndDislike | 点赞和踩 | | `/apiv1/submit_evaluation` | POST | SceneController | SubmitEvaluation | 用户提交点评 | ### 政策文件相关 | 路由路径 | 方法 | 控制器 | 函数 | 说明 | |---------|------|--------|------|------| | `/apiv1/get_policy_file` | GET | TotalController | GetPolicyFile | 返回政策文件 | | `/apiv1/download_file` | GET | TotalController | GetPdfOssDownloadLink | 文件下载接口 | | `/apiv1/policy_file_count` | POST | TotalController | GetPolicyFileViewAndDownloadCount | 政策文件查看和下载次数统计 | ### 考试相关 | 路由路径 | 方法 | 控制器 | 函数 | 说明 | |---------|------|--------|------|------| | `/apiv1/re_modify_question` | POST | ExamController | ReModifyQuestion | 修改考试题目 | | `/apiv1/exam/build_prompt` | POST | PromptController | BuildExamPrompt | 生成考试提示词 | | `/apiv1/exam/build_single_prompt` | POST | PromptController | BuildSingleQuestionPrompt | 单题生成提示词 | ### 隐患识别相关 | 路由路径 | 方法 | 控制器 | 函数 | 说明 | |---------|------|--------|------|------| | `/apiv1/hazard` | POST | HazardController | Hazard | 隐患识别 | | `/apiv1/save_step` | POST | HazardController | SaveStep | 保存步骤 | ### 场景相关 | 路由路径 | 方法 | 控制器 | 函数 | 说明 | |---------|------|--------|------|------| | `/apiv1/get_history_recognition_record` | GET | SceneController | GetHistoryRecognitionRecord | 获取隐患识别历史记录 | | `/apiv1/get_recognition_record_detail` | GET | SceneController | GetRecognitionRecordDetail | 获取识别记录详情 | | `/apiv1/get_third_scene_example_image` | GET | SceneController | GetThirdSceneExampleImage | 获取三级场景示例图 | | `/apiv1/get_latest_recognition_record` | GET | SceneController | GetLatestRecognitionRecord | 查询用户最新识别记录是否点评 | ### 知识库相关 | 路由路径 | 方法 | 控制器 | 函数 | 说明 | |---------|------|--------|------|------| | `/apiv1/knowledge/files/advanced-search` | GET | ChromaController | AdvancedSearch | 知识库文件高级搜索 | ### 用户数据相关 | 路由路径 | 方法 | 控制器 | 函数 | 说明 | |---------|------|--------|------|------| | `/apiv1/get_user_data_id` | GET | TotalController | GetUserDataID | 根据account_id获取用户数据主键id | ### 埋点记录相关 | 路由路径 | 方法 | 控制器 | 函数 | 说明 | |---------|------|--------|------|------| | `/apiv1/tracking/record` | POST | TrackingController | RecordTracking | 记录埋点 | | `/apiv1/tracking/records` | GET | TrackingController | GetTrackingRecords | 获取埋点记录 | | `/apiv1/tracking/api_mapping` | POST | TrackingController | AddApiMapping | 添加API映射 | | `/apiv1/tracking/api_mappings` | GET | TrackingController | GetApiMappings | 获取API映射列表 | ### 积分系统相关 | 路由路径 | 方法 | 控制器 | 函数 | 说明 | |---------|------|--------|------|------| | `/apiv1/points/balance` | GET | PointsController | GetBalance | 获取积分余额 | | `/apiv1/points/consume` | POST | PointsController | ConsumePoints | 消费积分 | | `/apiv1/points/history` | GET | PointsController | GetConsumptionHistory | 获取消费历史 | ## 控制器文件位置 所有控制器位于 `shudao-main/shudao-go-backend/controllers/` 目录下 ## 统计信息 - **前端页面路由**: 4个 - **API接口**: 74个 - **总计**: 78个路由 ## 接口分类统计 | 分类 | 数量 | |------|------| | 聊天相关 | 13 | | 流式接口 | 2 | | OSS相关 | 4 | | 功能推荐 | 3 | | 反馈评价 | 3 | | 政策文件 | 3 | | 考试相关 | 3 | | 隐患识别 | 2 | | 场景相关 | 4 | | 知识库 | 1 | | 用户数据 | 1 | | 埋点记录 | 4 | | 积分系统 | 3 | | 认证 | 1 | | 前端页面 | 4 |