34 lines
687 B
C#
34 lines
687 B
C#
using Core;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace WebApi.Controllers;
|
|
|
|
public class XiaoController : BaseController
|
|
{
|
|
private readonly ILogger<XiaoController> _logger;
|
|
|
|
public XiaoController(ILogger<XiaoController> logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
[HttpGet]
|
|
public async Task<string> GotoHomeGame()
|
|
{
|
|
await WxNotify.SendCommonAsync("接收到启动游戏机指令");
|
|
|
|
var commands = new[]
|
|
{
|
|
"grub-reboot 2",
|
|
"reboot"
|
|
};
|
|
|
|
_ = Task.Run(async () =>
|
|
{
|
|
await Task.Delay(3000);
|
|
_ = await Command.ExecAsync(commands);
|
|
});
|
|
|
|
return "OK";
|
|
}
|
|
} |