Skip to content

Commit

Permalink
升级项目模板支持9.0版本
Browse files Browse the repository at this point in the history
  • Loading branch information
zhontai committed Jan 24, 2025
1 parent 2bc3eb9 commit 70decc1
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 29 deletions.
3 changes: 2 additions & 1 deletion templates/app/content/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"sourceVariableName": "AppCode",
"fallbackVariableName": "AppType"
},
"replaces": "__app_code"
"replaces": "__app_code",
"fileRename": "__app_code"
},
"Port": {
"type": "parameter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static partial class DbConsts
/// <summary>
/// 表名前缀
/// </summary>
public const string TableNamePrefix = "app_";
public const string TableNamePrefix = "__app_code_";

/// <summary>
/// 旧表名前缀
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ZhonTai.Admin.Core" Version="9.0.0-preview25012001">
<PackageReference Include="ZhonTai.Admin.Core" Version="9.0.0">
<IsBuild>true</IsBuild>
</PackageReference>
<PackageReference Include="ZhonTai.Admin.Contracts" Version="9.0.0-preview25012001">
<PackageReference Include="ZhonTai.Admin.Contracts" Version="9.0.0">
<IsBuild>true</IsBuild>
</PackageReference>
<!--#if (IsSys) -->
<PackageReference Include="ZhonTai.Admin" Version="9.0.0-preview25012001">
<PackageReference Include="ZhonTai.Admin" Version="9.0.0">
<IsBuild>true</IsBuild>
</PackageReference>
<!--#endif -->
Expand Down
2 changes: 1 addition & 1 deletion templates/app/content/MyApp.Api/Core/Consts/DbKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ public class DbKeys
/// 数据库注册键
/// </summary>
[Description("数据库注册键")]
public static string AppDb { get; set; } = "appdb";
public static string AppDb { get; set; } = "__app_codedb";
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
using MyApp.Api.Contracts.Services.Module.Output;
using MyApp.Api.Contracts.Services.Module;
using MyApp.Api.Contracts.Domain.Module;


#if (!NoTaskScheduler)
using FreeScheduler;
using Newtonsoft.Json;
Expand Down
36 changes: 18 additions & 18 deletions templates/app/content/MyApp.Host/ConfigCenter/dbconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"DbConfig": {
//数据库注册键
"key": "appdb",
"key": "__app_codedb",
//程序集名称,自动获取实体表,为空则通过ConfigureFreeSql自定义配置
////#if (MergeDb && IsSys)
//"assemblyNames": [ "MyApp.Api", "ZhonTai.Admin" ],
Expand Down Expand Up @@ -38,15 +38,15 @@
"createDbConnectionString": "",
////#endif
//建库脚本,复杂建库脚本可放到createdbsql.txt中
//MySql "CREATE DATABASE `appdb` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_general_ci'"
//SqlServer "CREATE DATABASE [appdb]"
//PostgreSQL "CREATE DATABASE \"appdb\" WITH ENCODING = 'UTF8'"
//MySql "CREATE DATABASE `__app_codedb` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_general_ci'"
//SqlServer "CREATE DATABASE [__app_codedb]"
//PostgreSQL "CREATE DATABASE \"__app_codedb\" WITH ENCODING = 'UTF8'"
////#if (DbType == "MySql")
//"createDbSql": "CREATE DATABASE `appdb` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_general_ci'",
//"createDbSql": "CREATE DATABASE `__app_codedb` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_general_ci'",
////#elseif (DbType == "SqlServer")
//"createDbSql": "CREATE DATABASE [appdb]",
//"createDbSql": "CREATE DATABASE [__app_codedb]",
////#elseif (DbType == "PostgreSQL")
//"createDbSql": "CREATE DATABASE \"appdb\" WITH ENCODING = 'UTF8'",
//"createDbSql": "CREATE DATABASE \"__app_codedb\" WITH ENCODING = 'UTF8'",
////#else
"createDbSql": "",
////#endif
Expand Down Expand Up @@ -115,17 +115,17 @@
////#endif

//连接字符串
//MySql "Server=localhost; Port=3306; Database=appdb; Uid=root; Pwd=pwd; Charset=utf8mb4;"
//SqlServer "Data Source=.;Integrated Security=True;Initial Catalog=appdb;Pooling=true;Min Pool Size=1"
//PostgreSQL "Host=localhost;Port=5432;Username=postgres;Password=; Database=appdb;Pooling=true;Minimum Pool Size=1"
//Sqlite "Data Source=|DataDirectory|\\appdb.db; Pooling=true;Min Pool Size=1"
//MySql "Server=localhost; Port=3306; Database=__app_codedb; Uid=root; Pwd=pwd; Charset=utf8mb4;"
//SqlServer "Data Source=.;Integrated Security=True;Initial Catalog=__app_codedb;Pooling=true;Min Pool Size=1"
//PostgreSQL "Host=localhost;Port=5432;Username=postgres;Password=; Database=__app_codedb;Pooling=true;Minimum Pool Size=1"
//Sqlite "Data Source=|DataDirectory|\\__app_codedb.db; Pooling=true;Min Pool Size=1"
//"Oracle" "user id=SYS;password=pwd; data source=//127.0.0.1:1521/XE;Pooling=true;Min Pool Size=1",
////#if (DbType == "MySql")
//"connectionString": "Server=localhost; Port=3306; Database=appdb; Uid=root; Pwd=pwd; Charset=utf8mb4;",
//"connectionString": "Server=localhost; Port=3306; Database=__app_codedb; Uid=root; Pwd=pwd; Charset=utf8mb4;",
////#elseif (DbType == "SqlServer")
//"connectionString": "Data Source=.;Integrated Security=True;Initial Catalog=appdb;Pooling=true;Min Pool Size=1",
//"connectionString": "Data Source=.;Integrated Security=True;Initial Catalog=__app_codedb;Pooling=true;Min Pool Size=1",
////#elseif (DbType == "PostgreSQL")
//"connectionString": "Host=localhost;Port=5432;Username=postgres;Password=; Database=appdb;Pooling=true;Minimum Pool Size=1",
//"connectionString": "Host=localhost;Port=5432;Username=postgres;Password=; Database=__app_codedb;Pooling=true;Minimum Pool Size=1",
////#elseif (DbType == "Oracle")
//"connectionString": "user id=SYS;password=pwd; data source=//127.0.0.1:1521/XE;Pooling=true;Min Pool Size=1",
////#elseif (DbType == "Firebird")
Expand All @@ -147,7 +147,7 @@
////#elseif (DbType == "Xugu")
//"connectionString": "IP=127.0.0.1;DB=SYSTEM;User=SYSDBA;PWD=SYSDBA;Port=5138;AUTO_COMMIT=on;CHAR_SET=UTF8",
////#else
"connectionString": "Data Source=|DataDirectory|\\appdb.db; Pooling=true;Min Pool Size=1",
"connectionString": "Data Source=|DataDirectory|\\__app_codedb.db; Pooling=true;Min Pool Size=1",
////#endif

//指定程序集
Expand All @@ -160,7 +160,7 @@
// //权重
// "Weight": 1,
// //连接字符串
// "ConnectionString": "Data Source=|DataDirectory|\\appdb.db; Pooling=true;Min Pool Size=1"
// "ConnectionString": "Data Source=|DataDirectory|\\__app_codedb.db; Pooling=true;Min Pool Size=1"
//}
],

Expand All @@ -172,8 +172,8 @@

//多数据库
//Core/Consts定义DbKeys枚举
//使用仓储访问 public ModuleRepository(UnitOfWorkManagerCloud muowm) : base(DbKeys.AppDb, muowm)
//使用FreeSqlCloud访问 freeSqlCloud.Use(DbKeys.AppDb);
//使用仓储访问 public ModuleRepository(UnitOfWorkManagerCloud muowm) : base(DbKeys.__app_codedb, muowm)
//使用FreeSqlCloud访问 freeSqlCloud.Use(DbKeys.__app_codedb);
"dbs": [
////#if (!MergeDb && IsSys)
{
Expand Down
2 changes: 1 addition & 1 deletion templates/app/content/MyApp.Host/MyApp.Host.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<!--#endif -->
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="3.116.1" />
<!--#if (!NoApiUI) -->
<PackageReference Include="ZhonTai.ApiUI" Version="9.0.0-preview25012001" />
<PackageReference Include="ZhonTai.ApiUI" Version="9.0.0" />
<!--#endif -->
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using ZhonTai.Admin.Core.Dto;
using MyApp.Api.Contracts.Services.Module.Input;
using MyApp.Api.Contracts.Services.Module.Output;
using Google.Protobuf.WellKnownTypes;

namespace MyApp.Tests.Controllers;

Expand Down
2 changes: 1 addition & 1 deletion templates/app/templates.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>ZhonTai.Template.App</id>
<version>9.0.0-preview25012401</version>
<version>9.0.0</version>
<authors>xiao xue</authors>
<owners>zhon tai</owners>
<projectUrl>https://github.com/zhontai/Admin.Core</projectUrl>
Expand Down

0 comments on commit 70decc1

Please sign in to comment.