mirror of
https://github.com/crystelf/crystelf-core.git
synced 2025-07-04 06:39:18 +00:00
测试のget接口
This commit is contained in:
parent
c024051db8
commit
b950e57e20
@ -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 },
|
||||
];
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ const execAsync = promisify(exec);
|
||||
|
||||
class AutoUpdater {
|
||||
private git: SimpleGit;
|
||||
private repoPath: string;
|
||||
private readonly repoPath: string;
|
||||
|
||||
constructor() {
|
||||
this.git = simpleGit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user