This commit is contained in:
@@ -15,10 +15,19 @@ import 'package:trainhub_flutter/data/repositories/training_plan_repository_impl
|
||||
import 'package:trainhub_flutter/data/repositories/program_repository_impl.dart';
|
||||
import 'package:trainhub_flutter/data/repositories/analysis_repository_impl.dart';
|
||||
import 'package:trainhub_flutter/data/repositories/chat_repository_impl.dart';
|
||||
import 'package:trainhub_flutter/data/repositories/note_repository_impl.dart';
|
||||
import 'package:trainhub_flutter/domain/repositories/note_repository.dart';
|
||||
import 'package:trainhub_flutter/domain/services/ai_process_manager.dart';
|
||||
import 'package:trainhub_flutter/domain/services/embedding_service.dart';
|
||||
import 'package:trainhub_flutter/data/database/daos/knowledge_chunk_dao.dart';
|
||||
|
||||
final GetIt getIt = GetIt.instance;
|
||||
|
||||
void init() {
|
||||
// AI Process Manager — must be registered before anything else so that the
|
||||
// window lifecycle hook can always find it via getIt<AiProcessManager>().
|
||||
getIt.registerSingleton<AiProcessManager>(AiProcessManager());
|
||||
|
||||
// Database
|
||||
getIt.registerSingleton<AppDatabase>(AppDatabase());
|
||||
|
||||
@@ -30,6 +39,12 @@ void init() {
|
||||
getIt.registerSingleton<ProgramDao>(ProgramDao(getIt<AppDatabase>()));
|
||||
getIt.registerSingleton<AnalysisDao>(AnalysisDao(getIt<AppDatabase>()));
|
||||
getIt.registerSingleton<ChatDao>(ChatDao(getIt<AppDatabase>()));
|
||||
getIt.registerSingleton<KnowledgeChunkDao>(
|
||||
KnowledgeChunkDao(getIt<AppDatabase>()),
|
||||
);
|
||||
|
||||
// Services
|
||||
getIt.registerSingleton<EmbeddingService>(EmbeddingService());
|
||||
|
||||
// Repositories
|
||||
getIt.registerLazySingleton<ExerciseRepository>(
|
||||
@@ -47,4 +62,10 @@ void init() {
|
||||
getIt.registerLazySingleton<ChatRepository>(
|
||||
() => ChatRepositoryImpl(getIt<ChatDao>()),
|
||||
);
|
||||
getIt.registerLazySingleton<NoteRepository>(
|
||||
() => NoteRepositoryImpl(
|
||||
getIt<KnowledgeChunkDao>(),
|
||||
getIt<EmbeddingService>(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user