| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | <Project Sdk="Microsoft.NET.Sdk.Web"> | |
| 2 | 2 | ||
| 3 | 3 | <PropertyGroup> | |
| 4 | - <TargetFramework>netcoreapp2.2</TargetFramework> | ||
| 4 | + <TargetFramework>netcoreapp3.1</TargetFramework> | ||
| 5 | 5 | </PropertyGroup> | |
| 6 | 6 | ||
| 7 | 7 | <ItemGroup> | |
@@ -19,18 +19,15 @@ | |||
| 19 | 19 | </ItemGroup> | |
| 20 | 20 | ||
| 21 | 21 | <ItemGroup> | |
| 22 | - <PackageReference Include="AspectCore.Extensions.Reflection" Version="1.2.0" /> | ||
| 23 | - <PackageReference Include="Microsoft.AspNetCore.App" /> | ||
| 24 | - <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.2.0" /> | ||
| 22 | + <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.4" /> | ||
| 25 | 23 | <PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" /> | |
| 26 | 24 | <PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.2.0" /> | |
| 27 | 25 | <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Https" Version="2.2.0" /> | |
| 28 | - <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" /> | ||
| 29 | - <PackageReference Include="MySql.Data" Version="8.0.15" /> | ||
| 30 | - <PackageReference Include="Oracle.ManagedDataAccess.Core" Version="2.18.6" /> | ||
| 31 | - <PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" /> | ||
| 32 | - <PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="4.0.1" /> | ||
| 33 | - <PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="4.0.1" /> | ||
| 26 | + <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.3" /> | ||
| 27 | + | ||
| 28 | + <PackageReference Include="Swashbuckle.AspNetCore" Version="5.4.1" /> | ||
| 29 | + <PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="5.4.1" /> | ||
| 30 | + <PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="5.4.1" /> | ||
| 34 | 31 | </ItemGroup> | |
| 35 | 32 | ||
| 36 | 33 | <ItemGroup> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,6 +12,7 @@ | |||
| 12 | 12 | using Microsoft.Extensions.Configuration; | |
| 13 | 13 | using Microsoft.Extensions.DependencyInjection; | |
| 14 | 14 | using Microsoft.IdentityModel.Tokens; | |
| 15 | + using Microsoft.OpenApi.Models; | ||
| 15 | 16 | using Swashbuckle.AspNetCore.Swagger; | |
| 16 | 17 | ||
| 17 | 18 | public class Startup | |
@@ -46,10 +47,10 @@ public void ConfigureServices(IServiceCollection services) | |||
| 46 | 47 | .AllowAnyHeader() | |
| 47 | 48 | .AllowAnyMethod().AllowCredentials() | |
| 48 | 49 | )); | |
| 49 | - services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); | ||
| 50 | + services.AddControllers(); | ||
| 50 | 51 | services.AddSwaggerGen(c => | |
| 51 | 52 | { | |
| 52 | - c.SwaggerDoc("v1", new Info { Title = "APIJSON.NET", Version = "v1" }); | ||
| 53 | + c.SwaggerDoc("v1", new OpenApiInfo { Title = "APIJSON.NET", Version = "v1" }); | ||
| 53 | 54 | }); | |
| 54 | 55 | services.AddSingleton<DbContext>(); | |
| 55 | 56 | services.AddSingleton<SelectTable>(); | |
@@ -61,17 +62,12 @@ public void ConfigureServices(IServiceCollection services) | |||
| 61 | 62 | } | |
| 62 | 63 | ||
| 63 | 64 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | |
| 64 | - public void Configure(IApplicationBuilder app, IHostingEnvironment env) | ||
| 65 | + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | ||
| 65 | 66 | { | |
| 66 | 67 | ||
| 67 | 68 | app.UseAuthentication(); | |
| 68 | 69 | ||
| 69 | - app.UseMvc(routes => | ||
| 70 | - { | ||
| 71 | - routes.MapRoute( | ||
| 72 | - name: "default", | ||
| 73 | - template: "{controller=Home}/{action=Index}/{id?}"); | ||
| 74 | - }); | ||
| 70 | + app.UseRouting(); | ||
| 75 | 71 | app.UseStaticFiles(); | |
| 76 | 72 | app.UseCors(_defaultCorsPolicyName); | |
| 77 | 73 | app.UseSwagger(); | |
@@ -80,7 +76,10 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env) | |||
| 80 | 76 | c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); | |
| 81 | 77 | ||
| 82 | 78 | }); | |
| 83 | - | ||
| 79 | + app.UseEndpoints(endpoints => | ||
| 80 | + { | ||
| 81 | + endpoints.MapControllers(); | ||
| 82 | + }); | ||
| 84 | 83 | app.UseJwtTokenMiddleware(); | |
| 85 | 84 | DbInit.Initialize(app); | |
| 86 | 85 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,9 +18,9 @@ | |||
| 18 | 18 | </ItemGroup> | |
| 19 | 19 | ||
| 20 | 20 | <ItemGroup> | |
| 21 | - <PackageReference Include="AspectCore.Extensions.Reflection" Version="1.1.0" /> | ||
| 22 | - <PackageReference Include="Microsoft.Extensions.Options" Version="2.1.1" /> | ||
| 23 | - <PackageReference Include="sqlSugarCore" Version="5.0.0.9" /> | ||
| 21 | + <PackageReference Include="AspectCore.Extensions.Reflection" Version="2.1.0" /> | ||
| 22 | + <PackageReference Include="Microsoft.Extensions.Options" Version="3.1.4" /> | ||
| 23 | + <PackageReference Include="sqlSugarCore" Version="5.0.0.15" /> | ||
| 24 | 24 | </ItemGroup> | |
| 25 | 25 | ||
| 26 | 26 | <ItemGroup> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments