feat: Add clearCache to NTQQApi

This commit is contained in:
Misa Liu 2024-02-27 19:58:10 +08:00
parent 6c267044f0
commit f08c816286
No known key found for this signature in database
GPG Key ID: F70B23D0A4FED791

View File

@ -80,9 +80,9 @@ export enum NTQQApiMethod {
CACHE_ADD_SCANNED_PATH = 'nodeIKernelStorageCleanService/addCacheScanedPaths', // TODO: Unused method
CACHE_PATH_HOT_UPDATE = 'getHotUpdateCachePath', // TODO: Unused method
CACHE_PATH_DESKTOP_TEMP = 'getDesktopTmpPath', // TODO: Unused method
CACHE_PATH_SESSION = 'getCleanableAppSessionPathList', // TODO: Unused method
CACHE_PATH_SESSION = 'getCleanableAppSessionPathList',
CACHE_SCAN = 'nodeIKernelStorageCleanService/scanCache',
CACHE_CLEAR = '', // TODO
CACHE_CLEAR = 'nodeIKernelStorageCleanService/clearCacheDataByKeys',
CACHE_CHAT_GET = 'nodeIKernelStorageCleanService/getChatCacheInfo',
CACHE_CHAT_CLEAR = 'nodeIKernelStorageCleanService/clearChatCacheInfo',
@ -735,6 +735,17 @@ export class NTQQApi {
});
}
static clearCache(cacheKeys: Array<string> = [ 'tmp', 'hotUpdate' ]) {
console.log(cacheKeys);
return callNTQQApi<any>({
channel: NTQQApiChannel.IPC_UP_3,
methodName: NTQQApiMethod.CACHE_CLEAR,
args: [{
keys: cacheKeys
}, null]
});
}
static getChatCacheList(type: 1 | 2, pageSize: number = 80, pageIndex: number = 0) {
return new Promise<ChatCacheList>((res, rej) => {
callNTQQApi<ChatCacheList>({