You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
798 B

  1. import { AnnotationRepository } from '~/domain/models/tasks/annotationRepository'
  2. import { AnnotationModel } from '~/domain/models/tasks/interface'
  3. export class AnnotationApplicationService<T extends AnnotationModel> {
  4. constructor(
  5. readonly repository: AnnotationRepository<T>
  6. ) {}
  7. public async delete(projectId: string, docId: number, annotationId: number): Promise<void> {
  8. try {
  9. await this.repository.delete(projectId, docId, annotationId)
  10. } catch(e) {
  11. console.log(e.response.data.detail)
  12. }
  13. }
  14. public async clear(projectId: string, docId: number): Promise<void> {
  15. await this.repository.clear(projectId, docId)
  16. }
  17. public async autoLabel(projectId: string, docId: number): Promise<void> {
  18. await this.repository.autoLabel(projectId, docId)
  19. }
  20. }