rename file-ref-api to file-api

This commit is contained in:
Wheat Carrier 2024-07-10 01:02:32 +08:00
parent c6eec4a7f0
commit a9c3126a29
2 changed files with 7 additions and 8 deletions

View File

@ -6,7 +6,7 @@ import { FileDescApi } from './file-desc-api';
import { MetaDataApi } from './metadata-api';
import { GeneralFileMessage } from './model';
export class FileRefApi {
export class FileApi {
constructor(
private readonly metadataApi: MetaDataApi,
private readonly fileDescApi: FileDescApi,

View File

@ -2,8 +2,8 @@ import { gramjs, telegraf } from 'src/api/impl';
import { config } from 'src/config';
import { DirectoryApi } from './directory-api';
import { FileApi } from './file-api';
import { FileDescApi } from './file-desc-api';
import { FileRefApi } from './file-ref-api';
import { MessageApi } from './message-api';
import { MetaDataApi } from './metadata-api';
import { TGMsgFDRepository } from './repository/impl/fd/tg-msg';
@ -28,22 +28,21 @@ export const createClient = async () => {
const metadataApi = new MetaDataApi(metadataRepo);
await metadataApi.init();
const frApi = new FileRefApi(metadataApi, fdApi);
const fileApi = new FileApi(metadataApi, fdApi);
const dirApi = new DirectoryApi(metadataApi);
return new Client(metadataApi, frApi, dirApi);
return new Client(fileApi, dirApi);
};
export class Client {
file: FileRefApi;
file: FileApi;
dir: DirectoryApi;
constructor(
private readonly metadataApi: MetaDataApi,
private readonly frApi: FileRefApi,
private readonly fileApi: FileApi,
private readonly dirApi: DirectoryApi,
) {
this.file = this.frApi;
this.file = this.fileApi;
this.dir = this.dirApi;
}
}