Explorar el Código

🤓细节优化:1、调整默认端口 2、优化代码生成模板

zuohuaijun hace 3 años
padre
commit
17ab25b1a7

+ 10 - 0
Admin.NET/Admin.NET.Application/Admin.NET.Application.xml

@@ -4,5 +4,15 @@
         <name>Admin.NET.Application</name>
     </assembly>
     <members>
+        <member name="T:Admin.NET.Application.Const.ApplicationConst">
+            <summary>
+            业务应用相关常量
+            </summary>
+        </member>
+        <member name="F:Admin.NET.Application.Const.ApplicationConst.GroupName">
+            <summary>
+            API分组名称
+            </summary>
+        </member>
     </members>
 </doc>

+ 12 - 0
Admin.NET/Admin.NET.Application/Const/ApplicationConst.cs

@@ -0,0 +1,12 @@
+namespace Admin.NET.Application.Const;
+
+/// <summary>
+/// 业务应用相关常量
+/// </summary>
+public class ApplicationConst
+{
+    /// <summary>
+    /// API分组名称
+    /// </summary>
+    public const string GroupName = "业务应用";
+}

+ 8 - 2
Admin.NET/Admin.NET.Application/GlobalUsings.cs

@@ -1,2 +1,8 @@
-global using Furion;
-global using Microsoft.Extensions.DependencyInjection;
+global using Admin.NET.Core;
+global using Furion;
+global using Furion.DependencyInjection;
+global using Furion.DynamicApiController;
+global using Mapster;
+global using Microsoft.AspNetCore.Mvc;
+global using Microsoft.Extensions.DependencyInjection;
+global using System.Threading.Tasks;

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

@@ -19,13 +19,13 @@
     <PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
     <PackageReference Include="DotNetCore.Natasha.CSharp" Version="5.0.2" />
     <PackageReference Include="FluentEmail.Smtp" Version="3.0.2" />
-    <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.6.2" />
-    <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.6.2" />
-    <PackageReference Include="Furion.Pure" Version="4.8.6.2" />
+    <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.6.3" />
+    <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.6.3" />
+    <PackageReference Include="Furion.Pure" Version="4.8.6.3" />
     <PackageReference Include="Lazy.Captcha.Core" Version="2.0.1" />
     <PackageReference Include="Magicodes.IE.Excel" Version="2.7.4.2" />
     <PackageReference Include="Magicodes.IE.Pdf" Version="2.7.4.2" />
-    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.13" />
+    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.14" />
     <PackageReference Include="NEST" Version="7.17.5" />
     <PackageReference Include="NewLife.Redis" Version="5.1.2023.207-beta0755" />
     <PackageReference Include="OnceMi.AspNetCore.OSS" Version="1.1.9" />

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

@@ -23,7 +23,7 @@
             "dotnetRunMessages": true,
             "launchBrowser": true,
             "launchUrl": "",
-            "applicationUrl": "https://localhost:5001;http://localhost:5000",
+            "applicationUrl": "http://localhost:5005",
             "environmentVariables": {
                 "ASPNETCORE_ENVIRONMENT": "Development"
             }

+ 1 - 4
Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/Dto.cs.vm

@@ -1,7 +1,5 @@
-using System;
+namespace @Model.NameSpace;
 
-namespace @Model.NameSpace
-{
     /// <summary>
     /// @(@Model.BusName)输出参数
     /// </summary>
@@ -24,4 +22,3 @@ if(@column.EffectType == "fk" && @column.FkEntityName != "" && @column.FkColumnN
         @:
 }
     }
-}

+ 3 - 7
Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/Input.cs.vm

@@ -1,10 +1,7 @@
-using System;
-using Admin.NET.Core;
-using System.ComponentModel.DataAnnotations;
-using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+
+namespace @Model.NameSpace;
 
-namespace @Model.NameSpace
-{
     /// <summary>
     /// @(@Model.BusName)输入参数
     /// </summary>
@@ -77,4 +74,3 @@ if (@column.ColumnKey == "True"){
     {
 
     }
-}

+ 4 - 4
Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/Manage.js.vm

@@ -1,9 +1,9 @@
 import request from '/@@/utils/request';
 enum Api {
-  Add@(@Model.ClassName) = '/@(@Model.LowerClassName)/add',
-  Delete@(@Model.ClassName) = '/@(@Model.LowerClassName)/delete',
-  Update@(@Model.ClassName) = '/@(@Model.LowerClassName)/edit',
-  Get@(@Model.ClassName)Page = '/@(@Model.LowerClassName)/page',
+  Add@(@Model.ClassName) = '/api/@(@Model.LowerClassName)/add',
+  Delete@(@Model.ClassName) = '/api/@(@Model.LowerClassName)/delete',
+  Update@(@Model.ClassName) = '/api/@(@Model.LowerClassName)/edit',
+  Get@(@Model.ClassName)Page = '/api/@(@Model.LowerClassName)/page',
   @foreach (var column in Model.TableField){
 if(@column.EffectType == "fk"){
   @:Get@(@column.FkEntityName)Dropdown = '/@(@Model.LowerClassName)/@(@column.FkEntityName)Dropdown',

+ 2 - 9
Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/Output.cs.vm

@@ -1,10 +1,5 @@
-using SqlSugar;
-using Admin.NET.Core;
-using Admin.NET.Core.Service;
-using System.Collections.Generic;
-using System;
-namespace @Model.NameSpace
-{
+namespace @Model.NameSpace;
+
     /// <summary>
     /// @(@Model.BusName)输出参数
     /// </summary>
@@ -57,5 +52,3 @@ if (@column.EffectType == "ApiTreeSelect"){
     @:}
 }
 }
-
-}

+ 0 - 1
Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/Service.cs.vm

@@ -1,6 +1,5 @@
 using @(@Model.NameSpace).Const;
 using @(@Model.NameSpace).Entity;
-using Mapster;
 
 namespace @Model.NameSpace;
 /// <summary>