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.

21 lines
705 B

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