mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
reorganizde file path
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+21
@@ -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' });
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user