44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using WorkFlowCheck.BL.Services.Interfaces;
|
|
using WorkFlowCheck.Common.DTO;
|
|
|
|
namespace WorkFlowCheck.API.Controllers
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class SystemController : ControllerBase
|
|
{
|
|
|
|
private readonly ISystemService _systemService;
|
|
|
|
public SystemController(ISystemService systemService)
|
|
{
|
|
_systemService = systemService;
|
|
}
|
|
|
|
[HttpGet("GetDatabaseAndVersionInfo")]
|
|
public async Task<ApiResponseDTO<string>> GetDatabaseAndVersionInfo()
|
|
{
|
|
var retVal = new ApiResponseDTO<string>()
|
|
{
|
|
IsSuccess = true,
|
|
};
|
|
var result = await _systemService.GetDatabaseAndVersionInfoAsync();
|
|
|
|
if (result != null)
|
|
{
|
|
retVal.IsSuccess = true;
|
|
retVal.Data = result;
|
|
}
|
|
else
|
|
{
|
|
retVal.IsSuccess = false;
|
|
retVal.Errors.Add("No data!");
|
|
}
|
|
|
|
return retVal;
|
|
}
|
|
}
|
|
}
|