add meili search
This commit is contained in:
@@ -6,6 +6,7 @@ import * as controllers from '@/modules/content/controllers';
|
||||
import * as entities from '@/modules/content/entities';
|
||||
import * as repositories from '@/modules/content/repositories';
|
||||
import * as services from '@/modules/content/services';
|
||||
import { SearchService } from '@/modules/content/services';
|
||||
import { SanitizeService } from '@/modules/content/services/SanitizeService';
|
||||
|
||||
import { PostService } from '@/modules/content/services/post.service';
|
||||
@@ -31,23 +32,29 @@ export class ContentModule {
|
||||
repositories.CategoryRepository,
|
||||
repositories.TagRepository,
|
||||
services.CategoryService,
|
||||
{ token: services.SearchService, optional: true },
|
||||
],
|
||||
useFactory(
|
||||
postRepository: repositories.PostRepository,
|
||||
categoryRepository: repositories.CategoryRepository,
|
||||
tagRepository: repositories.TagRepository,
|
||||
categoryService: services.CategoryService,
|
||||
searchService: SearchService,
|
||||
) {
|
||||
return new PostService(
|
||||
postRepository,
|
||||
categoryRepository,
|
||||
categoryService,
|
||||
tagRepository,
|
||||
searchService,
|
||||
config.SearchType,
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
if (config.SearchType === 'meili') {
|
||||
providers.push(services.SearchService);
|
||||
}
|
||||
return {
|
||||
module: ContentModule,
|
||||
imports: [
|
||||
|
||||
Reference in New Issue
Block a user