diff options
Diffstat (limited to 'src/content/usecases/FollowMasterUseCase.ts')
-rw-r--r-- | src/content/usecases/FollowMasterUseCase.ts | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/src/content/usecases/FollowMasterUseCase.ts b/src/content/usecases/FollowMasterUseCase.ts index 9cbb790..38c41b7 100644 --- a/src/content/usecases/FollowMasterUseCase.ts +++ b/src/content/usecases/FollowMasterUseCase.ts @@ -1,31 +1,26 @@ -import FollowKeyRepository, { FollowKeyRepositoryImpl } - from '../repositories/FollowKeyRepository'; -import FollowMasterRepository, { FollowMasterRepositoryImpl } - from '../repositories/FollowMasterRepository'; +import { injectable, inject } from 'tsyringe'; +import FollowKeyRepository from '../repositories/FollowKeyRepository'; +import FollowMasterRepository from '../repositories/FollowMasterRepository'; import FollowSlaveClient, { FollowSlaveClientImpl } from '../client/FollowSlaveClient'; +import SettingRepository from '../repositories/SettingRepository'; import HintKeyProducer from './HintKeyProducer'; -import SettingRepository, { SettingRepositoryImpl } - from '../repositories/SettingRepository'; +@injectable() export default class FollowMasterUseCase { - private followKeyRepository: FollowKeyRepository; - - private followMasterRepository: FollowMasterRepository; - - private settingRepository: SettingRepository; - // TODO Make repository private producer: HintKeyProducer | null; - constructor({ - followKeyRepository = new FollowKeyRepositoryImpl(), - followMasterRepository = new FollowMasterRepositoryImpl(), - settingRepository = new SettingRepositoryImpl(), - } = {}) { - this.followKeyRepository = followKeyRepository; - this.followMasterRepository = followMasterRepository; - this.settingRepository = settingRepository; + constructor( + @inject('FollowKeyRepository') + private followKeyRepository: FollowKeyRepository, + + @inject('FollowMasterRepository') + private followMasterRepository: FollowMasterRepository, + + @inject('SettingRepository') + private settingRepository: SettingRepository, + ) { this.producer = null; } |