2025-11-01 21:38:55 +08:00
|
|
|
using System.Collections.Generic;
|
2025-11-01 15:40:55 +08:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2020-08-05 15:29:56 +08:00
|
|
|
using SimApi.Communications;
|
|
|
|
|
using SimApi.Helpers;
|
2020-07-05 06:09:02 +08:00
|
|
|
|
2024-03-23 07:29:43 +08:00
|
|
|
namespace SimApi.Controllers;
|
2025-11-01 15:40:55 +08:00
|
|
|
|
2025-11-01 21:38:55 +08:00
|
|
|
public class SimApiCommonController : SimApiBaseController
|
2020-07-05 06:09:02 +08:00
|
|
|
{
|
2024-03-23 07:29:43 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 错误回馈页面
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="code">错误代码</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet("exception/{code:int}")]
|
|
|
|
|
[ApiExplorerSettings(IgnoreApi = true)]
|
|
|
|
|
public SimApiBaseResponse ExceptionHandler(int code)
|
2020-07-05 06:09:02 +08:00
|
|
|
{
|
2024-03-23 07:29:43 +08:00
|
|
|
return new SimApiBaseResponse(code);
|
|
|
|
|
}
|
2020-07-05 06:09:02 +08:00
|
|
|
|
2024-08-19 03:39:35 +08:00
|
|
|
|
2025-11-01 15:40:55 +08:00
|
|
|
[HttpPost, HttpGet]
|
|
|
|
|
public SimApiBaseResponse<Dictionary<string, string>> Versions()
|
|
|
|
|
{
|
|
|
|
|
return new SimApiBaseResponse<Dictionary<string, string>>()
|
|
|
|
|
{
|
|
|
|
|
Data = new Dictionary<string, string>
|
|
|
|
|
{
|
|
|
|
|
{ "SimApi", SimApiUtil.SimApiVersion },
|
|
|
|
|
{ "App", SimApiUtil.AppVersion }
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
2021-05-30 03:35:27 +08:00
|
|
|
}
|