|
|
@ -5,6 +5,7 @@ using System.Threading.Tasks; |
|
|
using Microsoft.Extensions.Caching.Distributed; |
|
|
using Microsoft.Extensions.Caching.Distributed; |
|
|
using Microsoft.Extensions.Hosting; |
|
|
using Microsoft.Extensions.Hosting; |
|
|
using Microsoft.Extensions.Logging; |
|
|
using Microsoft.Extensions.Logging; |
|
|
|
|
|
using Microsoft.Extensions.Options; |
|
|
using Newtonsoft.Json; |
|
|
using Newtonsoft.Json; |
|
|
using Volo.Abp.Caching; |
|
|
using Volo.Abp.Caching; |
|
|
using Volo.Docs.Documents.FullSearch.Elastic; |
|
|
using Volo.Docs.Documents.FullSearch.Elastic; |
|
|
@ -22,6 +23,7 @@ namespace Volo.Docs.Documents |
|
|
protected IDistributedCache<DocumentUpdateInfo> DocumentUpdateCache { get; } |
|
|
protected IDistributedCache<DocumentUpdateInfo> DocumentUpdateCache { get; } |
|
|
protected IHostEnvironment HostEnvironment { get; } |
|
|
protected IHostEnvironment HostEnvironment { get; } |
|
|
private readonly IDocumentFullSearch _documentFullSearch; |
|
|
private readonly IDocumentFullSearch _documentFullSearch; |
|
|
|
|
|
private readonly DocsElasticSearchOptions _docsElasticSearchOptions; |
|
|
|
|
|
|
|
|
public DocumentAppService( |
|
|
public DocumentAppService( |
|
|
IProjectRepository projectRepository, |
|
|
IProjectRepository projectRepository, |
|
|
@ -31,7 +33,8 @@ namespace Volo.Docs.Documents |
|
|
IDistributedCache<DocumentResourceDto> resourceCache, |
|
|
IDistributedCache<DocumentResourceDto> resourceCache, |
|
|
IDistributedCache<DocumentUpdateInfo> documentUpdateCache, |
|
|
IDistributedCache<DocumentUpdateInfo> documentUpdateCache, |
|
|
IHostEnvironment hostEnvironment, |
|
|
IHostEnvironment hostEnvironment, |
|
|
IDocumentFullSearch documentFullSearch) |
|
|
IDocumentFullSearch documentFullSearch, |
|
|
|
|
|
IOptions<DocsElasticSearchOptions> docsElasticSearchOptions) |
|
|
{ |
|
|
{ |
|
|
_projectRepository = projectRepository; |
|
|
_projectRepository = projectRepository; |
|
|
_documentRepository = documentRepository; |
|
|
_documentRepository = documentRepository; |
|
|
@ -41,6 +44,7 @@ namespace Volo.Docs.Documents |
|
|
DocumentUpdateCache = documentUpdateCache; |
|
|
DocumentUpdateCache = documentUpdateCache; |
|
|
HostEnvironment = hostEnvironment; |
|
|
HostEnvironment = hostEnvironment; |
|
|
_documentFullSearch = documentFullSearch; |
|
|
_documentFullSearch = documentFullSearch; |
|
|
|
|
|
_docsElasticSearchOptions = docsElasticSearchOptions.Value; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public virtual async Task<DocumentWithDetailsDto> GetAsync(GetDocumentInput input) |
|
|
public virtual async Task<DocumentWithDetailsDto> GetAsync(GetDocumentInput input) |
|
|
@ -145,6 +149,11 @@ namespace Volo.Docs.Documents |
|
|
}).ToList(); |
|
|
}).ToList(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task<bool> FullSearchEnabledAsync() |
|
|
|
|
|
{ |
|
|
|
|
|
return await Task.FromResult(_docsElasticSearchOptions.Enable); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public async Task<DocumentParametersDto> GetParametersAsync(GetParametersDocumentInput input) |
|
|
public async Task<DocumentParametersDto> GetParametersAsync(GetParametersDocumentInput input) |
|
|
{ |
|
|
{ |
|
|
var project = await _projectRepository.GetAsync(input.ProjectId); |
|
|
var project = await _projectRepository.GetAsync(input.ProjectId); |
|
|
|