测试のget接口

This commit is contained in:
Jerry 2025-05-03 10:32:54 +08:00
parent c024051db8
commit b950e57e20
3 changed files with 10 additions and 6 deletions

View File

@ -26,7 +26,7 @@ const apps = {
const modules = [ const modules = [
{ path: '/api/sample', name: '测试模块', controller: sampleController }, { path: '/api/sample', name: '测试模块', controller: sampleController },
{ path: '/public', name: '文件模块', controller: imageController }, { path: '/public', name: '文件模块', controller: imageController },
{ path: '/test', name: '测试', controller: testController }, { path: '/api/test', name: '测试', controller: testController },
{ path: '/api/bot', name: '寄气人模块', controller: BotController }, { path: '/api/bot', name: '寄气人模块', controller: BotController },
]; ];

View File

@ -1,13 +1,17 @@
import wsServer from '../../services/ws/wsServer';
import wsClientManager from '../../services/ws/wsClientManager'; import wsClientManager from '../../services/ws/wsClientManager';
import logger from '../../utils/core/logger'; import logger from '../../utils/core/logger';
class TestService { class TestService {
public async test() { public async test() {
try { try {
const testData = { type: 'test', data: '114514' }; const testData = {
await wsClientManager.send('test', JSON.stringify(testData)); type: 'getGroupInfo',
return { message: 'ok' }; data: {
botId: 'stdin',
groupId: 'stdin',
},
};
return await wsClientManager.sendAndWait('test', testData);
} catch (err) { } catch (err) {
logger.error(err); logger.error(err);
} }

View File

@ -9,7 +9,7 @@ const execAsync = promisify(exec);
class AutoUpdater { class AutoUpdater {
private git: SimpleGit; private git: SimpleGit;
private repoPath: string; private readonly repoPath: string;
constructor() { constructor() {
this.git = simpleGit(); this.git = simpleGit();