You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
BookingHeChuan/Myshipping.Core/Service/Monitor/MachineService.cs

53 lines
1.3 KiB
C#

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