mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-02 05:47:31 +08:00
feat(go): port knowledge compilation template/group + wiki artifact/nav/skill REST APIs from Python (#17656)
This commit is contained in:
@@ -41,6 +41,7 @@ type mockFileCommitSvc struct {
|
||||
getCommitTreeFn func(ctx context.Context, commitID string) (map[string]interface{}, error)
|
||||
getCommitFileContentFn func(ctx context.Context, folderID, commitID, fileID string) ([]byte, error)
|
||||
getFileVersionHistoryFn func(ctx context.Context, fileID string) ([]entity.VersionEntry, error)
|
||||
listPageCommitsFn func(ctx context.Context, datasetID, pageType, slug string, page, pageSize int) ([]*entity.FileCommit, int64, error)
|
||||
}
|
||||
|
||||
func (m *mockFileCommitSvc) CreateCommit(ctx context.Context, folderID, authorID, message string, changes []entity.FileChange) (*entity.FileCommit, error) {
|
||||
@@ -128,6 +129,13 @@ func (m *mockFileCommitSvc) GetFileVersionHistory(ctx context.Context, fileID st
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (m *mockFileCommitSvc) ListPageCommits(ctx context.Context, datasetID, pageType, slug string, page, pageSize int) ([]*entity.FileCommit, int64, error) {
|
||||
if m.listPageCommitsFn != nil {
|
||||
return m.listPageCommitsFn(ctx, datasetID, pageType, slug, page, pageSize)
|
||||
}
|
||||
return []*entity.FileCommit{}, 0, nil
|
||||
}
|
||||
|
||||
func setupFileCommitTest(userID string) (*gin.Engine, *mockFileCommitSvc) {
|
||||
mock := &mockFileCommitSvc{}
|
||||
h := &FileCommitHandler{commitService: mock}
|
||||
|
||||
Reference in New Issue
Block a user