using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System; using AyaNova.Util; using AyaNova.Biz; namespace AyaNova.Api.Controllers { /// /// Meta controller class /// [ApiVersion("8.0")] [Route("api/v{version:apiVersion}/")] public class ApiMetaController : Controller { private readonly ILogger _log; /// /// /// /// public ApiMetaController(ILogger logger) { _log = logger; } /// /// AyaNova API documentation and manual /// /// [HttpGet] public ContentResult Index() { var resp = $@" AyaNova server

{AyaNovaVersion.FullNameAndVersion}

AyaNova Client

AyaNova manual

API explorer

Email AyaNova support

{LocaleBiz.GetDefaultLocalizedText("HelpLicense").Result}

{AyaNova.Core.License.LicenseInfo}

Schema version

{AySchema.currentSchema.ToString()}

Server time

{DateUtil.ServerDateTimeString(System.DateTime.UtcNow)}
{TimeZoneInfo.Local.Id}

Server logs

{ServerBootConfig.AYANOVA_LOG_PATH}
"; return new ContentResult { ContentType = "text/html", StatusCode = 200, Content = resp }; } #if (DEBUG) /// /// Get build mode of server, used for automated testing purposes /// /// Required roles: Any /// /// /// "DEBUG" or "RELEASE" [HttpGet("BuildMode")] public ActionResult BuildMode() { return Ok(new { result = new { BuildMode = "DEBUG" } }); } #else /// /// Get build mode of server, used for automated testing purposes /// /// Required roles: Any /// /// /// "DEBUG" or "RELEASE" [HttpGet("BuildMode")] public ActionResult BuildMode() { return Ok(new { result = new { BuildMode = "RELEASE" } }); } #endif } }