GetFilesByPathsAndLibrary 根据多个路径和知识库ID批量获取文件
(eid int64, libraryID int64, filePaths []string)
| 567 | |
| 568 | // GetFilesByPathsAndLibrary 根据多个路径和知识库ID批量获取文件 |
| 569 | func 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 | |
| 580 | func GetFileByPathAndLibraryNotDeleted(eid int64, libraryID int64, filePath string) (*File, error) { |
| 581 | var file File |
no outgoing calls
no test coverage detected