refactor(services): 重构服务文件结构,将服务按功能分类到不同目录
- 将服务文件按功能分类到core、ai、analytics、security等目录 - 修复logger导入路径问题,统一使用相对路径 - 更新相关文件的导入路径引用 - 添加新的批量操作组件导出文件 - 修复dashboard页面中的类型错误 - 添加dotenv依赖到package.json
This commit is contained in:
38
check-services.js
Normal file
38
check-services.js
Normal file
@@ -0,0 +1,38 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const serviceConfigPath = path.join(__dirname, 'server/src/config/serviceConfig.ts');
|
||||
const domainBootstrapPath = path.join(__dirname, 'server/src/core/runtime/DomainBootstrap.ts');
|
||||
|
||||
const serviceConfigContent = fs.readFileSync(serviceConfigPath, 'utf8');
|
||||
const domainBootstrapContent = fs.readFileSync(domainBootstrapPath, 'utf8');
|
||||
|
||||
const serviceNames = [];
|
||||
const regex = /name:\s*'([^']+)'/g;
|
||||
let match;
|
||||
|
||||
while ((match = regex.exec(serviceConfigContent)) !== null) {
|
||||
serviceNames.push(match[1]);
|
||||
}
|
||||
|
||||
console.log(`Total services in SERVICE_CONFIGS: ${serviceNames.length}`);
|
||||
|
||||
const registeredServices = [];
|
||||
const registerRegex = /name:\s*'([^']+)'/g;
|
||||
let registerMatch;
|
||||
|
||||
while ((registerMatch = registerRegex.exec(domainBootstrapContent)) !== null) {
|
||||
registeredServices.push(registerMatch[1]);
|
||||
}
|
||||
|
||||
console.log(`Total services in DomainBootstrap: ${registeredServices.length}`);
|
||||
|
||||
const missingServices = serviceNames.filter(name => !registeredServices.includes(name));
|
||||
|
||||
console.log('\nMissing services in DomainBootstrap:');
|
||||
missingServices.forEach(name => console.log(` - ${name}`));
|
||||
|
||||
const extraServices = registeredServices.filter(name => !serviceNames.includes(name));
|
||||
|
||||
console.log('\nExtra services in DomainBootstrap (not in SERVICE_CONFIGS):');
|
||||
extraServices.forEach(name => console.log(` - ${name}`));
|
||||
Reference in New Issue
Block a user