添加项目文件。
This commit is contained in:
56
Atomx.Storage/Controllers/UploadController.cs
Normal file
56
Atomx.Storage/Controllers/UploadController.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using Atomx.Data;
|
||||
using Atomx.Data.Services;
|
||||
using Atomx.Storage.Services;
|
||||
using MapsterMapper;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Atomx.Storage.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class UploadController : ControllerBase
|
||||
{
|
||||
readonly ILogger<UploadController> _logger;
|
||||
readonly IIdentityService _identityService;
|
||||
readonly IIdCreatorService _idCreator;
|
||||
readonly IMapper _mapper;
|
||||
readonly DataContext _dbContext;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="logger"></param>
|
||||
/// <param name="identityService"></param>
|
||||
/// <param name="idCreator"></param>
|
||||
/// <param name="adminService"></param>
|
||||
/// <param name="mapper"></param>
|
||||
public UploadController(ILogger<UploadController> logger, IIdentityService identityService, IIdCreatorService idCreator, IMapper mapper, DataContext dataContext)
|
||||
{
|
||||
_logger = logger;
|
||||
_identityService = identityService;
|
||||
_idCreator = idCreator;
|
||||
_mapper = mapper;
|
||||
_dbContext = dataContext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传图片
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("image")]
|
||||
public IActionResult Images()
|
||||
{
|
||||
return Ok("Upload Service");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传文件
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost("file")]
|
||||
public IActionResult File()
|
||||
{
|
||||
return Ok("Upload Service");
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Atomx.Storage/Controllers/WeatherForecastController.cs
Normal file
33
Atomx.Storage/Controllers/WeatherForecastController.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Atomx.Storage.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
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;
|
||||
}
|
||||
|
||||
[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