GetFilesByLibraryID 获取知识库下的所有文件
(eid int64, libraryID int64)
| 614 | |
| 615 | // GetFilesByLibraryID 获取知识库下的所有文件 |
| 616 | func GetFilesByLibraryID(eid int64, libraryID int64) ([]File, error) { |
| 617 | var files []File |
| 618 | if err := DB.Where("eid = ? AND library_id = ?", eid, libraryID).Find(&files).Error; err != nil { |
| 619 | return nil, err |
| 620 | } |
| 621 | |
| 622 | return files, nil |
| 623 | } |
| 624 | |
| 625 | type libraryFileCountRow struct { |
| 626 | LibraryID int64 `gorm:"column:library_id"` |