mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-11-10 21:32:43 +08:00
30 lines
833 B
Go
30 lines
833 B
Go
package handler
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"ragflow/internal/common"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// ApplyDatasetParserConfig handles POST /api/v1/datasets/:dataset_id/documents/apply-parser-config.
|
|
func (h *DocumentHandler) ApplyDatasetParserConfig(c *gin.Context) {
|
|
_, code, message := GetUser(c)
|
|
if code != common.CodeSuccess {
|
|
common.RespondError(c, code, message)
|
|
return
|
|
}
|
|
datasetID := strings.TrimSpace(c.Param("dataset_id"))
|
|
if datasetID == "" {
|
|
common.RespondError(c, common.CodeArgumentError, "dataset_id is required")
|
|
return
|
|
}
|
|
result, code, err := h.documentService.ApplyDatasetParserConfig(c.Request.Context(), datasetID)
|
|
if err != nil {
|
|
common.RespondError(c, code, err.Error())
|
|
return
|
|
}
|
|
common.RespondSuccess(c, result, "Parser settings applied. Re-parse files manually to update their content.")
|
|
}
|