From cde092b1b5f097544f781e0f2c6a91e08a76143a Mon Sep 17 00:00:00 2001 From: zin- Date: Tue, 6 Aug 2024 00:22:54 +0900 Subject: [PATCH] fixup! rename for refactoring --- lib/framework/repository/database_repository.dart | 2 +- lib/framework/repository/key_with_value_repository.dart | 4 ++-- lib/framework/repository/repository.dart | 7 ++++--- lib/logger/log_repository.dart | 2 +- lib/notifications/schedule_client.dart | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/framework/repository/database_repository.dart b/lib/framework/repository/database_repository.dart index 2548c7756..742216d45 100644 --- a/lib/framework/repository/database_repository.dart +++ b/lib/framework/repository/database_repository.dart @@ -8,7 +8,7 @@ import 'package:mem/framework/database/factory.dart'; import 'package:mem/framework/repository/repository.dart'; import 'package:mem/logger/log_service.dart'; -class DatabaseRepository extends Repository +class DatabaseRepository extends RepositoryV2 with Receiver { static DatabaseRepository? _instance; diff --git a/lib/framework/repository/key_with_value_repository.dart b/lib/framework/repository/key_with_value_repository.dart index 638d11364..ccc334e68 100644 --- a/lib/framework/repository/key_with_value_repository.dart +++ b/lib/framework/repository/key_with_value_repository.dart @@ -2,10 +2,10 @@ import 'package:mem/framework/repository/key_with_value.dart'; import 'package:mem/framework/repository/repository.dart'; abstract class KeyWithValueRepository, Key> - extends Repository + extends RepositoryV2 with Receiver, DiscarderByKey {} mixin DiscarderByKey, Key, Result> - on Repository { + on RepositoryV2 { Future discard(Key key); } diff --git a/lib/framework/repository/repository.dart b/lib/framework/repository/repository.dart index d48c82bd2..c88c9b68c 100644 --- a/lib/framework/repository/repository.dart +++ b/lib/framework/repository/repository.dart @@ -19,18 +19,19 @@ import 'package:mem/framework/repository/entity.dart'; // 抽象的には得ると捉える事もできるだろうが、では`update`(更新する)ことはあるだろうか? // 更新することはないように感じる // よって、ここでは`receive`(受け取る)、`replace`(置き換える)などの荷物や事物を扱う際の単語を採用する -abstract class Repository {} +abstract class RepositoryV2 {} -mixin Receiver on Repository { +mixin Receiver on RepositoryV2 { Future receive(E entity); } // FIXME 型指定は不要なはずなので、おかしい?(間違っている気がする // というか、mixinの利用自体がなんか変なので辞めたほうが良いかも -mixin Discarder on Repository { +mixin Discarder on RepositoryV2 { Future discardAll(); } abstract class RepositoryV1 { Future receive(E entity); } + diff --git a/lib/logger/log_repository.dart b/lib/logger/log_repository.dart index be98fce0d..e4634366c 100644 --- a/lib/logger/log_repository.dart +++ b/lib/logger/log_repository.dart @@ -3,7 +3,7 @@ import 'package:mem/framework/repository/repository.dart'; import 'log.dart'; import 'logger_wrapper.dart'; -class LogRepository extends Repository with Receiver { +class LogRepository extends RepositoryV2 with Receiver { LoggerWrapper _loggerWrapper; @override diff --git a/lib/notifications/schedule_client.dart b/lib/notifications/schedule_client.dart index 31554c05c..7c15279a8 100644 --- a/lib/notifications/schedule_client.dart +++ b/lib/notifications/schedule_client.dart @@ -9,7 +9,7 @@ import 'package:mem/notifications/schedule.dart'; import 'package:mem/permissions/permission.dart'; import 'package:mem/permissions/permission_handler_wrapper.dart'; -class ScheduleClient extends Repository +class ScheduleClient extends RepositoryV2 with Receiver { static ScheduleClient? _instance; final AndroidAlarmManagerWrapper _androidAlarmManagerWrapper;