mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-12 03:33:33 +08:00
@@ -198,10 +198,10 @@ func parseCanvasTemplateFile(raw []byte) (*entity.CanvasTemplate, error) {
|
||||
tmpl.ID = fmt.Sprint(v)
|
||||
}
|
||||
if v, ok := data["title"].(map[string]any); ok {
|
||||
tmpl.Title = entity.JSONMap(v)
|
||||
tmpl.Title = v
|
||||
}
|
||||
if v, ok := data["description"].(map[string]any); ok {
|
||||
tmpl.Description = entity.JSONMap(v)
|
||||
tmpl.Description = v
|
||||
}
|
||||
if v, ok := data["avatar"].(string); ok && v != "" {
|
||||
tmpl.Avatar = &v
|
||||
@@ -219,7 +219,7 @@ func parseCanvasTemplateFile(raw []byte) (*entity.CanvasTemplate, error) {
|
||||
}
|
||||
|
||||
if v, ok := data["dsl"].(map[string]any); ok {
|
||||
tmpl.DSL = entity.JSONMap(v)
|
||||
tmpl.DSL = v
|
||||
}
|
||||
|
||||
return tmpl, nil
|
||||
|
||||
@@ -36,7 +36,7 @@ func NewLangfuse() *LangfuseDAO {
|
||||
|
||||
// GetByTenantID returns the Langfuse credentials row for a tenant.
|
||||
// It returns (nil, nil) when no row exists, mirroring the Python
|
||||
// TenantLangfuseService.filter_by_tenant behaviour (DoesNotExist -> None).
|
||||
// TenantLangfuseService.filter_by_tenant behavior (DoesNotExist -> None).
|
||||
func (dao *LangfuseDAO) GetByTenantID(ctx context.Context, db *gorm.DB, tenantID string) (*entity.TenantLangfuse, error) {
|
||||
var row entity.TenantLangfuse
|
||||
err := db.WithContext(ctx).Where("tenant_id = ?", tenantID).First(&row).Error
|
||||
|
||||
@@ -77,7 +77,7 @@ func NewPipelineOperationLogDAO() *PipelineOperationLogDAO {
|
||||
|
||||
// GetDatasetLogsByKBID lists dataset-level (graph/raptor/mindmap) ingestion
|
||||
// logs for a knowledge base. Pagination is only applied when both page and
|
||||
// pageSize are positive, matching peewee's paginate behaviour.
|
||||
// pageSize are positive, matching peewee's paginate behavior.
|
||||
func (dao *PipelineOperationLogDAO) GetDatasetLogsByKBID(ctx context.Context, db *gorm.DB, kbID string, page, pageSize int, orderby string, desc bool, operationStatus []string, createDateFrom, createDateTo, keywords string) ([]*entity.PipelineOperationLog, int64, error) {
|
||||
query := db.WithContext(ctx).Model(&entity.PipelineOperationLog{}).
|
||||
Where("kb_id = ? AND document_id = ?", kbID, graphRaptorFakeDocID)
|
||||
|
||||
@@ -369,8 +369,3 @@ func syncConnectorConfigBool(config map[string]any, key string) bool {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// IsNotFound reports whether an error is a gorm not found error.
|
||||
func IsNotFound(err error) bool {
|
||||
return errors.Is(err, gorm.ErrRecordNotFound)
|
||||
}
|
||||
|
||||
@@ -69,11 +69,6 @@ func userCanvasQualifiedOrderClause(orderby string, desc bool) string {
|
||||
return order + " ASC"
|
||||
}
|
||||
|
||||
func escapeSQLLike(s string) string {
|
||||
replacer := strings.NewReplacer(`\`, `\\`, `%`, `\%`, `_`, `\_`)
|
||||
return replacer.Replace(s)
|
||||
}
|
||||
|
||||
func splitUserCanvasTags(raw string) []string {
|
||||
parts := strings.Split(raw, ",")
|
||||
tags := make([]string, 0, len(parts))
|
||||
|
||||
Reference in New Issue
Block a user