feat: 添加VS项目

main
wanggaofeng 1 year ago
parent fea96c45bd
commit 339fac6010

@ -0,0 +1,7 @@
namespace HttpClientStudy.Core
{
public class Class1
{
}
}

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\HttpClientStudy.Model\HttpClientStudy.Model.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,7 @@
namespace HttpClientStudy.Model
{
public class Class1
{
}
}

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HttpClientStudy.Core\HttpClientStudy.Core.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,11 @@
namespace HttpClientStudy.UnitTest
{
public class UnitTest1
{
[Fact]
public void Test1()
{
}
}
}

@ -0,0 +1,33 @@
using Microsoft.AspNetCore.Mvc;
namespace HttpClientStudy.WebApp.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();
}
}
}

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HttpClientStudy.Core\HttpClientStudy.Core.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,6 @@
@HttpClientStudy.WebApp_HostAddress = http://localhost:5189
GET {{HttpClientStudy.WebApp_HostAddress}}/weatherforecast/
Accept: application/json
###

@ -0,0 +1,34 @@
namespace HttpClientStudy.WebApp
{
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseAuthorization();
app.MapControllers();
app.Run();
}
}
}

@ -0,0 +1,31 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:24286",
"sslPort": 0
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5189",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

@ -0,0 +1,13 @@
namespace HttpClientStudy.WebApp
{
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; }
}
}

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

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

@ -0,0 +1,43 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34330.188
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HttpClientStudy.Core", "HttpClientStudy.Core\HttpClientStudy.Core.csproj", "{FFE91C0C-A652-471A-8740-E30E1CD8CE43}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HttpClientStudy.Model", "HttpClientStudy.Model\HttpClientStudy.Model.csproj", "{E1FB0047-B5D7-48D5-9220-21E01592FF03}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HttpClientStudy.WebApp", "HttpClientStudy.WebApp\HttpClientStudy.WebApp.csproj", "{D073CC8A-FB75-4957-AF64-5A2C695D93E6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HttpClientStudy.UnitTest", "HttpClientStudy.UnitTest\HttpClientStudy.UnitTest.csproj", "{A64DAAE3-9FDA-4B37-AE87-FA0812DBF5A9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FFE91C0C-A652-471A-8740-E30E1CD8CE43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFE91C0C-A652-471A-8740-E30E1CD8CE43}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFE91C0C-A652-471A-8740-E30E1CD8CE43}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFE91C0C-A652-471A-8740-E30E1CD8CE43}.Release|Any CPU.Build.0 = Release|Any CPU
{E1FB0047-B5D7-48D5-9220-21E01592FF03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1FB0047-B5D7-48D5-9220-21E01592FF03}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1FB0047-B5D7-48D5-9220-21E01592FF03}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1FB0047-B5D7-48D5-9220-21E01592FF03}.Release|Any CPU.Build.0 = Release|Any CPU
{D073CC8A-FB75-4957-AF64-5A2C695D93E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D073CC8A-FB75-4957-AF64-5A2C695D93E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D073CC8A-FB75-4957-AF64-5A2C695D93E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D073CC8A-FB75-4957-AF64-5A2C695D93E6}.Release|Any CPU.Build.0 = Release|Any CPU
{A64DAAE3-9FDA-4B37-AE87-FA0812DBF5A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A64DAAE3-9FDA-4B37-AE87-FA0812DBF5A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A64DAAE3-9FDA-4B37-AE87-FA0812DBF5A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A64DAAE3-9FDA-4B37-AE87-FA0812DBF5A9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F88C0CDB-806E-4AC6-A3BD-A60964216F23}
EndGlobalSection
EndGlobal
Loading…
Cancel
Save