add test api

This commit is contained in:
2025-06-20 16:43:39 +08:00
parent 3874eb0b80
commit 30f0fe6b58

View File

@@ -17,7 +17,7 @@ public class HolidaysController : ControllerBase
{
_holidayService = holidayService;
}
/// <summary>
/// 保存节假日信息。
/// </summary>
@@ -47,4 +47,13 @@ public class HolidaysController : ControllerBase
{
await _holidayService.DeleteAsync(id);
}
[AllowAnonymous]
[HttpGet("remote-ip")]
public async Task<string> GetRemoteIp()
{
// 获取远程IP地址
var remoteIp = HttpContext.Connection.RemoteIpAddress?.ToString();
return await Task.FromResult(remoteIp);
}
}