mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-10 17:26:38 +08:00
缓存框架
This commit is contained in:
@@ -3,6 +3,8 @@ import type {
|
||||
AdminUser,
|
||||
AuthSource,
|
||||
AuthSourceRequest,
|
||||
CacheConfig,
|
||||
CacheStatus,
|
||||
CreateScheduleRequest,
|
||||
CreateSystemConfigRequest,
|
||||
CreateTemplateRequest,
|
||||
@@ -28,7 +30,7 @@ import type {
|
||||
UpdateUserStatusRequest,
|
||||
} from './types';
|
||||
|
||||
export type { AdminUser } from './types';
|
||||
export type { AdminUser, CacheStatus, CacheConfig } from './types';
|
||||
|
||||
/**
|
||||
* 管理员服务
|
||||
@@ -133,7 +135,7 @@ export class AdminService extends BaseService {
|
||||
}): Promise<{ success: boolean; log: string; error: string }> {
|
||||
return this.post<{ success: boolean; log: string; error: string }>('/system-configs/smtp/test', request);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有已存在的文件业务类型及默认内置类型列表
|
||||
* @returns 业务类型列表
|
||||
@@ -506,4 +508,27 @@ export class AdminService extends BaseService {
|
||||
static async deleteTemplate(key: string): Promise<void> {
|
||||
return this.delete<void>(`/templates/${ key }`);
|
||||
}
|
||||
|
||||
// ==================== 磁盘缓存管理 ====================
|
||||
|
||||
/**
|
||||
* 获取磁盘缓存状态与当前统计数据
|
||||
*/
|
||||
static async getCacheStatus(): Promise<CacheStatus> {
|
||||
return this.get<CacheStatus>('/cache/status');
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新磁盘缓存策略配置
|
||||
*/
|
||||
static async updateCacheConfig(config: CacheConfig): Promise<void> {
|
||||
return this.post<void>('/cache/config', config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 一键清空所有磁盘缓存数据
|
||||
*/
|
||||
static async clearCache(): Promise<void> {
|
||||
return this.post<void>('/cache/clear');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user