using Furion.DependencyInjection; using Furion.DynamicApiController; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Threading.Tasks; namespace GDZZ.Core.Service; /// /// 服务器信息服务 /// [AllowAnonymous] [ApiDescriptionSettings(Name = "Machine", Order = 100)] public class MachineService : IMachineService, IDynamicApiController, ITransient { public MachineService() { } /// /// 获取服务器资源信息 /// /// [HttpGet("/sysMachine/use")] public async Task GetMachineUseInfo() { var useInfo = MachineUtil.GetMachineUseInfo(); return await Task.FromResult(useInfo); } /// /// 获取服务器基本参数 /// /// [HttpGet("/sysMachine/base")] public async Task GetMachineBaseInfo() { return await MachineUtil.GetMachineBaseInfo(); } /// /// 动态获取网络信息 /// /// [HttpGet("/sysMachine/network")] public async Task GetMachineNetWorkInfo() { var baseInfo = MachineUtil.GetMachineNetWorkInfo(); return await Task.FromResult(baseInfo); } }