From f08c8162865b5164d07143aee25fd5708a27ba4e Mon Sep 17 00:00:00 2001 From: Misa Liu Date: Tue, 27 Feb 2024 19:58:10 +0800 Subject: [PATCH] feat: Add `clearCache` to NTQQApi --- src/ntqqapi/ntcall.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ntqqapi/ntcall.ts b/src/ntqqapi/ntcall.ts index 4a6543c..303b7a3 100644 --- a/src/ntqqapi/ntcall.ts +++ b/src/ntqqapi/ntcall.ts @@ -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 = [ 'tmp', 'hotUpdate' ]) { + console.log(cacheKeys); + return callNTQQApi({ + 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((res, rej) => { callNTQQApi({