Browse Source

Remove download application service

pull/2144/head
Hironsan 1 year ago
parent
commit
1927c021cc
5 changed files with 3 additions and 30 deletions
  1. 5
      frontend/domain/models/download/downloadRepository.ts
  2. 4
      frontend/pages/projects/_id/dataset/export.vue
  3. 3
      frontend/plugins/services.ts
  4. 3
      frontend/repositories/download/apiDownloadRepository.ts
  5. 18
      frontend/services/application/download/downloadApplicationService.ts

5
frontend/domain/models/download/downloadRepository.ts

@ -1,5 +0,0 @@
export interface DownloadRepository {
prepare(projectId: string, format: string, exportApproved: boolean): Promise<string>
download(projectId: string, taskId: string): void
}

4
frontend/pages/projects/_id/dataset/export.vue

@ -93,7 +93,7 @@ export default Vue.extend({
async downloadRequest() {
this.isProcessing = true
this.taskId = await this.$services.download.request(
this.taskId = await this.$repositories.download.prepare(
this.projectId,
this.selectedFormat,
this.exportApproved
@ -107,7 +107,7 @@ export default Vue.extend({
if (this.taskId) {
const res = await this.$repositories.taskStatus.get(this.taskId)
if (res.ready) {
this.$services.download.download(this.projectId, this.taskId)
this.$repositories.download.download(this.projectId, this.taskId)
this.reset()
}
}

3
frontend/plugins/services.ts

@ -2,7 +2,6 @@ import { Plugin } from '@nuxt/types'
import { repositories } from './repositories'
import { ConfigApplicationService } from '@/services/application/autoLabeling/configApplicationService'
import { CommentApplicationService } from '@/services/application/comment/commentApplicationService'
import { DownloadApplicationService } from '@/services/application/download/downloadApplicationService'
import { ExampleApplicationService } from '@/services/application/example/exampleApplicationService'
import { LabelApplicationService } from '@/services/application/label/labelApplicationService'
import { MemberApplicationService } from '@/services/application/member/memberApplicationService'
@ -28,7 +27,6 @@ export interface Services {
seq2seq: Seq2seqApplicationService
option: OptionApplicationService
config: ConfigApplicationService
download: DownloadApplicationService
tag: TagApplicationService
bbox: BoundingBoxApplicationService
segmentation: SegmentationApplicationService
@ -57,7 +55,6 @@ const plugin: Plugin = (_, inject) => {
seq2seq: new Seq2seqApplicationService(repositories.textLabel),
option: new OptionApplicationService(repositories.option),
config: new ConfigApplicationService(repositories.config),
download: new DownloadApplicationService(repositories.download),
tag: new TagApplicationService(repositories.tag),
bbox: new BoundingBoxApplicationService(repositories.boundingBox),
segmentation: new SegmentationApplicationService(repositories.segmentation)

3
frontend/repositories/download/apiDownloadRepository.ts

@ -1,7 +1,6 @@
import ApiService from '@/services/api.service'
import { DownloadRepository } from '@/domain/models/download/downloadRepository'
export class APIDownloadRepository implements DownloadRepository {
export class APIDownloadRepository {
constructor(private readonly request = ApiService) {}
async prepare(projectId: string, format: string, exportApproved: boolean): Promise<string> {

18
frontend/services/application/download/downloadApplicationService.ts

@ -1,18 +0,0 @@
import { DownloadRepository } from '~/domain/models/download/downloadRepository'
export class DownloadApplicationService {
constructor(private readonly repository: DownloadRepository) {}
public async request(
projectId: string,
format: string,
exportApproved: boolean
): Promise<string> {
const item = await this.repository.prepare(projectId, format, exportApproved)
return item
}
public download(projectId: string, taskId: string): void {
this.repository.download(projectId, taskId)
}
}
Loading…
Cancel
Save