Skip to content

Commit f7584dc

Browse files
committed
Merge branch 'master' of https://github.com/liaozb/APIJSON.NET
# Conflicts: # APIJSON.NET/APIJSONCommon/ApiJson.Common.csproj # APIJSON.NET/APIJSONCommon/SelectTable.cs
2 parents 42db861 + 20851c5 commit f7584dc

File tree

3 files changed

+19
-23
lines changed

3 files changed

+19
-23
lines changed

‎APIJSON.NET/APIJSON.NET/APIJSON.NET.csproj‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ProjectSdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
@@ -19,18 +19,15 @@
1919
</ItemGroup>
2020

2121
<ItemGroup>
22-
<PackageReferenceInclude="AspectCore.Extensions.Reflection"Version="1.2.0" />
23-
<PackageReferenceInclude="Microsoft.AspNetCore.App" />
24-
<PackageReferenceInclude="Microsoft.AspNetCore.Authentication.JwtBearer"Version="2.2.0" />
22+
<PackageReferenceInclude="Microsoft.AspNetCore.Authentication.JwtBearer"Version="3.1.4" />
2523
<PackageReferenceInclude="Microsoft.AspNetCore.Cors"Version="2.2.0" />
2624
<PackageReferenceInclude="Microsoft.AspNetCore.Rewrite"Version="2.2.0" />
2725
<PackageReferenceInclude="Microsoft.AspNetCore.Server.Kestrel.Https"Version="2.2.0" />
28-
<PackageReferenceInclude="Microsoft.VisualStudio.Web.CodeGeneration.Design"Version="2.2.3" />
29-
<PackageReferenceInclude="MySql.Data"Version="8.0.15" />
30-
<PackageReferenceInclude="Oracle.ManagedDataAccess.Core"Version="2.18.6" />
31-
<PackageReferenceInclude="Swashbuckle.AspNetCore"Version="4.0.1" />
32-
<PackageReferenceInclude="Swashbuckle.AspNetCore.Annotations"Version="4.0.1" />
33-
<PackageReferenceInclude="Swashbuckle.AspNetCore.Swagger"Version="4.0.1" />
26+
<PackageReferenceInclude="Microsoft.VisualStudio.Web.CodeGeneration.Design"Version="3.1.3" />
27+
28+
<PackageReferenceInclude="Swashbuckle.AspNetCore"Version="5.4.1" />
29+
<PackageReferenceInclude="Swashbuckle.AspNetCore.Annotations"Version="5.4.1" />
30+
<PackageReferenceInclude="Swashbuckle.AspNetCore.Swagger"Version="5.4.1" />
3431
</ItemGroup>
3532

3633
<ItemGroup>

‎APIJSON.NET/APIJSON.NET/Startup.cs‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
usingMicrosoft.Extensions.Configuration;
1313
usingMicrosoft.Extensions.DependencyInjection;
1414
usingMicrosoft.IdentityModel.Tokens;
15+
usingMicrosoft.OpenApi.Models;
1516
usingSwashbuckle.AspNetCore.Swagger;
1617

1718
publicclassStartup
@@ -46,10 +47,10 @@ public void ConfigureServices(IServiceCollection services)
4647
.AllowAnyHeader()
4748
.AllowAnyMethod().AllowCredentials()
4849
));
49-
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
50+
services.AddControllers();
5051
services.AddSwaggerGen(c =>
5152
{
52-
c.SwaggerDoc("v1",newInfo{Title="APIJSON.NET",Version="v1"});
53+
c.SwaggerDoc("v1",newOpenApiInfo{Title="APIJSON.NET",Version="v1"});
5354
});
5455
services.AddSingleton<DbContext>();
5556
services.AddSingleton<SelectTable>();
@@ -61,17 +62,12 @@ public void ConfigureServices(IServiceCollection services)
6162
}
6263

6364
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
64-
publicvoidConfigure(IApplicationBuilderapp,IHostingEnvironmentenv)
65+
publicvoidConfigure(IApplicationBuilderapp,IWebHostEnvironmentenv)
6566
{
6667

6768
app.UseAuthentication();
6869

69-
app.UseMvc(routes =>
70-
{
71-
routes.MapRoute(
72-
name:"default",
73-
template:"{controller=Home}/{action=Index}/{id?}");
74-
});
70+
app.UseRouting();
7571
app.UseStaticFiles();
7672
app.UseCors(_defaultCorsPolicyName);
7773
app.UseSwagger();
@@ -80,7 +76,10 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)
8076
c.SwaggerEndpoint("/swagger/v1/swagger.json","My API V1");
8177

8278
});
83-
79+
app.UseEndpoints(endpoints =>
80+
{
81+
endpoints.MapControllers();
82+
});
8483
app.UseJwtTokenMiddleware();
8584
DbInit.Initialize(app);
8685
}

‎APIJSON.NET/APIJSONCommon/ApiJson.Common.csproj‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
</ItemGroup>
1919

2020
<ItemGroup>
21-
<PackageReferenceInclude="AspectCore.Extensions.Reflection"Version="1.1.0" />
22-
<PackageReferenceInclude="Microsoft.Extensions.Options"Version="2.1.1" />
23-
<PackageReferenceInclude="sqlSugarCore"Version="5.0.0.9" />
21+
<PackageReferenceInclude="AspectCore.Extensions.Reflection"Version="2.1.0" />
22+
<PackageReferenceInclude="Microsoft.Extensions.Options"Version="3.1.4" />
23+
<PackageReferenceInclude="sqlSugarCore"Version="5.0.0.15" />
2424
</ItemGroup>
2525

2626
<ItemGroup>

0 commit comments

Comments
(0)