import { Injectable } from "@nestjs/common"; import { CoreSystemService } from "../core/CoreSystemService"; /** * 系统服务 - Admin层 * 对应PHP: app\service\admin\sys\SystemService */ @Injectable() export class SystemService { constructor( private readonly coreSystemService: CoreSystemService, ) {} /** * 获取系统基本信息 * @returns 系统信息 */ async getInfo() { return await this.coreSystemService.getInfo(); } /** * 获取域名配置 * @param siteId 站点ID * @returns 域名配置 */ async getUrl(siteId: number) { return await this.coreSystemService.getUrl(siteId); } /** * 获取系统详细信息 * @returns 系统详细信息 */ async getSystemInfo() { return await this.coreSystemService.getSystemInfo(); } /** * 获取系统统计信息 * @returns 统计信息 */ async getSystemStats() { return await this.coreSystemService.getSystemStats(); } /** * 清理系统缓存 * @returns 是否成功 */ async clearCache() { return await this.coreSystemService.clearCache(); } /** * 获取系统配置检查结果 * @returns 检查结果 */ async checkSystemConfig() { return await this.coreSystemService.checkSystemConfig(); } /** * 获取版权信息 * @returns 版权信息 */ async getCopyright() { return await this.coreSystemService.getCopyright(); } /** * 设置版权信息 * @param value 版权信息 * @returns 是否成功 */ async setCopyright(value: Record) { return await this.coreSystemService.setCopyright(value); } /** * 获取系统配置 * @param key 配置键 * @returns 配置值 */ async getConfig(key: string) { return await this.coreSystemService.getConfig(key); } /** * 设置系统配置 * @param key 配置键 * @param value 配置值 * @returns 是否成功 */ async setConfig(key: string, value: any) { return await this.coreSystemService.setConfig(key, value); } /** * 获取系统日志 * @param params 查询参数 * @returns 日志列表 */ async getLogs(params: any) { return await this.coreSystemService.getLogs(params); } /** * 清理系统日志 * @param days 保留天数 * @returns 是否成功 */ async clearLogs(days: number = 30) { return await this.coreSystemService.clearLogs(days); } /** * 获取系统健康状态 * @returns 健康状态 */ async getHealthStatus() { return await this.coreSystemService.getHealthStatus(); } /** * 执行系统维护 * @param action 维护动作 * @returns 维护结果 */ async performMaintenance(action: string) { return await this.coreSystemService.performMaintenance(action); } }