28 lines
865 B
C#
28 lines
865 B
C#
using Apimanager_backend.Dtos;
|
|
using Apimanager_backend.Services;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace Apimanager_backend.Controllers
|
|
{
|
|
[Route("api/[controller]/[action]")]
|
|
[ApiController]
|
|
public class SystemInfoController : ControllerBase
|
|
{
|
|
private readonly ISystemInfoService _systemInfoService;
|
|
public SystemInfoController(ISystemInfoService systemInfoService)
|
|
{
|
|
_systemInfoService = systemInfoService;
|
|
}
|
|
[HttpGet]
|
|
[Authorize(Roles = "Admin")]
|
|
public async Task<IActionResult> GetInfo()
|
|
{
|
|
var info = await _systemInfoService.GetSystemInfoAsync();
|
|
var res = new ResponseBase<SystemInfoDto>(1000,"查询成功",info);
|
|
return Ok(res);
|
|
}
|
|
}
|
|
}
|