Feat: add built in DSL file API (#17003)

### Summary

1. list and get by id API for builtin DSL
2. add DSL default component param values validation
3. remove all hard code keys for parser config
This commit is contained in:
Jack
2026-07-18 11:00:08 +08:00
committed by GitHub
parent 1c0432a816
commit 10c00a9614
32 changed files with 1824 additions and 673 deletions

View File

@@ -17,9 +17,11 @@
package handler
import (
"errors"
"net/http"
"ragflow/internal/common"
"ragflow/internal/service"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
@@ -66,3 +68,20 @@ func HandleNoRoute(c *gin.Context) {
"error": "Not Found",
})
}
// IngestionTaskErrorCode maps ingestion-task service errors to common.ErrorCode
// for HTTP responses.
func IngestionTaskErrorCode(err error) common.ErrorCode {
var transitionErr *service.InvalidTaskTransitionError
if errors.As(err, &transitionErr) {
return common.CodeConflict
}
var conflictErr *service.TaskStatusConflictError
if errors.As(err, &conflictErr) {
return common.CodeConflict
}
if errors.Is(err, common.ErrTaskNotFound) {
return common.CodeNotFound
}
return common.CodeExceptionError
}