reorganizde file path

This commit is contained in:
Peter Maquiran
2024-08-27 09:14:59 +01:00
parent 98975856c1
commit e80082f9e8
54 changed files with 236 additions and 454 deletions
@@ -0,0 +1,19 @@
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
import { DexieRepository } from 'src/app/infra/repository/dexie/dexie-repository.service';
import { chatDatabase } from '../../../infra/database/dexie/service';
import { AttachmentTable, AttachmentTableSchema } from '../../../infra/database/dexie/schema/attachment';
@Injectable({
providedIn: 'root'
})
export class AttachmentLocalDataSource extends DexieRepository<AttachmentTable, AttachmentTable> {
messageSubject = new Subject();
constructor() {
super(chatDatabase.attachment, AttachmentTableSchema)
}
}
@@ -0,0 +1,21 @@
import { Injectable, Input } from '@angular/core';
import { HttpService } from 'src/app/services/http.service';
import { DataSourceReturn } from 'src/app/services/Repositorys/type';
import { MessageOutPutDTO } from '../../dto/message/messageOutputDTO';
import { MessageAttachmentByMessageIdInput } from '../../../domain/use-case/message/message-attachment-by-message-id.service';
@Injectable({
providedIn: 'root'
})
export class AttachmentRemoteDataSourceService {
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2/Chat'; // Your base URL
constructor(
private httpService: HttpService
) { }
async getAttachment(id: string | number): DataSourceReturn<Blob> {
return await this.httpService.get(`${this.baseUrl}/attachment/${id}`, { responseType: 'blob' });
}
}