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.
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace HttpClientStudy.WebApp.Controllers
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Polly V8 控制器
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Route("api/[controller]/[action]")]
|
|
|
|
|
[ApiController]
|
|
|
|
|
public class Polly8Controller : ControllerBase
|
|
|
|
|
{
|
|
|
|
|
private readonly ILogger<Polly8Controller> _logger;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 构造
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="logger">日志</param>
|
|
|
|
|
public Polly8Controller(ILogger<Polly8Controller> logger)
|
|
|
|
|
{
|
|
|
|
|
_logger = logger;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 重试策略异常
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
public ActionResult Retry_Exception()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return BadRequest("服务器错误");
|
|
|
|
|
//throw new HttpRequestException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|