diff --git a/frontend/domain/models/upload/catalogRepository.ts b/frontend/domain/models/upload/catalogRepository.ts deleted file mode 100644 index c39724d5..00000000 --- a/frontend/domain/models/upload/catalogRepository.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Catalog } from './catalog' - -export interface CatalogRepository { - list(projectId: string): Promise -} diff --git a/frontend/pages/projects/_id/dataset/import.vue b/frontend/pages/projects/_id/dataset/import.vue index 346e0682..c3ce2279 100644 --- a/frontend/pages/projects/_id/dataset/import.vue +++ b/frontend/pages/projects/_id/dataset/import.vue @@ -210,7 +210,7 @@ export default { }, async created() { - this.catalog = await this.$services.catalog.list(this.$route.params.id) + this.catalog = await this.$repositories.catalog.list(this.$route.params.id) this.pollData() }, diff --git a/frontend/plugins/services.ts b/frontend/plugins/services.ts index 2b70e910..2b5586f2 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 { CatalogApplicationService } from '@/services/application/upload/catalogApplicationService' import { ParseApplicationService } from '@/services/application/upload/parseApplicationService' export interface Services { @@ -31,7 +30,6 @@ export interface Services { seq2seq: Seq2seqApplicationService option: OptionApplicationService config: ConfigApplicationService - catalog: CatalogApplicationService parse: ParseApplicationService downloadFormat: DownloadFormatApplicationService download: DownloadApplicationService @@ -63,7 +61,6 @@ const plugin: Plugin = (_, inject) => { seq2seq: new Seq2seqApplicationService(repositories.textLabel), option: new OptionApplicationService(repositories.option), config: new ConfigApplicationService(repositories.config), - catalog: new CatalogApplicationService(repositories.catalog), parse: new ParseApplicationService(repositories.parse), downloadFormat: new DownloadFormatApplicationService(repositories.downloadFormat), download: new DownloadApplicationService(repositories.download), diff --git a/frontend/repositories/upload/apiCatalogRepository.ts b/frontend/repositories/upload/apiCatalogRepository.ts index 5248798f..54d9dc9a 100644 --- a/frontend/repositories/upload/apiCatalogRepository.ts +++ b/frontend/repositories/upload/apiCatalogRepository.ts @@ -1,5 +1,4 @@ import ApiService from '@/services/api.service' -import { CatalogRepository } from '@/domain/models/upload/catalogRepository' import { Catalog } from '~/domain/models/upload/catalog' function toModel(item: { [key: string]: any }): Catalog { @@ -13,7 +12,7 @@ function toModel(item: { [key: string]: any }): Catalog { ) } -export class APICatalogRepository implements CatalogRepository { +export class APICatalogRepository { constructor(private readonly request = ApiService) {} async list(projectId: string): Promise { diff --git a/frontend/services/application/upload/catalogApplicationService.ts b/frontend/services/application/upload/catalogApplicationService.ts deleted file mode 100644 index 841358d5..00000000 --- a/frontend/services/application/upload/catalogApplicationService.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { CatalogDTO } from './catalogData' -import { CatalogRepository } from '~/domain/models/upload/catalogRepository' - -export class CatalogApplicationService { - constructor(private readonly repository: CatalogRepository) {} - - public async list(projectId: string): Promise { - const items = await this.repository.list(projectId) - return items.map((item) => new CatalogDTO(item)) - } -} diff --git a/frontend/services/application/upload/catalogData.ts b/frontend/services/application/upload/catalogData.ts deleted file mode 100644 index 273988d5..00000000 --- a/frontend/services/application/upload/catalogData.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Catalog } from '~/domain/models/upload/catalog' - -export class CatalogDTO { - name: string - example: string - acceptTypes: string - properties: object - taskId: string - displayName: string - - constructor(item: Catalog) { - this.name = item.name - this.example = item.example - this.acceptTypes = item.acceptTypes - this.properties = item.properties - this.displayName = item.displayName - this.taskId = item.taskId - } -}