Browse Source

Remove parse application service

pull/2144/head
Hironsan 2 years ago
parent
commit
1f379100c5
5 changed files with 3 additions and 38 deletions
  1. 11
      frontend/domain/models/upload/parseRepository.ts
  2. 4
      frontend/pages/projects/_id/dataset/import.vue
  3. 3
      frontend/plugins/services.ts
  4. 3
      frontend/repositories/upload/apiParseRepository.ts
  5. 20
      frontend/services/application/upload/parseApplicationService.ts

11
frontend/domain/models/upload/parseRepository.ts

@ -1,11 +0,0 @@
export interface ParseRepository {
analyze(
projectId: string,
format: string,
task: string,
uploadIds: number[],
option: object
): Promise<string>
revert(serverId: string): void
}

4
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,

3
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),

3
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(

20
frontend/services/application/upload/parseApplicationService.ts

@ -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<string> {
const item = await this.repository.analyze(projectId, format, task, uploadIds, option)
return item
}
public revert(serverId: string): void {
this.repository.revert(serverId)
}
}
Loading…
Cancel
Save