测试の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 = [
{ path: '/api/sample', name: '测试模块', controller: sampleController },
{ path: '/public', name: '文件模块', controller: imageController },
{ path: '/test', name: '测试', controller: testController },
{ path: '/api/test', name: '测试', controller: testController },
{ 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 logger from '../../utils/core/logger';
class TestService {
public async test() {
try {
const testData = { type: 'test', data: '114514' };
await wsClientManager.send('test', JSON.stringify(testData));
return { message: 'ok' };
const testData = {
type: 'getGroupInfo',
data: {
botId: 'stdin',
groupId: 'stdin',
},
};
return await wsClientManager.sendAndWait('test', testData);
} catch (err) {
logger.error(err);
}

View File

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