MCPcopy Create free account
hub / github.com/53AI/53AIHub / GetFilesByPathsAndLibrary

Function GetFilesByPathsAndLibrary

api/model/file.go:569–578  ·  view source on GitHub ↗

GetFilesByPathsAndLibrary 根据多个路径和知识库ID批量获取文件

(eid int64, libraryID int64, filePaths []string)

Source from the content-addressed store, hash-verified

567
568// GetFilesByPathsAndLibrary 根据多个路径和知识库ID批量获取文件
569func GetFilesByPathsAndLibrary(eid int64, libraryID int64, filePaths []string) ([]File, error) {
570 var files []File
571 if len(filePaths) == 0 {
572 return files, nil
573 }
574 if err := DB.Where("eid = ? AND library_id = ? AND path IN ?", eid, libraryID, filePaths).Find(&files).Error; err != nil {
575 return nil, err
576 }
577 return files, nil
578}
579
580func GetFileByPathAndLibraryNotDeleted(eid int64, libraryID int64, filePath string) (*File, error) {
581 var file File

Callers 1

GetFileWithParentsByIDFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected