TF-3157 Implement web socket push

This commit is contained in:
DatDang
2024-09-23 13:38:45 +07:00
committed by Dat H. Pham
parent ee776311c7
commit c4d0c27603
24 changed files with 773 additions and 131 deletions
@@ -0,0 +1,39 @@
import 'package:get/get.dart';
import 'package:tmail_ui_user/features/base/interactors_bindings.dart';
import 'package:tmail_ui_user/features/push_notification/data/datasource/web_socket_datasource.dart';
import 'package:tmail_ui_user/features/push_notification/data/datasource_impl/remote_web_socket_datasource_impl.dart';
import 'package:tmail_ui_user/features/push_notification/data/network/web_socket_api.dart';
import 'package:tmail_ui_user/features/push_notification/data/repository/web_socket_repository_impl.dart';
import 'package:tmail_ui_user/features/push_notification/domain/repository/web_socket_repository.dart';
import 'package:tmail_ui_user/features/push_notification/domain/usecases/connect_web_socket_interactor.dart';
import 'package:tmail_ui_user/main/exceptions/remote_exception_thrower.dart';
class WebSocketInteractorBindings extends InteractorsBindings {
@override
void bindingsDataSource() {
Get.lazyPut<WebSocketDatasource>(() => Get.find<RemoteWebSocketDatasourceImpl>());
}
@override
void bindingsDataSourceImpl() {
Get.lazyPut(() => RemoteWebSocketDatasourceImpl(
Get.find<WebSocketApi>(),
Get.find<RemoteExceptionThrower>(),
));
}
@override
void bindingsInteractor() {
Get.lazyPut(() => ConnectWebSocketInteractor(Get.find<WebSocketRepository>()));
}
@override
void bindingsRepository() {
Get.lazyPut<WebSocketRepository>(() => Get.find<WebSocketRepositoryImpl>());
}
@override
void bindingsRepositoryImpl() {
Get.lazyPut(() => WebSocketRepositoryImpl(Get.find<WebSocketDatasource>()));
}
}