You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
744 B
C#
32 lines
744 B
C#
using HttpClientStudy.Core.Utilities;
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace HttpClientStudy.WebClient.Controllers
|
|
{
|
|
[Route("api/[controller]/[action]")]
|
|
[ApiController]
|
|
public class CallApiController : ControllerBase
|
|
{
|
|
private readonly ILogger<CallApiController> _logger;
|
|
public CallApiController(ILogger<CallApiController> logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
[HttpGet]
|
|
public IActionResult Ping()
|
|
{
|
|
_logger.LogInformation("ping");
|
|
return Ok("ping");
|
|
}
|
|
|
|
[HttpGet]
|
|
public IActionResult Exception()
|
|
{
|
|
throw new Exception("异常测试");
|
|
}
|
|
}
|
|
}
|