mirror of
https://github.com/nsnail/IGeekFan.AspNetCore.Knife4jUI.git
synced 2025-08-03 05:47:59 +08:00
打包最新的前端,升级.NET7.0
This commit is contained in:
@ -0,0 +1,95 @@
|
||||
using Knife4jUIDemo;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace AspNetCore6Api.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Get<65><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Get<65><74><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("api/WeatherForecast/[action]")]
|
||||
public class WeatherForecastController : ControllerBase
|
||||
{
|
||||
private static readonly string[] Summaries = new[]
|
||||
{
|
||||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
|
||||
};
|
||||
|
||||
private readonly ILogger<WeatherForecastController> _logger;
|
||||
|
||||
public WeatherForecastController(ILogger<WeatherForecastController> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <20>õ<EFBFBD>һ<EFBFBD><D2BB>ErrorCode
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ErrorCode GetErrorCode()
|
||||
{
|
||||
return ErrorCode.Success;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public ErrorCode GetErrorCode2(ErrorCode errorCode)
|
||||
{
|
||||
return errorCode;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult GetErrorCode4(ErrorCode errorCode)
|
||||
{
|
||||
return new JsonResult(new PostErrorCodeDto() { Message = "a", ErrorCode = errorCode });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Post
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public PostErrorCodeDto PostErrorCode([FromBody] PostErrorCodeDto PostErrorCodeDto)
|
||||
{
|
||||
return PostErrorCodeDto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>Get<65><74><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public IEnumerable<WeatherForecast> Get()
|
||||
{
|
||||
var rng = new Random();
|
||||
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
|
||||
{
|
||||
Date = DateTime.Now.AddDays(index),
|
||||
TemperatureC = rng.Next(-20, 55),
|
||||
Summary = Summaries[rng.Next(Summaries.Length)]
|
||||
})
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
|
||||
/// </summary>
|
||||
public class PostErrorCodeDto
|
||||
{
|
||||
/// <summary>
|
||||
/// <20>쳣<EFBFBD><ECB3A3>Ϣ
|
||||
/// </summary>
|
||||
public string Message { get; set; }
|
||||
|
||||
public WeatherForecast WeatherForecast { get; set; }
|
||||
/// <summary>
|
||||
/// ״̬<D7B4><CCAC>
|
||||
/// </summary>
|
||||
public ErrorCode ErrorCode { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user