From 1f379100c569b6906b4fa31addc0f91e354667f0 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Tue, 28 Feb 2023 15:20:30 +0900 Subject: [PATCH] Remove parse application service --- .../domain/models/upload/parseRepository.ts | 11 ---------- .../pages/projects/_id/dataset/import.vue | 4 ++-- frontend/plugins/services.ts | 3 --- .../repositories/upload/apiParseRepository.ts | 3 +-- .../upload/parseApplicationService.ts | 20 ------------------- 5 files changed, 3 insertions(+), 38 deletions(-) delete mode 100644 frontend/domain/models/upload/parseRepository.ts delete mode 100644 frontend/services/application/upload/parseApplicationService.ts diff --git a/frontend/domain/models/upload/parseRepository.ts b/frontend/domain/models/upload/parseRepository.ts deleted file mode 100644 index d8b25907..00000000 --- a/frontend/domain/models/upload/parseRepository.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface ParseRepository { - analyze( - projectId: string, - format: string, - task: string, - uploadIds: number[], - option: object - ): Promise - - revert(serverId: string): void -} diff --git a/frontend/pages/projects/_id/dataset/import.vue b/frontend/pages/projects/_id/dataset/import.vue index c3ce2279..aeb8b131 100644 --- a/frontend/pages/projects/_id/dataset/import.vue +++ b/frontend/pages/projects/_id/dataset/import.vue @@ -202,7 +202,7 @@ export default { } this.myFiles = [] for (const file of this.uploadedFiles) { - this.$services.parse.revert(file.serverId) + this.$repositories.parse.revert(file.serverId) } this.uploadedFiles = [] this.errors = [] @@ -235,7 +235,7 @@ export default { async importDataset() { this.isImporting = true const item = this.catalog.find((item) => item.displayName === this.selected) - this.taskId = await this.$services.parse.analyze( + this.taskId = await this.$repositories.parse.analyze( this.$route.params.id, item.name, item.taskId, diff --git a/frontend/plugins/services.ts b/frontend/plugins/services.ts index 2b5586f2..5d01cb53 100644 --- a/frontend/plugins/services.ts +++ b/frontend/plugins/services.ts @@ -15,7 +15,6 @@ import { SegmentationApplicationService } from '@/services/application/tasks/seg import { Seq2seqApplicationService } from '@/services/application/tasks/seq2seq/seq2seqApplicationService' import { SequenceLabelingApplicationService } from '@/services/application/tasks/sequenceLabeling/sequenceLabelingApplicationService' import { TextClassificationService } from '@/services/application/tasks/textClassification/textClassificationApplicationService' -import { ParseApplicationService } from '@/services/application/upload/parseApplicationService' export interface Services { categoryType: LabelApplicationService @@ -30,7 +29,6 @@ export interface Services { seq2seq: Seq2seqApplicationService option: OptionApplicationService config: ConfigApplicationService - parse: ParseApplicationService downloadFormat: DownloadFormatApplicationService download: DownloadApplicationService tag: TagApplicationService @@ -61,7 +59,6 @@ const plugin: Plugin = (_, inject) => { seq2seq: new Seq2seqApplicationService(repositories.textLabel), option: new OptionApplicationService(repositories.option), config: new ConfigApplicationService(repositories.config), - parse: new ParseApplicationService(repositories.parse), downloadFormat: new DownloadFormatApplicationService(repositories.downloadFormat), download: new DownloadApplicationService(repositories.download), tag: new TagApplicationService(repositories.tag), diff --git a/frontend/repositories/upload/apiParseRepository.ts b/frontend/repositories/upload/apiParseRepository.ts index b019e720..bbdb636d 100644 --- a/frontend/repositories/upload/apiParseRepository.ts +++ b/frontend/repositories/upload/apiParseRepository.ts @@ -1,7 +1,6 @@ import ApiService from '@/services/api.service' -import { ParseRepository } from '@/domain/models/upload/parseRepository' -export class APIParseRepository implements ParseRepository { +export class APIParseRepository { constructor(private readonly request = ApiService) {} async analyze( diff --git a/frontend/services/application/upload/parseApplicationService.ts b/frontend/services/application/upload/parseApplicationService.ts deleted file mode 100644 index 2e20c09a..00000000 --- a/frontend/services/application/upload/parseApplicationService.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { ParseRepository } from '~/domain/models/upload/parseRepository' - -export class ParseApplicationService { - constructor(private readonly repository: ParseRepository) {} - - public async analyze( - projectId: string, - format: string, - task: string, - uploadIds: number[], - option: object - ): Promise { - const item = await this.repository.analyze(projectId, format, task, uploadIds, option) - return item - } - - public revert(serverId: string): void { - this.repository.revert(serverId) - } -}