zuohuaijun 4 лет назад
Родитель
Сommit
3e8094e358

+ 86 - 0
Admin.NET/Admin.NET.Application/Service/TestService.cs

@@ -69,4 +69,90 @@ public class TestService : IDynamicApiController, ITransient
 
         return $"当前语言【{b.Culture.Name}】 {b1}";
     }
+
+    /// <summary>
+    /// 测试 Markdown
+    /// </summary>
+    /// <remarks>
+    /// # 先知 / Furion ([探索版](https://gitee.com/dotnetchina/Furion/tree/experimental/))
+    ///
+    ///     一个应用程序框架,您可以将它集成到任何.NET/C# 应用程序中。
+    ///
+    /// An application framework that you can integrate into any.NET/C# application.
+    ///
+    /// ## 安装 / Installation
+    ///
+    /// - [Package Manager] (https://www.nuget.org/packages/Furion)
+    ///
+    /// ```powershell
+    /// Install-Package Furion
+    /// ```
+    ///
+    /// - [.NET CLI] (https://www.nuget.org/packages/Furion)
+    ///
+    /// ```powershell
+    /// dotnet add package Furion
+    /// ```
+    ///
+    /// ## 例子 / Examples
+    ///
+    /// 我们在[主页](https://dotnetchina.gitee.io/furion)上有不少例子,这是让您入门的第一个:
+    ///
+    /// We have several examples [on the website] (https://dotnetchina.gitee.io/furion). Here is the first one to get you started:
+    ///
+    /// ```cs
+    /// Serve.Run();
+    ///
+    ///     [DynamicApiController]
+    ///     public class HelloService
+    ///     {
+    ///         public string Say()
+    ///         {
+    ///             return "Hello, Furion";
+    ///         }
+    ///     }
+    /// ```
+    ///
+    /// 打开浏览器访问 `https://localhost:5001`。
+    ///
+    /// Open browser access `https://localhost:5001`.
+    ///
+    /// ## 文档 / Documentation
+    ///
+    /// 您可以在[主页] (https://dotnetchina.gitee.io/furion)或[备份主页](https://furion.icu)找到 Furion 文档。
+    ///
+    /// You can find the Furion documentation[on the website](https://dotnetchina.gitee.io/furion) or [on the backup website](https://furion.icu).
+    ///
+    /// ## 贡献 / Contributing
+    ///
+    /// 该存储库的主要目的是继续发展 Furion 核心,使其更快、更易于使用。 Furion 的开发在[Gitee](https://gitee.com/dotnetchina/Furion) 上公开进行,我们感谢社区贡献错误修复和改进。
+    ///
+    /// 阅读[贡献指南] (https://dotnetchina.gitee.io/furion/docs/contribute)内容,了解如何参与改进 Furion。
+    ///
+    /// The main purpose of this repository is to continue evolving Furion core, making it faster and easier to use.Development of Furion happens in the open on[Gitee] (https://gitee.com/dotnetchina/Furion), and we are grateful to the community for contributing bugfixes and improvements.
+    ///
+    /// Read[contribution documents] (https://dotnetchina.gitee.io/furion/docs/contribute) to learn how you can take part in improving Furion.
+    ///
+    /// ## 许可证 / License
+    ///
+    /// Furion 采用[MulanPSL - 2.0](https://gitee.com/dotnetchina/Furion/blob/master/LICENSE) 开源许可证。
+    ///
+    /// Furion uses the[MulanPSL - 2.0] (https://gitee.com/dotnetchina/Furion/blob/master/LICENSE) open source license.
+    ///
+    /// ```
+    /// Copyright(c) 2020-2022 百小僧, Baiqian Co., Ltd.
+    /// Furion is licensed under Mulan PSL v2.
+    /// You can use this software according to the terms andconditions of the Mulan PSL v2.
+    /// You may obtain a copy of Mulan PSL v2 at:
+    ///             https://gitee.com/dotnetchina/Furion/blob/master/LICENSE
+    /// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUTWARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+    /// See the Mulan PSL v2 for more details.
+    /// ```
+    ///
+    /// </remarks>
+    /// <returns></returns>
+    public string GetDescription()
+    {
+        return "Furion";
+    }
 }

+ 4 - 3
Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj

@@ -25,9 +25,10 @@
   <ItemGroup>
     <PackageReference Include="AspNetCoreRateLimit" Version="4.0.2" />
     <PackageReference Include="Caching.CSRedis" Version="3.8.3" />
-    <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.1.1" />
-    <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.1.1" />
-    <PackageReference Include="Furion.Pure" Version="4.1.1" />
+    <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.1.2" />
+    <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.1.2" />
+    <PackageReference Include="Furion.Pure" Version="4.1.2" />
+    <PackageReference Include="IGeekFan.AspNetCore.Knife4jUI" Version="0.0.11" />
     <PackageReference Include="Magicodes.IE.Excel" Version="2.6.4" />
     <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.7" />
     <PackageReference Include="MySql.Data" Version="8.0.29" />

+ 20 - 1
Admin.NET/Admin.NET.Core/AdminNETConfig.json

@@ -8,9 +8,28 @@
         "Group": "Default",
         "Title": "Admin.NET",
         "Description": "让 .NET 开发更简单、更通用、更流行。前后端分离架构(.NET6/Vue3),开箱即用紧随前沿技术。<br/><a href='https://gitee.com/zuohuaijun/Admin.NET/'>https://gitee.com/zuohuaijun/Admin.NET</a>",
-        "Version": "2.0.0"
+        "Version": "1.0.0",
+        "TermsOfService": "https://dotnetchina.gitee.io/furion/",
+        "Contact": {
+          "Name": "zuohuaijun",
+          "Url": "https://gitee.com/zuohuaijun/Admin.NET",
+          "Email": "515096995@qq.com"
+        }
+      },
+      {
+        "Group": "All Groups",
+        "Title": "Admin.NET",
+        "Description": "让 .NET 开发更简单、更通用、更流行。前后端分离架构(.NET6/Vue3),开箱即用紧随前沿技术。<br/><a href='https://gitee.com/zuohuaijun/Admin.NET/'>https://gitee.com/zuohuaijun/Admin.NET</a>",
+        "Version": "1.0.0",
+        "TermsOfService": "https://dotnetchina.gitee.io/furion/",
+        "Contact": {
+          "Name": "zuohuaijun",
+          "Url": "https://gitee.com/zuohuaijun/Admin.NET",
+          "Email": "515096995@qq.com"
+        }
       }
     ],
+    "EnableAllGroups": true,
     "LoginInfo": {
       "Enabled": false, // 是否开启Swagger登录
       "CheckUrl": "/Swagger/CheckUrl",

+ 1 - 1
Admin.NET/Admin.NET.UnitTest/Admin.NET.UnitTest.csproj

@@ -8,7 +8,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Furion.Pure.Xunit" Version="4.1.1" />
+    <PackageReference Include="Furion.Pure.Xunit" Version="4.1.2" />
     <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.7" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
     <PackageReference Include="xunit" Version="2.4.1" />

+ 9 - 1
Admin.NET/Admin.NET.Web.Core/Startup.cs

@@ -1,6 +1,7 @@
 using Admin.NET.Core;
 using AspNetCoreRateLimit;
 using Furion;
+using IGeekFan.AspNetCore.Knife4jUI;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.Extensions.DependencyInjection;
@@ -172,7 +173,14 @@ public class Startup : AppStartup
         app.UseAuthentication();
         app.UseAuthorization();
 
-        app.UseInject();
+        // 配置Swagger-Knife4UI
+        app.UseKnife4UI(c =>
+        {
+            c.RoutePrefix = "";
+            c.SwaggerEndpoint($"/swagger/All Groups/swagger.json", "接口文档");
+        });
+
+        app.UseInject(string.Empty);
 
         app.UseEndpoints(endpoints =>
         {

+ 2 - 2
Admin.NET/Admin.NET.Web.Entry/Properties/launchSettings.json

@@ -11,7 +11,7 @@
     "IIS Express": {
       "commandName": "IISExpress",
       "launchBrowser": true,
-      "launchUrl": "api",
+      "launchUrl": "",
       "environmentVariables": {
         "ASPNETCORE_ENVIRONMENT": "Development"
       }
@@ -20,7 +20,7 @@
       "commandName": "Project",
       "dotnetRunMessages": "true",
       "launchBrowser": true,
-      "launchUrl": "api",
+      "launchUrl": "",
       "applicationUrl": "https://localhost:44326;http://localhost:5000",
       "environmentVariables": {
         "ASPNETCORE_ENVIRONMENT": "Development"