From 26204686d61bbe8e3a2c125fc6892e9f3a0f3c32 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Tue, 28 Feb 2023 14:25:26 +0900 Subject: [PATCH] Remove template application service --- .../configAutoLabeling/form/ConfigTemplateName.vue | 4 ++-- .../models/autoLabeling/templateRepository.ts | 7 ------- frontend/plugins/services.ts | 3 --- .../autoLabeling/template/apiTemplateRepository.ts | 5 ++--- .../autoLabeling/templateApplicationService.ts | 14 -------------- 5 files changed, 4 insertions(+), 29 deletions(-) delete mode 100644 frontend/domain/models/autoLabeling/templateRepository.ts delete mode 100644 frontend/services/application/autoLabeling/templateApplicationService.ts diff --git a/frontend/components/configAutoLabeling/form/ConfigTemplateName.vue b/frontend/components/configAutoLabeling/form/ConfigTemplateName.vue index 6a358289..15391e60 100644 --- a/frontend/components/configAutoLabeling/form/ConfigTemplateName.vue +++ b/frontend/components/configAutoLabeling/form/ConfigTemplateName.vue @@ -67,7 +67,7 @@ export default Vue.extend({ watch: { async templateName(val) { if (val) { - const response = await this.$services.template.find(this.projectId, val) + const response = await this.$repositories.template.find(this.projectId, val) const field = response.toObject() field.taskType = this.taskType this.$emit('input', field) @@ -90,7 +90,7 @@ export default Vue.extend({ methods: { async fetchTemplateNames() { - this.templateNames = await this.$services.template.list(this.projectId, this.selectedTask) + this.templateNames = await this.$repositories.template.list(this.projectId, this.selectedTask) } } }) diff --git a/frontend/domain/models/autoLabeling/templateRepository.ts b/frontend/domain/models/autoLabeling/templateRepository.ts deleted file mode 100644 index abcf13e4..00000000 --- a/frontend/domain/models/autoLabeling/templateRepository.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ConfigTemplateItem } from '~/domain/models/autoLabeling/template' - -export interface TemplateRepository { - list(projectId: string, taskName: string): Promise - - find(projectId: string, optionName: string): Promise -} diff --git a/frontend/plugins/services.ts b/frontend/plugins/services.ts index 8ff2888d..84536bea 100644 --- a/frontend/plugins/services.ts +++ b/frontend/plugins/services.ts @@ -1,7 +1,6 @@ import { Plugin } from '@nuxt/types' import { repositories } from './repositories' import { ConfigApplicationService } from '@/services/application/autoLabeling/configApplicationService' -import { TemplateApplicationService } from '@/services/application/autoLabeling/templateApplicationService' import { TaskStatusApplicationService } from '@/services/application/celery/taskStatusApplicationService' import { CommentApplicationService } from '@/services/application/comment/commentApplicationService' import { DownloadApplicationService } from '@/services/application/download/downloadApplicationService' @@ -33,7 +32,6 @@ export interface Services { seq2seq: Seq2seqApplicationService option: OptionApplicationService config: ConfigApplicationService - template: TemplateApplicationService catalog: CatalogApplicationService parse: ParseApplicationService taskStatus: TaskStatusApplicationService @@ -67,7 +65,6 @@ const plugin: Plugin = (_, inject) => { seq2seq: new Seq2seqApplicationService(repositories.textLabel), option: new OptionApplicationService(repositories.option), config: new ConfigApplicationService(repositories.config), - template: new TemplateApplicationService(repositories.template), catalog: new CatalogApplicationService(repositories.catalog), parse: new ParseApplicationService(repositories.parse), taskStatus: new TaskStatusApplicationService(repositories.taskStatus), diff --git a/frontend/repositories/autoLabeling/template/apiTemplateRepository.ts b/frontend/repositories/autoLabeling/template/apiTemplateRepository.ts index 1a53a35d..9b0dc40c 100644 --- a/frontend/repositories/autoLabeling/template/apiTemplateRepository.ts +++ b/frontend/repositories/autoLabeling/template/apiTemplateRepository.ts @@ -1,8 +1,7 @@ import ApiService from '@/services/api.service' -import { TemplateRepository } from '~/domain/models/autoLabeling/templateRepository' -import { ConfigTemplateItem, ConfigResponse } from '~/domain/models/autoLabeling/template' +import { ConfigResponse, ConfigTemplateItem } from '~/domain/models/autoLabeling/template' -export class APITemplateRepository implements TemplateRepository { +export class APITemplateRepository { constructor(private readonly request = ApiService) {} async list(projectId: string, taskName: string): Promise { diff --git a/frontend/services/application/autoLabeling/templateApplicationService.ts b/frontend/services/application/autoLabeling/templateApplicationService.ts deleted file mode 100644 index 81abe537..00000000 --- a/frontend/services/application/autoLabeling/templateApplicationService.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { TemplateRepository } from '~/domain/models/autoLabeling/templateRepository' -import { ConfigTemplateItem } from '~/domain/models/autoLabeling/template' - -export class TemplateApplicationService { - constructor(private readonly repository: TemplateRepository) {} - - public list(id: string, taskName: string): Promise { - return this.repository.list(id, taskName) - } - - public find(projectId: string, optionName: string): Promise { - return this.repository.find(projectId, optionName) - } -}