添加项目文件。
This commit is contained in:
25
Atomx.WebAPI/Controllers/AreaController.cs
Normal file
25
Atomx.WebAPI/Controllers/AreaController.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Atomx.WebAPI.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 国家地区省份API
|
||||
/// </summary>
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class AreaController : ControllerBase
|
||||
{
|
||||
public AreaController() { }
|
||||
|
||||
/// <summary>
|
||||
/// 获取国家列表信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("country")]
|
||||
public IActionResult GetCountry()
|
||||
{
|
||||
return new ContentResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Atomx.WebAPI/Controllers/SignController.cs
Normal file
33
Atomx.WebAPI/Controllers/SignController.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Atomx.WebAPI.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 登录注册API
|
||||
/// </summary>
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class SignController : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 登录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("sign/in")]
|
||||
public IActionResult SignIn()
|
||||
{
|
||||
return new ContentResult();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注册
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("sign/up")]
|
||||
public IActionResult SignUp()
|
||||
{
|
||||
return new ContentResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
26
Atomx.WebAPI/Controllers/WeatherForecastController.cs
Normal file
26
Atomx.WebAPI/Controllers/WeatherForecastController.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Atomx.WebAPI.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class WeatherForecastController : ControllerBase
|
||||
{
|
||||
private static readonly string[] Summaries =
|
||||
[
|
||||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
|
||||
];
|
||||
|
||||
[HttpGet(Name = "GetWeatherForecast")]
|
||||
public IEnumerable<WeatherForecast> Get()
|
||||
{
|
||||
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
|
||||
{
|
||||
Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
|
||||
TemperatureC = Random.Shared.Next(-20, 55),
|
||||
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
|
||||
})
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user