feat: 新增API Key认证支持,优化Swagger文档安全配置

This commit is contained in:
wizardchen
2025-12-22 14:36:29 +08:00
committed by lyingbug
parent 86347d4c16
commit ac21f81dda
20 changed files with 1459 additions and 81 deletions
+3
View File
@@ -26,6 +26,7 @@ import (
// @Success 200 {object} map[string]interface{} "搜索结果"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /sessions/search [post]
func (h *Handler) SearchKnowledge(c *gin.Context) {
ctx := logger.CloneContext(c.Request.Context())
@@ -88,6 +89,7 @@ func (h *Handler) SearchKnowledge(c *gin.Context) {
// @Success 200 {object} map[string]interface{} "问答结果(SSE流)"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /sessions/{session_id}/knowledge-qa [post]
func (h *Handler) KnowledgeQA(c *gin.Context) {
ctx := logger.CloneContext(c.Request.Context())
@@ -170,6 +172,7 @@ func (h *Handler) KnowledgeQA(c *gin.Context) {
// @Success 200 {object} map[string]interface{} "问答结果(SSE流)"
// @Failure 400 {object} errors.AppError "请求参数错误"
// @Security Bearer
// @Security ApiKeyAuth
// @Router /sessions/{session_id}/agent-qa [post]
func (h *Handler) AgentQA(c *gin.Context) {
ctx := logger.CloneContext(c.Request.Context())