| | |
| | | public partial class _TestController : ControllerBase |
| | | { |
| | | [HttpGet] |
| | | public async Task<IActionResult> DoSomething(int duration) |
| | | public async Task<IActionResult> DoSomething(int duration, string code) |
| | | { |
| | | Barcode b = new("asdasd"); |
| | | var begin = DateTime.Now; |
| | | while ((DateTime.Now - begin).TotalSeconds <= duration) |
| | | { |
| | |
| | | ConsoleExt.WriteLine($"Working {begin:mmssfff} ... {(percent > 1 ? 1 : percent):P0} ...", ConsoleColor.Green); |
| | | } |
| | | Logger.Default.Info($"{begin:mmssfff} completed"); |
| | | return Ok($"{begin:mmssfff} completed"); |
| | | return Ok($"{begin:mmssfff} completed {b.DateCode}"); |
| | | } |
| | | |
| | | [HttpPost] |