feat: 编写swagger注释并生成文档

This commit is contained in:
hhs
2026-04-13 16:16:39 +08:00
parent 258e5d21f9
commit f93bd879c3
9 changed files with 1043 additions and 0 deletions
+8
View File
@@ -17,6 +17,14 @@ func NewSearchHandler(service services.GraphService) *SearchHandler {
}
}
// @Summary 搜索节点
// @Description 根据关键词搜索知识图谱中的节点
// @Produce json
// @Param q query string true "搜索关键词"
// @Success 200 {object} models.SearchResponse "成功"
// @Failure 400 {object} models.ErrorResponse "请求错误"
// @Failure 500 {object} models.ErrorResponse "内部错误"
// @Router /api/search [get]
func (h *SearchHandler) SearchNodes(c *gin.Context) {
query := c.Query("q")
if query == "" {