NapCatQQ source snapshot
This commit is contained in:
commit
f954252a34
1111 files changed
+139867
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { ActionName } from '@/napcat-onebot/action/router';
|
||||
import { OneBotAction } from '../OneBotAction';
|
||||
import { WebUiDataRuntime } from 'napcat-webui-backend/src/helper/Data';
|
||||
import { Type } from '@sinclair/typebox';
|
||||
|
||||
export class SetRestart extends OneBotAction<void, void> {
|
||||
override actionName = ActionName.Reboot;
|
||||
override payloadSchema = Type.Object({});
|
||||
override returnSchema = Type.Null();
|
||||
override actionSummary = '重启服务';
|
||||
override actionDescription = '重启服务';
|
||||
override actionTags = ['系统接口'];
|
||||
override payloadExample = {};
|
||||
override returnExample = null;
|
||||
|
||||
async _handle () {
|
||||
const result = await WebUiDataRuntime.requestRestartProcess();
|
||||
if (!result.result) {
|
||||
throw new Error(result.message || '进程重启失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user