add test api
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user