添加项目文件。

This commit is contained in:
2025-12-02 13:10:10 +08:00
parent 93a2382a16
commit 289aa4cbe7
400 changed files with 91177 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0" />
<PackageReference Include="Microsoft.Orleans.Server" Version="9.2.1" />
<PackageReference Include="TickerQ" Version="10.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Atomx.Common\Atomx.Common.csproj" />
<ProjectReference Include="..\Atomx.Data\Atomx.Data.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,6 @@
@Atomx.WebAPI_HostAddress = http://localhost:5241
GET {{Atomx.WebAPI_HostAddress}}/weatherforecast/
Accept: application/json
###

View 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();
}
}
}

View 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();
}
}
}

View 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();
}
}
}

View File

@@ -0,0 +1,27 @@
using Atomx.Common.Entities;
using Atomx.Data;
namespace Atomx.WebAPI.Grains
{
public interface IUserGrain : IGrainWithIntegerKey
{
Task<User> GetUserByName(string name);
}
public class UserGrain : Grain, IUserGrain
{
private readonly ILogger<UserGrain> _logger;
private readonly DataContext _dbContext;
public UserGrain(ILogger<UserGrain> logger, DataContext dbContext)
{
_logger = logger;
_dbContext = dbContext;
}
public Task<User> GetUserByName(string name)
{
throw new NotImplementedException();
}
}
}

21
Atomx.WebAPI/Program.cs Normal file
View File

@@ -0,0 +1,21 @@
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
}
app.UseAuthorization();
app.MapControllers();
app.Run();

View File

@@ -0,0 +1,14 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "http://localhost:5241",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@@ -0,0 +1,13 @@
namespace Atomx.WebAPI
{
public class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string? Summary { get; set; }
}
}

View File

@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

View File

@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}