添加项目

main
wanggaofeng 4 months ago
parent 00bd7b405d
commit a7ce33dd5f

@ -0,0 +1,22 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace HttpClientStudy.WebClient.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
public class CallApiController : ControllerBase
{
private readonly ILogger<CallApiController> _logger;
public CallApiController(ILogger<CallApiController> logger)
{
_logger = logger;
}
[HttpGet]
public IActionResult Ping()
{
return Ok("ping");
}
}
}

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

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

@ -0,0 +1,23 @@
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:52546",
"sslPort": 0
}
},
"profiles": {
"WebClient": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5188",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

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

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

@ -18,7 +18,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{56D9132E-6
Docs\说明.md = Docs\说明.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HttpClientStudy.Config", "HttpClientStudy.Config\HttpClientStudy.Config.csproj", "{78FCC8F1-C196-4D4F-81A0-D0A1E0843AAE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HttpClientStudy.Config", "HttpClientStudy.Config\HttpClientStudy.Config.csproj", "{78FCC8F1-C196-4D4F-81A0-D0A1E0843AAE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HttpClientStudy.WebClient", "HttpClientStudy.WebClient\HttpClientStudy.WebClient.csproj", "{40EFD636-C7A1-4AB1-A364-E044FBF9CF50}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -50,6 +52,10 @@ Global
{78FCC8F1-C196-4D4F-81A0-D0A1E0843AAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78FCC8F1-C196-4D4F-81A0-D0A1E0843AAE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78FCC8F1-C196-4D4F-81A0-D0A1E0843AAE}.Release|Any CPU.Build.0 = Release|Any CPU
{40EFD636-C7A1-4AB1-A364-E044FBF9CF50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{40EFD636-C7A1-4AB1-A364-E044FBF9CF50}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40EFD636-C7A1-4AB1-A364-E044FBF9CF50}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40EFD636-C7A1-4AB1-A364-E044FBF9CF50}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Loading…
Cancel
Save