diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 0000000..8fa45b1
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,24 @@
+
+
+
+
+
+ SmartCode
+ 2019 SmartCode, Inc.
+ $(AssemblyName)
+ Ahoo Wang;ncc
+ ahoowang@qq.com
+ latest
+ https://github.com/Smart-Kit/SmartCode
+ git
+ $(MSBuildThisFileDirectory)
+ https://raw.githubusercontent.com/Smart-Kit/SmartCode/master/doc/Logo.png
+ https://github.com/Smart-Kit/SmartCode
+ True
+ Apache-2.0
+ SmartCode SmartSql
+
+ SmartCode = IDataSource -> IBuildTask -> IOutput => Build Everything!!!
+
+
+
\ No newline at end of file
diff --git a/README-EN.md b/README-EN.md
index d8317d6..99ceae7 100644
--- a/README-EN.md
+++ b/README-EN.md
@@ -10,6 +10,12 @@

+## Nuget Packages
+
+| Package | NuGet Stable | Downloads |
+| ------- | -------- | ------- |
+| [SmartCode.CLI](https://www.nuget.org/packages/SmartCode.CLI/) | [](https://www.nuget.org/packages/SmartCode.CLI/) | [](https://www.nuget.org/packages/SmartCode.CLI/) |
+
## SmartCode.Generator (Code generator)
### Demo
@@ -21,7 +27,7 @@
1. Install from .NET Core Global Tool
``` shell
- dotnet tool install --global SmartCode.CLI
+ dotnet tool install --global SmartCode.CLI
```
2. edit build configuration file (default: SmartCode.yml)
@@ -40,179 +46,211 @@ Module: SmartSql.Starter
Author: Ahoo Wang
DataSource:
Name: DbTable
- Paramters:
- DbName: SmartSqlDB
+ Parameters:
+ DbName: SmartSqlTestDB
DbProvider: SqlServer
- ConnectionString: Data Source=.;Initial Catalog=SmartSqlDB;Integrated Security=True
+ ConnectionString: Data Source=.;Initial Catalog=SmartSqlTestDB;Integrated Security=True
Language: CSharp
-TemplateEngine: Razor
+TemplateEngine:
+ Name: Razor
+ Root: CSharp
Output:
Type: File
- Path: 'E://SmartSql-Starter'
+ Path: 'E:\SmartSql-Starter'
+Parameters:
+ SmartSqlVersion: '4.0.46'
+ SmartSqlSchemaVersion: '4.0.42'
+ BuildDir: 'E:\SmartSql-Starter\build'
+ DockerImage: 'smartsql.starter'
+
+NamingConverter:
+ Table:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ IgnorePrefix: 'T_'
+ Delimiter: '_'
+ Converter:
+ Type: Pascal
+ Parameters: { }
+ View:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ IgnorePrefix: 'V_'
+ Delimiter: '_'
+ Converter:
+ Type: Pascal
+ Column:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ Delimiter: '_'
+ Converter:
+ Type: Pascal
# 构建任务
Build:
- ClearDir:
- Type: Clear
- Paramters:
- Dirs: '.'
+# ClearDir:
+# Type: Clear
+# Parameters:
+# Dirs: '.'
+
+ MakeBuildDir:
+ Type: Process
+ Parameters:
+ FileName: powershell
+ Args: mkdir '{{Project.Parameters.BuildDir}}'
+ Copy:
+ Type: Process
+ Parameters:
+ FileName: powershell
+ Args: cp '{{Project.ConfigPath}}' '{{Project.Parameters.BuildDir}}'
Scaffolding:
Type: MultiTemplate
Output:
Path: '.'
- Paramters:
+ Parameters:
Templates: [{Key: 'Sln.cshtml',Output: {Name: '{{Project.Module}}',Extension: '.sln'}},
- {Key: "Proj-Entity.cshtml",Output: {Path: '{{Project.Module}}.Entity',Name: '{{Project.Module}}.Entity',Extension: '.csproj'}},
- {Key: "Proj-Repository.cshtml",Output: {Path: '{{Project.Module}}.Repository',Name: '{{Project.Module}}.Repository',Extension: '.csproj'}},
- {Key: "Proj-Service.cshtml",Output: {Path: '{{Project.Module}}.Service',Name: '{{Project.Module}}.Service',Extension: '.csproj'}},
- {Key: "Proj-API.cshtml",Output: {Path: '{{Project.Module}}.API',Name: '{{Project.Module}}.API',Extension: '.csproj'}},
- {Key: "API/LaunchSettings.cshtml",Output: {Path: '{{Project.Module}}.API/Properties',Name: 'launchSettings',Extension: '.json'}},
- {Key: "API/AppSettings.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'appsettings',Extension: '.json'}},
- {Key: "API/AppSettings-Development.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'appsettings.Development',Extension: '.json'}},
- {Key: "API/Program.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'Program',Extension: '.cs'}},
- {Key: "API/Startup.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'Startup',Extension: '.cs'}},
- {Key: "API/APIException.cshtml",Output: {Path: '{{Project.Module}}.API/Exceptions',Name: 'APIException',Extension: '.cs'}},
- {Key: "API/GlobalExceptionFilter.cshtml",Output: {Path: '{{Project.Module}}.API/Filters',Name: 'GlobalExceptionFilter',Extension: '.cs'}},
- {Key: "API/GlobalValidateModelFilter.cshtml",Output: {Path: '{{Project.Module}}.API/Filters',Name: 'GlobalValidateModelFilter',Extension: '.cs'}},
- {Key: "API/QueryRequest.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'QueryRequest',Extension: '.cs'}},
- {Key: "API/QueryByPageRequest.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'QueryByPageRequest',Extension: '.cs'}},
- {Key: "API/ResponseMessage.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'ResponseMessage',Extension: '.cs'}},
- {Key: "API/QueryResponse.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'QueryResponse',Extension: '.cs'}},
- {Key: "API/QueryByPageResponse.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'QueryByPageResponse',Extension: '.cs'}},
- {Key: "API/ResponseMessage.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'ResponseMessage',Extension: '.cs'}},
- {Key: "SqlMapConfig.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'SmartSqlMapConfig',Extension: '.xml'}}
- ]
+ {Key: 'Sln-Directory.Build.cshtml',Output: {Name: 'Directory.Build',Extension: '.props'}},
+ {Key: 'Sln-Version.cshtml',Output: {Path: 'build',Name: 'version',Extension: '.props'}},
+ {Key: 'Sln-Dockerfile.cshtml',Output: {Name: 'Dockerfile',Extension: ''}},
+ {Key: 'Sln-DockerIgnore.cshtml',Output: {Name: '.dockerignore',Extension: ''}},
+ {Key: 'Sln-GitIgnore.cshtml',Output: {Name: '.gitignore',Extension: ''}},
+ {Key: "Proj-Entity.cshtml",Output: {Path: 'src/{{Project.Module}}.Entity',Name: '{{Project.Module}}.Entity',Extension: '.csproj'}},
+ {Key: "Proj-Repository.cshtml",Output: {Path: 'src/{{Project.Module}}.Repository',Name: '{{Project.Module}}.Repository',Extension: '.csproj'}},
+ {Key: "Proj-Service.cshtml",Output: {Path: 'src/{{Project.Module}}.Service',Name: '{{Project.Module}}.Service',Extension: '.csproj'}},
+ {Key: "Proj-API.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: '{{Project.Module}}.API',Extension: '.csproj'}},
+ {Key: "API/LaunchSettings.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Properties',Name: 'launchSettings',Extension: '.json'}},
+ {Key: "API/AppSettings.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: 'appsettings',Extension: '.json'}},
+ {Key: "API/AppSettings-Development.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: 'appsettings.Development',Extension: '.json'}},
+ {Key: "API/Program.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: 'Program',Extension: '.cs'}},
+ {Key: "API/Startup.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: 'Startup',Extension: '.cs'}},
+ {Key: "API/APIException.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Exceptions',Name: 'APIException',Extension: '.cs'}},
+ {Key: "API/GlobalExceptionFilter.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Filters',Name: 'GlobalExceptionFilter',Extension: '.cs'}},
+ {Key: "API/GlobalValidateModelFilter.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Filters',Name: 'GlobalValidateModelFilter',Extension: '.cs'}},
+ {Key: "API/QueryRequest.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'QueryRequest',Extension: '.cs'}},
+ {Key: "API/QueryByPageRequest.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'QueryByPageRequest',Extension: '.cs'}},
+ {Key: "API/ResponseMessage.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'ResponseMessage',Extension: '.cs'}},
+ {Key: "API/QueryResponse.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'QueryResponse',Extension: '.cs'}},
+ {Key: "API/QueryByPageResponse.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'QueryByPageResponse',Extension: '.cs'}},
+ {Key: "API/ResponseMessage.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'ResponseMessage',Extension: '.cs'}},
+ {Key: "SqlMapConfig.cshtml",Output: {Path: 'src/{{Project.Module}}.Repository',Name: 'SmartSqlMapConfig',Extension: '.xml'}},
+ {Key: "SqlMapConfig.cshtml",Output: {Path: 'src/{{Project.Module}}.Repository',Name: 'SmartSqlMapConfig.Development',Extension: '.xml'}}]
Entity:
Type: Table
Module: Entity
- Template: Entity.cshtml
+ TemplateEngine:
+ Path: Entity.cshtml
Output:
- Path: '{{Project.Module}}.{{Build.Module}}'
+ Path: 'src/{{Project.Module}}.{{Build.Module}}'
Name: '{{Items.CurrentTable.ConvertedName}}'
Extension: '.cs'
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
- Paramters: { }
- View:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'V_'
- Delimiter: '_'
- Converter:
- Type: Pascal
- Column:
- Tokenizer:
- Type: Default
- Paramters:
- Delimiter: '_'
- Converter:
- Type: Pascal
Repository:
Type: Table
Module: Repository
- Template: Repository.cshtml
+ TemplateEngine:
+ Path: Repository.cshtml
IgnoreNoPKTable: true
IgnoreView: true
Output:
- Path: '{{Project.Module}}.{{Build.Module}}'
+ Path: 'src/{{Project.Module}}.{{Build.Module}}'
Name: 'I{{Items.CurrentTable.ConvertedName}}Repository'
Extension: .cs
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
Service:
Type: Table
Module: Service
- Template: Service.cshtml
+ TemplateEngine:
+ Path: Service.cshtml
IgnoreNoPKTable: true
IgnoreView: true
Output:
- Path: '{{Project.Module}}.{{Build.Module}}'
+ Path: 'src/{{Project.Module}}.{{Build.Module}}'
Name: '{{Items.CurrentTable.ConvertedName}}Service'
Extension: .cs
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
APIController:
Type: Table
Module: API
- Template: API/APIController.cshtml
+ TemplateEngine:
+ Path: API/APIController.cshtml
IgnoreNoPKTable: true
IgnoreView: true
Output:
- Path: '{{Project.Module}}.{{Build.Module}}/Controllers'
+ Path: 'src/{{Project.Module}}.{{Build.Module}}/Controllers'
Name: '{{Items.CurrentTable.ConvertedName}}Controller'
Extension: .cs
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
SqlMap:
Type: Table
- Template: SqlMap.cshtml
+ TemplateEngine:
+ Path: SqlMap.cshtml
Output:
- Path: '{{Project.Module}}.API/Maps'
+ Path: 'src/{{Project.Module}}.Repository/Maps'
Name: '{{Items.CurrentTable.ConvertedName}}'
Extension: .xml
IgnoreNoPKTable: true
IgnoreView: true
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
- View:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'V_'
- Delimiter: '_'
- Converter:
- Type: Pascal
- Column:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
+
+# Please install dotnet-format first!
+# dotnet tool install -g dotnet-format
+ CodeFormat:
+ Type: Process
+ Parameters:
+ FileName: powershell
+ WorkingDirectory: '{{Project.Output.Path}}'
+ Args: dotnet-format
+
+ ReStore:
+ Type: Process
+ Parameters:
+ FileName: powershell
+ WorkingDirectory: '{{Project.Output.Path}}'
+ Args: dotnet restore
+
+# BuildDocker:
+# Type: Process
+# Parameters:
+# FileName: powershell
+# WorkingDirectory: '{{Project.Output.Path}}'
+# Args: docker build -t {{Project.Parameters.DockerImage}}:v1.0.0 .
+
+# RunDocker:
+# Type: Process
+# Parameters:
+# FileName: powershell
+# WorkingDirectory: '{{Project.Output.Path}}'
+# Args: docker run --name {{Project.Parameters.DockerImage}} --rm -d -p 8008:80 {{Project.Parameters.DockerImage}}:v1.0.0 .
+
+# Publish:
+# Type: Process
+# Parameters:
+# FileName: powershell
+# WorkingDirectory: '{{Project.Output.Path}}'
+# Args: dotnet publish -c Release -o '{{Project.Output.Path}}\publish'
+
+# Run:
+# Type: Process
+# Parameters:
+# FileName: powershell
+# WorkingDirectory: '{{Project.Output.Path}}\publish'
+# CreateNoWindow: false
+# RedirectStandardOutput: false
+# RedirectStandardError: false
+# WaitForExit: false
+# WriteLines: ['dotnet {{Project.Module}}.API.dll']
+
+# RunChrome:
+# Type: Process
+# Parameters:
+# FileName: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
+# CreateNoWindow: false
+# Args: http://localhost:8008/swagger
```
### Build file parameter overview
@@ -227,11 +265,11 @@ Build:
| Output | Output |
| Build | Task Build |
-#### DataSource Data Source, Name: Db
+#### DataSource Data Source, Name: DbTable
-> Property Name: Db, using the DbSource plugin as a data source
+> Property Name: DbTable, using the DbTableSource plugin as a data source
-DbSource.Paramters accepts the following three parameters:
+DbTableSource.Parameters accepts the following three parameters:
| Parameter Name | Description |
| :--------- | --------:|
@@ -253,7 +291,7 @@ DbSource.Paramters accepts the following three parameters:
| IncludeTables | Include table name s |
| IgnoreTables | Ignore table name s |
| NamingConverter | Named Converter |
-| Paramters | Custom Build Parameters |
+| Parameters | Custom Build Parameters |
#### NamingConverter Name Conversion
@@ -268,9 +306,9 @@ DbSource.Paramters accepts the following three parameters:
| Attribute | Description |
| :--------- | --------:|
| Type | Default |
-| Paramters.IgnorePrefix | Ignore prefix characters |
-| Paramters.Delimiter | Separator |
-| Paramters.UppercaseSplit | Using uppercase separation, default: true |
+| Parameters.IgnorePrefix | Ignore prefix characters |
+| Parameters.Delimiter | Separator |
+| Parameters.UppercaseSplit | Using uppercase separation, default: true |
### How to contribute a template
@@ -289,13 +327,13 @@ DbSource.Paramters accepts the following three parameters:
Author: Ahoo Wang
DataSource:
Name: Extract
- Paramters:
+ Parameters:
DbProvider: SqlServer
ConnectionString: Data Source=.;Initial Catalog=SmartSqlDB;Integrated Security=True
Query: SELECT [Id],[UserName],[Pwd],[Status],[LastLoginTime],[CreationTime],[Deleted] FROM [T_User] Where Id>@LastMaxId And CreationTime>@LastQueryTime
PKColumn: Id
-Paramters:
+Parameters:
ETLCode: SmartCode.ETL.Test
ETLRepository: PG
@@ -303,12 +341,12 @@ Build:
Transform:
Type: Transform
- Paramters:
+ Parameters:
Script: Load2PostgreSql.cshtml
Load2PostgreSql:
Type: Load
- Paramters:
+ Parameters:
DbProvider: PostgreSql
ConnectionString: Server=localhost;Port=5432;User Id=postgres;Password=SmartSql; Database=smartsql_db;
Table: t_user
diff --git a/README.md b/README.md
index 2b57cad..01b8440 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,12 @@

+## Nuget Packages
+
+| Package | NuGet Stable | Downloads |
+| ------- | -------- | ------- |
+| [SmartCode.CLI](https://www.nuget.org/packages/SmartCode.CLI/) | [](https://www.nuget.org/packages/SmartCode.CLI/) | [](https://www.nuget.org/packages/SmartCode.CLI/) |
+
## SmartCode.Generator (代码生成器)
### Demo
@@ -18,7 +24,7 @@
### Getting Started
-1. Install from .NET Core Global Tool
+1. Install from .NET Core Global Tool
``` shell
dotnet tool install --global SmartCode.CLI
@@ -40,179 +46,211 @@ Module: SmartSql.Starter
Author: Ahoo Wang
DataSource:
Name: DbTable
- Paramters:
- DbName: SmartSqlDB
+ Parameters:
+ DbName: SmartSqlTestDB
DbProvider: SqlServer
- ConnectionString: Data Source=.;Initial Catalog=SmartSqlDB;Integrated Security=True
+ ConnectionString: Data Source=.;Initial Catalog=SmartSqlTestDB;Integrated Security=True
Language: CSharp
-TemplateEngine: Razor
+TemplateEngine:
+ Name: Razor
+ Root: CSharp
Output:
Type: File
- Path: 'E://SmartSql-Starter'
+ Path: 'E:\SmartSql-Starter'
+Parameters:
+ SmartSqlVersion: '4.0.46'
+ SmartSqlSchemaVersion: '4.0.42'
+ BuildDir: 'E:\SmartSql-Starter\build'
+ DockerImage: 'smartsql.starter'
+
+NamingConverter:
+ Table:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ IgnorePrefix: 'T_'
+ Delimiter: '_'
+ Converter:
+ Type: Pascal
+ Parameters: { }
+ View:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ IgnorePrefix: 'V_'
+ Delimiter: '_'
+ Converter:
+ Type: Pascal
+ Column:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ Delimiter: '_'
+ Converter:
+ Type: Pascal
# 构建任务
Build:
- ClearDir:
- Type: Clear
- Paramters:
- Dirs: '.'
+# ClearDir:
+# Type: Clear
+# Parameters:
+# Dirs: '.'
+
+ MakeBuildDir:
+ Type: Process
+ Parameters:
+ FileName: powershell
+ Args: mkdir '{{Project.Parameters.BuildDir}}'
+ Copy:
+ Type: Process
+ Parameters:
+ FileName: powershell
+ Args: cp '{{Project.ConfigPath}}' '{{Project.Parameters.BuildDir}}'
Scaffolding:
Type: MultiTemplate
Output:
Path: '.'
- Paramters:
+ Parameters:
Templates: [{Key: 'Sln.cshtml',Output: {Name: '{{Project.Module}}',Extension: '.sln'}},
- {Key: "Proj-Entity.cshtml",Output: {Path: '{{Project.Module}}.Entity',Name: '{{Project.Module}}.Entity',Extension: '.csproj'}},
- {Key: "Proj-Repository.cshtml",Output: {Path: '{{Project.Module}}.Repository',Name: '{{Project.Module}}.Repository',Extension: '.csproj'}},
- {Key: "Proj-Service.cshtml",Output: {Path: '{{Project.Module}}.Service',Name: '{{Project.Module}}.Service',Extension: '.csproj'}},
- {Key: "Proj-API.cshtml",Output: {Path: '{{Project.Module}}.API',Name: '{{Project.Module}}.API',Extension: '.csproj'}},
- {Key: "API/LaunchSettings.cshtml",Output: {Path: '{{Project.Module}}.API/Properties',Name: 'launchSettings',Extension: '.json'}},
- {Key: "API/AppSettings.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'appsettings',Extension: '.json'}},
- {Key: "API/AppSettings-Development.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'appsettings.Development',Extension: '.json'}},
- {Key: "API/Program.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'Program',Extension: '.cs'}},
- {Key: "API/Startup.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'Startup',Extension: '.cs'}},
- {Key: "API/APIException.cshtml",Output: {Path: '{{Project.Module}}.API/Exceptions',Name: 'APIException',Extension: '.cs'}},
- {Key: "API/GlobalExceptionFilter.cshtml",Output: {Path: '{{Project.Module}}.API/Filters',Name: 'GlobalExceptionFilter',Extension: '.cs'}},
- {Key: "API/GlobalValidateModelFilter.cshtml",Output: {Path: '{{Project.Module}}.API/Filters',Name: 'GlobalValidateModelFilter',Extension: '.cs'}},
- {Key: "API/QueryRequest.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'QueryRequest',Extension: '.cs'}},
- {Key: "API/QueryByPageRequest.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'QueryByPageRequest',Extension: '.cs'}},
- {Key: "API/ResponseMessage.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'ResponseMessage',Extension: '.cs'}},
- {Key: "API/QueryResponse.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'QueryResponse',Extension: '.cs'}},
- {Key: "API/QueryByPageResponse.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'QueryByPageResponse',Extension: '.cs'}},
- {Key: "API/ResponseMessage.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'ResponseMessage',Extension: '.cs'}},
- {Key: "SqlMapConfig.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'SmartSqlMapConfig',Extension: '.xml'}}
- ]
+ {Key: 'Sln-Directory.Build.cshtml',Output: {Name: 'Directory.Build',Extension: '.props'}},
+ {Key: 'Sln-Version.cshtml',Output: {Path: 'build',Name: 'version',Extension: '.props'}},
+ {Key: 'Sln-Dockerfile.cshtml',Output: {Name: 'Dockerfile',Extension: ''}},
+ {Key: 'Sln-DockerIgnore.cshtml',Output: {Name: '.dockerignore',Extension: ''}},
+ {Key: 'Sln-GitIgnore.cshtml',Output: {Name: '.gitignore',Extension: ''}},
+ {Key: "Proj-Entity.cshtml",Output: {Path: 'src/{{Project.Module}}.Entity',Name: '{{Project.Module}}.Entity',Extension: '.csproj'}},
+ {Key: "Proj-Repository.cshtml",Output: {Path: 'src/{{Project.Module}}.Repository',Name: '{{Project.Module}}.Repository',Extension: '.csproj'}},
+ {Key: "Proj-Service.cshtml",Output: {Path: 'src/{{Project.Module}}.Service',Name: '{{Project.Module}}.Service',Extension: '.csproj'}},
+ {Key: "Proj-API.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: '{{Project.Module}}.API',Extension: '.csproj'}},
+ {Key: "API/LaunchSettings.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Properties',Name: 'launchSettings',Extension: '.json'}},
+ {Key: "API/AppSettings.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: 'appsettings',Extension: '.json'}},
+ {Key: "API/AppSettings-Development.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: 'appsettings.Development',Extension: '.json'}},
+ {Key: "API/Program.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: 'Program',Extension: '.cs'}},
+ {Key: "API/Startup.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: 'Startup',Extension: '.cs'}},
+ {Key: "API/APIException.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Exceptions',Name: 'APIException',Extension: '.cs'}},
+ {Key: "API/GlobalExceptionFilter.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Filters',Name: 'GlobalExceptionFilter',Extension: '.cs'}},
+ {Key: "API/GlobalValidateModelFilter.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Filters',Name: 'GlobalValidateModelFilter',Extension: '.cs'}},
+ {Key: "API/QueryRequest.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'QueryRequest',Extension: '.cs'}},
+ {Key: "API/QueryByPageRequest.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'QueryByPageRequest',Extension: '.cs'}},
+ {Key: "API/ResponseMessage.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'ResponseMessage',Extension: '.cs'}},
+ {Key: "API/QueryResponse.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'QueryResponse',Extension: '.cs'}},
+ {Key: "API/QueryByPageResponse.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'QueryByPageResponse',Extension: '.cs'}},
+ {Key: "API/ResponseMessage.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'ResponseMessage',Extension: '.cs'}},
+ {Key: "SqlMapConfig.cshtml",Output: {Path: 'src/{{Project.Module}}.Repository',Name: 'SmartSqlMapConfig',Extension: '.xml'}},
+ {Key: "SqlMapConfig.cshtml",Output: {Path: 'src/{{Project.Module}}.Repository',Name: 'SmartSqlMapConfig.Development',Extension: '.xml'}}]
Entity:
Type: Table
Module: Entity
- Template: Entity.cshtml
+ TemplateEngine:
+ Path: Entity.cshtml
Output:
- Path: '{{Project.Module}}.{{Build.Module}}'
+ Path: 'src/{{Project.Module}}.{{Build.Module}}'
Name: '{{Items.CurrentTable.ConvertedName}}'
Extension: '.cs'
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
- Paramters: { }
- View:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'V_'
- Delimiter: '_'
- Converter:
- Type: Pascal
- Column:
- Tokenizer:
- Type: Default
- Paramters:
- Delimiter: '_'
- Converter:
- Type: Pascal
Repository:
Type: Table
Module: Repository
- Template: Repository.cshtml
+ TemplateEngine:
+ Path: Repository.cshtml
IgnoreNoPKTable: true
IgnoreView: true
Output:
- Path: '{{Project.Module}}.{{Build.Module}}'
+ Path: 'src/{{Project.Module}}.{{Build.Module}}'
Name: 'I{{Items.CurrentTable.ConvertedName}}Repository'
Extension: .cs
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
Service:
Type: Table
Module: Service
- Template: Service.cshtml
+ TemplateEngine:
+ Path: Service.cshtml
IgnoreNoPKTable: true
IgnoreView: true
Output:
- Path: '{{Project.Module}}.{{Build.Module}}'
+ Path: 'src/{{Project.Module}}.{{Build.Module}}'
Name: '{{Items.CurrentTable.ConvertedName}}Service'
Extension: .cs
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
APIController:
Type: Table
Module: API
- Template: API/APIController.cshtml
+ TemplateEngine:
+ Path: API/APIController.cshtml
IgnoreNoPKTable: true
IgnoreView: true
Output:
- Path: '{{Project.Module}}.{{Build.Module}}/Controllers'
+ Path: 'src/{{Project.Module}}.{{Build.Module}}/Controllers'
Name: '{{Items.CurrentTable.ConvertedName}}Controller'
Extension: .cs
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
SqlMap:
Type: Table
- Template: SqlMap.cshtml
+ TemplateEngine:
+ Path: SqlMap.cshtml
Output:
- Path: '{{Project.Module}}.API/Maps'
+ Path: 'src/{{Project.Module}}.Repository/Maps'
Name: '{{Items.CurrentTable.ConvertedName}}'
Extension: .xml
IgnoreNoPKTable: true
IgnoreView: true
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
- View:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'V_'
- Delimiter: '_'
- Converter:
- Type: Pascal
- Column:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
+
+# Please install dotnet-format first!
+# dotnet tool install -g dotnet-format
+ CodeFormat:
+ Type: Process
+ Parameters:
+ FileName: powershell
+ WorkingDirectory: '{{Project.Output.Path}}'
+ Args: dotnet-format
+
+ ReStore:
+ Type: Process
+ Parameters:
+ FileName: powershell
+ WorkingDirectory: '{{Project.Output.Path}}'
+ Args: dotnet restore
+
+# BuildDocker:
+# Type: Process
+# Parameters:
+# FileName: powershell
+# WorkingDirectory: '{{Project.Output.Path}}'
+# Args: docker build -t {{Project.Parameters.DockerImage}}:v1.0.0 .
+
+# RunDocker:
+# Type: Process
+# Parameters:
+# FileName: powershell
+# WorkingDirectory: '{{Project.Output.Path}}'
+# Args: docker run --name {{Project.Parameters.DockerImage}} --rm -d -p 8008:80 {{Project.Parameters.DockerImage}}:v1.0.0 .
+
+# Publish:
+# Type: Process
+# Parameters:
+# FileName: powershell
+# WorkingDirectory: '{{Project.Output.Path}}'
+# Args: dotnet publish -c Release -o '{{Project.Output.Path}}\publish'
+
+# Run:
+# Type: Process
+# Parameters:
+# FileName: powershell
+# WorkingDirectory: '{{Project.Output.Path}}\publish'
+# CreateNoWindow: false
+# RedirectStandardOutput: false
+# RedirectStandardError: false
+# WaitForExit: false
+# WriteLines: ['dotnet {{Project.Module}}.API.dll']
+
+# RunChrome:
+# Type: Process
+# Parameters:
+# FileName: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
+# CreateNoWindow: false
+# Args: http://localhost:8008/swagger
```
### 构建文件参数概览
@@ -227,11 +265,11 @@ Build:
| Output | 输出 |
| Build | 任务构建s |
-#### DataSource 数据源,Name:Db
+#### DataSource 数据源,Name:DbTable
-> 属性 Name:Db,使用DbSource插件作为数据源
+> 属性 Name:DbTable,使用 DbTableSource 插件作为数据源
-DbSource.Paramters 接受以下三个参数:
+DbTableSource.Parameters 接受以下三个参数:
| 参数名 | 说明 |
| :--------- | --------:|
@@ -263,7 +301,7 @@ DbSource.Paramters 接受以下三个参数:
| IncludeTables | 包括表名s |
| IgnoreTables | 忽略表名s |
| NamingConverter | 命名转换器 |
-| Paramters | 自定义构建参数 |
+| Parameters | 自定义构建参数 |
#### NamingConverter 命名转换
@@ -278,15 +316,15 @@ DbSource.Paramters 接受以下三个参数:
| 属性 | 说明 |
| :--------- | --------:|
| Type | Default |
-| Paramters.IgnorePrefix | 忽略前缀字符 |
-| Paramters.Delimiter | 分隔符 |
-| Paramters.UppercaseSplit | 使用大写分隔,默认:true |
+| Parameters.IgnorePrefix | 忽略前缀字符 |
+| Parameters.Delimiter | 分隔符 |
+| Parameters.UppercaseSplit | 使用大写分隔,默认:true |
### 如何贡献模板
>为了让更多人参与到SmartCode模板建设中来,故有以下模板规范:
-1. 模板作者在 src/SmartCode.Generator/RazorTemplates 中新建目录,并以作者英文名为目录名称
+1. 模板作者在 src/SmartCode.Generator/RazorTemplates/Contributions 中新建目录,并以作者英文名为目录名称
2. 把模板放置到作者目录
3. 作者目录下必须包括 README.md 文件,以说明模板的用途场景以及使用方式
4. 提交PR
@@ -299,13 +337,13 @@ DbSource.Paramters 接受以下三个参数:
Author: Ahoo Wang
DataSource:
Name: Extract
- Paramters:
+ Parameters:
DbProvider: SqlServer
ConnectionString: Data Source=.;Initial Catalog=SmartSqlDB;Integrated Security=True
Query: SELECT [Id],[UserName],[Pwd],[Status],[LastLoginTime],[CreationTime],[Deleted] FROM [T_User] Where Id>@LastMaxId And CreationTime>@LastQueryTime
PKColumn: Id
-Paramters:
+Parameters:
ETLCode: SmartCode.ETL.Test
ETLRepository: PG
@@ -313,12 +351,12 @@ Build:
Transform:
Type: Transform
- Paramters:
+ Parameters:
Script: Load2PostgreSql.cshtml
Load2PostgreSql:
Type: Load
- Paramters:
+ Parameters:
DbProvider: PostgreSql
ConnectionString: Server=localhost;Port=5432;User Id=postgres;Password=SmartSql; Database=smartsql_db;
Table: t_user
diff --git a/SmartCode.sln b/SmartCode.sln
index c5ffd19..cacd50e 100644
--- a/SmartCode.sln
+++ b/SmartCode.sln
@@ -27,6 +27,35 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SmartCode.ETL.PostgreSql",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SmartCode.ETL.SQLite", "src\SmartCode.ETL.SQLite\SmartCode.ETL.SQLite.csproj", "{BB00F470-7D25-4F82-A410-1DB8BD458A5E}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SmartCode.ETL.LoadToES", "src\SmartCode.ETL.LoadToES\SmartCode.ETL.LoadToES.csproj", "{DADD6996-91C4-496D-AE97-D8EA5E33716A}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{B0F696A9-339D-4348-9032-F8DFC775ABD4}"
+ ProjectSection(SolutionItems) = preProject
+ Directory.Build.props = Directory.Build.props
+ build\version.props = build\version.props
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{55E0A4D0-F749-4C33-837C-30F881AA293F}"
+ ProjectSection(SolutionItems) = preProject
+ Directory.Build.props = Directory.Build.props
+ LICENSE = LICENSE
+ README-EN.md = README-EN.md
+ README.md = README.md
+ EndProjectSection
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{B3766EC2-4AD1-4610-B141-5C8D267BF70A}"
+ ProjectSection(SolutionItems) = preProject
+ doc\common-problem.md = doc\common-problem.md
+ doc\SmartCode-ETL-ES.yml = doc\SmartCode-ETL-ES.yml
+ doc\SmartCode-ETL.yml = doc\SmartCode-ETL.yml
+ doc\SmartCode-Gen-ETL.yml = doc\SmartCode-Gen-ETL.yml
+ doc\SmartCode-Spring-Boot.yml = doc\SmartCode-Spring-Boot.yml
+ doc\SmartCode.ETL-EN.md = doc\SmartCode.ETL-EN.md
+ doc\SmartCode.ETL.md = doc\SmartCode.ETL.md
+ doc\SmartCode.json = doc\SmartCode.json
+ doc\SmartCode.yml = doc\SmartCode.yml
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -73,6 +102,10 @@ Global
{BB00F470-7D25-4F82-A410-1DB8BD458A5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB00F470-7D25-4F82-A410-1DB8BD458A5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB00F470-7D25-4F82-A410-1DB8BD458A5E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DADD6996-91C4-496D-AE97-D8EA5E33716A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DADD6996-91C4-496D-AE97-D8EA5E33716A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DADD6996-91C4-496D-AE97-D8EA5E33716A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DADD6996-91C4-496D-AE97-D8EA5E33716A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -82,6 +115,8 @@ Global
{95071030-0C10-4771-B093-4F2626A39F9F} = {EE2194B6-5B23-42C0-AF6A-EC86331E3E08}
{60B49703-2352-477B-8F18-98CC229EEFDA} = {EE2194B6-5B23-42C0-AF6A-EC86331E3E08}
{BB00F470-7D25-4F82-A410-1DB8BD458A5E} = {EE2194B6-5B23-42C0-AF6A-EC86331E3E08}
+ {DADD6996-91C4-496D-AE97-D8EA5E33716A} = {EE2194B6-5B23-42C0-AF6A-EC86331E3E08}
+ {B3766EC2-4AD1-4610-B141-5C8D267BF70A} = {55E0A4D0-F749-4C33-837C-30F881AA293F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9A45CDB0-E532-4F55-84C6-B82C98BE5F38}
diff --git a/build/version.props b/build/version.props
new file mode 100644
index 0000000..8013612
--- /dev/null
+++ b/build/version.props
@@ -0,0 +1,8 @@
+
+
+ 2
+ 4
+ 0-preview.1
+ $(VersionMajor).$(VersionMinor).$(VersionPatch)
+
+
diff --git a/code-of-conduct.md b/code-of-conduct.md
new file mode 100644
index 0000000..c299d64
--- /dev/null
+++ b/code-of-conduct.md
@@ -0,0 +1,45 @@
+# MEMBER CODE OF CONDUCT
+
+The .NET Core Community (NCC) was created to doster an open, innovative, inclusive and welcoming community around open source .NET/.NET Core. To clarify expected behaviour in our communities we have adopted the [Contributor Covenant](contributor-covenant.org). This code of conduct has been adopted by [many other open source communities](contributor-covenant.org/adopters) and we feel it expresses our values well.
+
+### Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
+
+### Our Standards
+
+Examples of behavior that contributes to creating a positive environment include:
+
+- Using welcoming and inclusive language
+- Being respectful of differing viewpoints and experiences
+- Gracefully accepting constructive criticism
+- Focusing on what is best for the community
+- Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+- The use of sexualized language or imagery and unwelcome sexual attention or advances
+- Trolling, insulting/derogatory comments, and personal or political attacks
+- Public or private harassment
+- Publishing others’ private information, such as a physical or electronic address, without explicit permission
+- Other conduct which could reasonably be considered inappropriate in a professional setting
+
+### Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+
+### Scope
+
+This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+
+### Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [dotnet-community@outlook.com](dotnet-community@outlook.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership.
+
+### Attribution
+
+This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
diff --git a/code-of-conduct.zh-CN.md b/code-of-conduct.zh-CN.md
new file mode 100644
index 0000000..2cdfc4a
--- /dev/null
+++ b/code-of-conduct.zh-CN.md
@@ -0,0 +1,51 @@
+# 组织成员行为准则
+
+.NET Core Community (NCC) 旨在建立一个围绕开源 .NET/.NET Core 的开放、创新、包容和热情的社区。为向大家表明我们社区的预期行动,我们编写了贡献者公约。许多其他开源社区已采用此行为准则,我们认为它很好地表达了我们的价值观。
+
+### 我们的承诺
+
+为建设开放友好的环境,我们贡献者和维护者承诺:不论年龄、体型、身体健全与否、民族、性征、性别认同与表征、经验水平、教育程度、社会地位、国籍、相貌、种族、信仰、性取向,我们项目和社区的参与者皆免于骚扰。
+
+### 我们的准则
+
+有助于创造积极环境的行为包括但不限于:
+
+- 措辞友好且包容
+- 尊重不同的观点和经验
+- 耐心接受有益批评
+- 关注对社区最有利的事情
+- 与社区其他成员友善相处
+
+参与者不应采取的行为包括但不限于:
+
+- 发布与性有关的言论或图像、不受欢迎地献殷勤
+- 捣乱/煽动/造谣行为、侮辱/贬损的评论、人身及政治攻击
+- 公开或私下骚扰
+- 未经明确授权便发布他人的资料,如住址、电子邮箱等
+- 其他有理由认定为违反职业操守的不当行为
+
+### 我们的义务
+
+项目维护者有义务诠释何谓“妥当行为”,并妥善公正地纠正已发生的不当行为。
+
+项目维护者有权利和义务去删除、编辑、拒绝违背本行为标准的评论(comments)、提交(commits)、代码、wiki 编辑、问题(issues)等贡献;项目维护者可暂时或永久地封禁任何他们认为行为不当、威胁、冒犯、有害的参与者。
+
+### 适用范围
+
+本行为标准适用于本项目。当有人代表本项目或本社区时,本标准亦适用于此人所处的公共平台。
+
+代表本项目或本社区的情形包括但不限于:使用项目的官方电子邮件、通过官方媒体账号发布消息、作为指定代表参与在线或线下活动等。
+
+代表本项目的行为可由项目维护者进一步定义及解释。
+
+### 贯彻落实
+
+可以致信 [dotnet-community@outlook.com](dotnet-community@outlook.com),向项目团队举报滥用、骚扰及不当行为。
+
+维护团队将审议并调查全部投诉,妥善地予以必要的回应。项目团队有义务保密举报者信息。具体执行方针或将另行发布。
+
+未切实遵守或执行本行为标准的项目维护人员,经项目负责人或其他成员决议,可能被暂时或永久地剥夺参与本项目的资格。
+
+### 来源
+
+本行为标准改编自参与者公约,版本 1.4 可在此查阅:https://www.contributor-covenant.org/zh-cn/version/1/4/code-of-conduct.html
diff --git a/doc/SmartCode-ETL-ES.yml b/doc/SmartCode-ETL-ES.yml
new file mode 100644
index 0000000..30f26d6
--- /dev/null
+++ b/doc/SmartCode-ETL-ES.yml
@@ -0,0 +1,31 @@
+Author: Ahoo Wang
+DataSource:
+ Name: Extract
+ Parameters:
+ DbProvider: PostgreSql
+ ConnectionString: 'Server=localhost;Port=5432;User Id=report;Password=SmartCode; Database=report;'
+ Query: select * from es_sync_product where max_motify_time>@LastMaxModifyTime
+ PKColumn: id
+ AutoIncrement: true
+ ModifyTime: max_motify_time
+
+Parameters:
+ ETLCode: SmartCode.ETL.LoadToES
+ ETLRepository: SQLite
+
+Build:
+
+ Transform:
+ Type: Transform
+ Parameters:
+ Script:
+
+ LoadToES:
+ Type: LoadToES
+ Parameters:
+ Host: http://es.smartsql.net/
+ Index: smartsql
+ Type: product
+ BaseAuth:
+ UserName: smartsql
+ Password: https://github.com/Ahoo-Wang/SmartCode
\ No newline at end of file
diff --git a/doc/SmartCode-ETL.yml b/doc/SmartCode-ETL.yml
index d9ac2ce..2ce3671 100644
--- a/doc/SmartCode-ETL.yml
+++ b/doc/SmartCode-ETL.yml
@@ -1,38 +1,37 @@
Author: Ahoo Wang
+Mode: ETL
+
DataSource:
Name: Extract
- Paramters:
+ Parameters:
DbProvider: SqlServer
- ConnectionString: Data Source=.;Initial Catalog=SmartSqlDB;Integrated Security=True
- Query: SELECT [Id],[UserName],[Pwd],[Status],[LastLoginTime],[CreationTime],[Deleted] FROM [T_User] Where Id>@LastMaxId And CreationTime>@LastQueryTime
+ ConnectionString: Data Source=.;Initial Catalog=SmartSqlTestDB;Integrated Security=True
+ Query: "SELECT * FROM [T_ModifyTime] Where ModifyTime>@LastMaxModifyTime"
+ Order By Id Desc Offset @Offset Rows Fetch Next @BulkSize Rows Only;"
+ Total: Select Count(*) From T_ModifyTime Where ModifyTime>@LastMaxModifyTime
+ BulkSize: 1000
PKColumn: Id
AutoIncrement: true
- ModifyTime: CreationTime
+ ModifyTime: ModifyTime
-Paramters:
+Parameters:
ETLCode: SmartCode.ETL.Test
ETLRepository: SQLite
-
+
Build:
Transform:
Type: Transform
- Paramters:
- Script:
+ Parameters:
+ Script:
- Load2PostgreSql:
+ Load2PostgreSql:
Type: Load
- Paramters:
- DbProvider: PostgreSql
- ConnectionString: Server=localhost;Port=5432;User Id=postgres;Password=SmartSql; Database=smartsql_db;
- Table: t_user
- ColumnMapping: [{Column: Id,Mapping: id}
- ,{Column: UserName,Mapping: user_name}
- ,{Column: Pwd,Mapping: pwd}
- ,{Column: Status,Mapping: status}
- ,{Column: LastLoginTime,Mapping: lastlogintime}
- ,{Column: CreationTime,Mapping: creationtime}
- ,{Column: Deleted,Mapping: deleted}]
- PreCommand:
+ Parameters:
+ DbProvider: SqlServer
+ ConnectionString: Data Source=.;Initial Catalog=DestinationDB;Integrated Security=True
+ Table: T_ModifyTime
+ ColumnMapping: [{Column: Id,Mapping: Id},{Column: ModifyTime,Mapping: ModifyTime}]
+ PreCommand:
PostCommand:
\ No newline at end of file
diff --git a/doc/SmartCode-Gen-ETL.yml b/doc/SmartCode-Gen-ETL.yml
index 4cd8fa7..d6cbe45 100644
--- a/doc/SmartCode-Gen-ETL.yml
+++ b/doc/SmartCode-Gen-ETL.yml
@@ -3,14 +3,16 @@ Module: SqlServer2PG
Author: Ahoo Wang
DataSource:
Name: DbTable
- Paramters:
+ Parameters:
DbName: SqlServerDB
DbProvider: SqlServer
ConnectionString: Data Source=localhost;database=SqlServerDB;uid=SmartSql;pwd=SmartSql
Language: PostgreSql
-TemplateEngine: Razor
-Paramters:
- ExtractMode: QueryTime
+TemplateEngine:
+ Name: Razor
+ Root: .
+Parameters:
+ ExtractMode: LastMaxModifyTime
ModifyTime: ModifyTime
ExtractConnectionString: Data Source=localhost;database=SqlServerDB;uid=SmartSql;pwd=SmartSql
LoadDbProvider: PostgreSql
@@ -24,13 +26,14 @@ Build:
ClearDir:
Type: Clear
- Paramters:
+ Parameters:
Dirs: '.'
# 生成迁移SQL
DbToPGSql:
Type: Single
Module: SmartCode
- Template: Sql/DbToPGSql.cshtml
+ TemplateEngine:
+ Path: Sql/DbToPGSql.cshtml
IgnoreNoPKTable: true
Output:
Path: '.'
@@ -40,13 +43,13 @@ Build:
Table:
Tokenizer:
Type: Default
- Paramters:
+ Parameters:
IgnorePrefix: 'T_'
Delimiter: '_'
UppercaseSplit: true
Converter:
Type: Delimiter
- Paramters:
+ Parameters:
Delimiter: '_'
Mode: AllLower
Prefix: smartcode_
@@ -54,19 +57,20 @@ Build:
Column:
Tokenizer:
Type: Default
- Paramters:
+ Parameters:
Delimiter: '_'
UppercaseSplit: true
Converter:
Type: Delimiter
- Paramters:
+ Parameters:
Delimiter: '_'
Mode: AllLower
# 生成 SmartCode.ETL 数据迁移构建配置
ToPGBuild:
Type: Table
Module: SmartCode
- Template: ETL/ToPGBuild.cshtml
+ TemplateEngine:
+ Path: ETL/ToPGBuild.cshtml
IgnoreNoPKTable: true
Output:
Path: '.'
@@ -76,24 +80,24 @@ Build:
Table:
Tokenizer:
Type: Default
- Paramters:
+ Parameters:
IgnorePrefix: 'T_'
Delimiter: '_'
UppercaseSplit: true
Converter:
Type: Delimiter
- Paramters:
+ Parameters:
Delimiter: '_'
Mode: AllLower
Prefix: smartcode_
Column:
Tokenizer:
Type: Default
- Paramters:
+ Parameters:
Delimiter: '_'
UppercaseSplit: true
Converter:
Type: Delimiter
- Paramters:
+ Parameters:
Delimiter: '_'
Mode: AllLower
\ No newline at end of file
diff --git a/doc/SmartCode-Spring-Boot.yml b/doc/SmartCode-Spring-Boot.yml
index c170347..73c2b52 100644
--- a/doc/SmartCode-Spring-Boot.yml
+++ b/doc/SmartCode-Spring-Boot.yml
@@ -1,59 +1,171 @@
-Module: smartcode.starter
+Module: net.smartsql.demo
Author: Ahoo Wang
DataSource:
Name: DbTable
- Paramters:
- DbName: SmartSqlDB
- DbProvider: SqlServer
- ConnectionString: Data Source=.;Initial Catalog=SmartSqlDB;Integrated Security=True
+ Parameters:
+ DbName: smartsql_db
+ DbProvider: MySql
+ ConnectionString: Data Source=serverAddress;database=smartsql_db;uid=root;pwd=smartsql.net;Charset=utf8;SslMode=none
Language: Java
-TemplateEngine:
- Name: Razor
- Root: Java
-Output:
+TemplateEngine:
+ Name: Razor
+ Root: Java
+Output:
Type: File
- Path: 'E://SmartSql-Java'
+ Path: 'D://SmartSql-Java'
+Parameters:
+ BuildDir: 'D:\SmartSql-Java\build'
+ ApplicationName: Demo
+NamingConverter:
+ Table:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ IgnorePrefix: 't_'
+ Delimiter: '_'
+ Converter:
+ Type: Pascal
+ Parameters: { }
+ View:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ IgnorePrefix: 'v_'
+ Delimiter: '_'
+ Converter:
+ Type: Pascal
+ Column:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ Delimiter: '_'
+ Converter:
+ Type: Camel
+
+TableFilter:
+ IgnoreNoPKTable: true
+ IgnoreView: true
# 构建任务
Build:
- ClearDir:
- Type: Clear
- Paramters:
- Dirs: '.'
+# ClearDir:
+# Type: Clear
+# Parameters:
+# Dirs: '.'
+
+ MakeBuildDir:
+ Type: Process
+ Parameters:
+ FileName: powershell
+ Args: mkdir '{{Project.Parameters.BuildDir}}'
+ Copy:
+ Type: Process
+ Parameters:
+ FileName: powershell
+ Args: cp '{{Project.ConfigPath}}' '{{Project.Parameters.BuildDir}}'
+ Scaffolding:
+ Type: MultiTemplate
+ Output:
+ Path: '.'
+ Parameters:
+ Templates: [
+ {Key: 'Pom-Parent.cshtml',Output: {Name: 'pom',Extension: '.xml'}},
+ {Key: 'Pom-Api.cshtml',Output: {Path: "api",Name: 'pom',Extension: '.xml'}},
+ {Key: 'Pom-Server.cshtml',Output: {Path: "server",Name: 'pom',Extension: '.xml'}},
+ {Key: 'Resources/Application-YAML.cshtml',Output: {Path: "server/src/main/resources",Name: 'application',Extension: '.yml'}},
+ {Key: 'Application.cshtml',Output:
+ {
+ Path: "server/src/main/java/{{Project.Module}}/server/",
+ DotSplit: true,
+ Name: '{{Project.Parameters.ApplicationName}}Application',
+ Extension: '.java'
+ }
+ },
+ {Key: 'Test/Application-Test.cshtml',Output:
+ {
+ Path: "server/src/test/java/{{Project.Module}}/server/",
+ DotSplit: true,
+ Name: '{{Project.Parameters.ApplicationName}}ApplicationTests',
+ Extension: '.java'
+ }
+ },
+ {Key: 'AppConfig.cshtml',Output:
+ {
+ Path: "server/src/main/java/{{Project.Module}}/server/config",
+ DotSplit: true,
+ Name: 'AppConfig',
+ Extension: '.java'
+ }
+ }
+ ]
Entity:
Type: Table
- Module: entity
- TemplateEngine:
+ Module: server.entity
+ TemplateEngine:
Path: Entity.cshtml
- Output:
- Path: '{{Project.Module}}.{{Build.Module}}'
+ Output:
+ Path: 'server/src/main/java/{{Project.Module}}.{{Build.Module}}'
+ DotSplit: true
Name: '{{Items.CurrentTable.ConvertedName}}'
Extension: '.java'
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
- Paramters: { }
- View:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'V_'
- Delimiter: '_'
- Converter:
- Type: Pascal
- Column:
- Tokenizer:
- Type: Default
- Paramters:
- Delimiter: '_'
- Converter:
- Type: Camel
\ No newline at end of file
+ Parameters:
+ AbstractEntity:
+ Name: AbstractEntity
+ Package: net.smartsql.entity
+ Properties:
+ - id
+ - createTime
+ - modifiedTime
+ - deleted
+
+ SqlMap:
+ Type: Table
+ Module: server.repository
+ TemplateEngine:
+ Path: SqlMap.cshtml
+ Output:
+ Path: 'server/src/main/resources/mappers/'
+ DotSplit: true
+ Name: '{{Items.CurrentTable.ConvertedName}}Mapper'
+ Extension: '.xml'
+ Parameters:
+ LogicalDelete: deleted
+
+ Repository:
+ Type: Table
+ Module: server.repository
+ TemplateEngine:
+ Path: Repository.cshtml
+ Output:
+ Path: 'server/src/main/java/{{Project.Module}}.{{Build.Module}}'
+ DotSplit: true
+ Name: '{{Items.CurrentTable.ConvertedName}}Repository'
+ Extension: '.java'
+ Parameters:
+ GenericRepository:
+ Package: net.smartsql.repository
+
+ Service:
+ Type: Table
+ Module: server.service
+ TemplateEngine:
+ Path: Service.cshtml
+ Output:
+ Path: 'server/src/main/java/{{Project.Module}}.{{Build.Module}}'
+ DotSplit: true
+ Name: '{{Items.CurrentTable.ConvertedName}}Service'
+ Extension: '.java'
+
+ Controller:
+ Type: Table
+ Module: server.controller
+ TemplateEngine:
+ Path: Controller.cshtml
+ Output:
+ Path: 'server/src/main/java/{{Project.Module}}.{{Build.Module}}'
+ DotSplit: true
+ Name: '{{Items.CurrentTable.ConvertedName}}Controller'
+ Extension: '.java'
\ No newline at end of file
diff --git a/doc/SmartCode-TypeScript.yml b/doc/SmartCode-TypeScript.yml
new file mode 100644
index 0000000..3a3e3d8
--- /dev/null
+++ b/doc/SmartCode-TypeScript.yml
@@ -0,0 +1,66 @@
+Author: Beginor
+Module: NetCoreApp
+DataSource:
+ Name: DbTable
+ Parameters:
+ DbName: net_core_app
+ DbProvider: PostgreSql
+ ConnectionString: server=127.0.0.1;database=net_core_app;user id=postgres;password=NO_PASSWORD;
+ DbSchema: public
+Language: TypeScript
+TemplateEngine:
+ Name: Razor
+ Root: TypeScript
+Output:
+ Type: File
+ Mode: Full # Incre 增量创建,如果存在则忽略; Full 全量创建,如果存在则重新创建
+ Path: /tmp/test
+NamingConverter:
+ Table:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ IgnorePrefix: 'T_'
+ Delimiter: '_'
+ Converter:
+ Type: Pascal
+ Parameters: { }
+ View:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ IgnorePrefix: 'V_'
+ Delimiter: '_'
+ Converter:
+ Type: Pascal
+ Column:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ Delimiter: '_'
+ Converter:
+ Type: Camel
+TableFilter:
+ IgnoreTables:
+ # - app_roles
+ # - app_users
+ - aspnet_role_claims
+ - aspnet_roles
+ - aspnet_user_claims
+ - aspnet_user_logins
+ - aspnet_user_roles
+ - aspnet_user_tokens
+ # - aspnet_users
+ IgnoreNoPKTable: true
+ IgnoreView: true
+
+Build:
+ Entities:
+ Type: Table
+ Module: Data
+ TemplateEngine:
+ Path: Model.cshtml
+ Output:
+ Path: '{{Items.CurrentTable.Name}}/services'
+ Name: '{{Items.CurrentTable.Name}}'
+ Extension: '.ts'
diff --git a/doc/SmartCode.ETL-EN.md b/doc/SmartCode.ETL-EN.md
index f139588..587751a 100644
--- a/doc/SmartCode.ETL-EN.md
+++ b/doc/SmartCode.ETL-EN.md
@@ -117,7 +117,7 @@ I believe that many students who have already landed the microservices architect
{
"Type": "SmartCode.ETL.IETLRepository,SmartCode.ETL",
"ImplType": "SmartCode.ETL.PostgreSql.PGETLRepository,SmartCode.ETL.PostgreSql",
- "Paramters": {
+ "Parameters": {
"ConnectionString": "Server=localhost;Port=5432;User Id=postgres;Password=SmartSql; Database=smartcode_etl;"
}
}
@@ -133,24 +133,24 @@ I believe that many students who have already landed the microservices architect
Author: Ahoo Wang
DataSource:
Name: Extract
- Paramters:
+ Parameters:
DbProvider: SqlServer
ConnectionString: Data Source=.;Initial Catalog=SmartSqlDB;Integrated Security=True
Query: SELECT [Id],[UserName],[Status],[LastLoginTime],[CreationTime],[ModifyTime],[Deleted] FROM [T_User] With(NoLock) Where ModifyTime>@LastMaxModifyTime
PKColumn: Id
AutoIncrement: true
ModifyTime: ModifyTime
-Paramters:
+Parameters:
ETLCode: SmartCode.ETL.Test
ETLRepository: PG
Build:
Transform:
Type: Transform
- Paramters:
+ Parameters:
Script:
Load2PostgreSql:
Type: Load
- Paramters:
+ Parameters:
DbProvider: PostgreSql
ConnectionString: Server=localhost;Port=5432;User Id=postgres;Password=SmartSql; Database=smartsql_db;
Table: t_user__temp
@@ -168,7 +168,7 @@ Build:
,{Column: Deleted,Mapping: deleted}]
```
-### Root Paramters
+### Root Parameters
| Parameter Name | Description |
| :------------ | -----------------------------: |
@@ -179,7 +179,7 @@ Build:
> Attribute Name:Extract, using the ExtractDataSource plugin as a data source
-#### ExtractDataSource.Paramters
+#### ExtractDataSource.Parameters
| Parameter Name | Description |
| :--------------- | -------------------------------- |
@@ -194,7 +194,7 @@ AutoIncrement | Whether to auto-increment the primary key, true automatically ca
> Attribute Type:Load, using the LoadBuildTask plugin as a build task
-#### Build.Load.Paramters
+#### Build.Load.Parameters
| Parameter Name | Description |
| :--------------- | -------------------------------- |
@@ -247,7 +247,7 @@ The following is the data extraction performance, the number of extraction is 14
"QueryCommand": {
"Taken": 41267,
"Command": "Select * From T_ProductSearchLog With(NoLock) Where Id>@LastMaxId",
- "Paramters": {
+ "Parameters": {
"LastMaxId": -1,
"LastQueryTime": "1970-01-01T08:00:00"
}
diff --git a/doc/SmartCode.ETL.md b/doc/SmartCode.ETL.md
index 04b3e6d..22475c5 100644
--- a/doc/SmartCode.ETL.md
+++ b/doc/SmartCode.ETL.md
@@ -117,7 +117,7 @@
{
"Type": "SmartCode.ETL.IETLRepository,SmartCode.ETL",
"ImplType": "SmartCode.ETL.PostgreSql.PGETLRepository,SmartCode.ETL.PostgreSql",
- "Paramters": {
+ "Parameters": {
"ConnectionString": "Server=localhost;Port=5432;User Id=postgres;Password=SmartSql; Database=smartcode_etl;"
}
}
@@ -133,24 +133,24 @@
Author: Ahoo Wang
DataSource:
Name: Extract
- Paramters:
+ Parameters:
DbProvider: SqlServer
ConnectionString: Data Source=.;Initial Catalog=SmartSqlDB;Integrated Security=True
Query: SELECT [Id],[UserName],[Status],[LastLoginTime],[CreationTime],[ModifyTime],[Deleted] FROM [T_User] With(NoLock) Where ModifyTime>@LastMaxModifyTime
PKColumn: Id
AutoIncrement: true
ModifyTime: ModifyTime
-Paramters:
+Parameters:
ETLCode: SmartCode.ETL.Test
ETLRepository: PG
Build:
Transform:
Type: Transform
- Paramters:
+ Parameters:
Script:
Load2PostgreSql:
Type: Load
- Paramters:
+ Parameters:
DbProvider: PostgreSql
ConnectionString: Server=localhost;Port=5432;User Id=postgres;Password=SmartSql; Database=smartsql_db;
Table: t_user__temp
@@ -168,7 +168,7 @@ Build:
,{Column: Deleted,Mapping: deleted}]
```
-### 根 Paramters
+### 根 Parameters
| 参数名 | 说明 |
| :------------ | -----------------------------: |
@@ -179,7 +179,7 @@ Build:
> 属性 Name:Extract,使用 ExtractDataSource 插件作为数据源
-#### ExtractDataSource.Paramters
+#### ExtractDataSource.Parameters
| 参数名 | 说明 |
| :--------------- | ------------------------------------------------------------------------------------------------------: |
@@ -194,7 +194,7 @@ Build:
> 属性 Type:Load,使用 LoadBuildTask 插件作为构建任务
-#### Build.Load.Paramters
+#### Build.Load.Parameters
| 参数名 | 说明 |
| :--------------- | --------------------------------------------------------------: |
@@ -247,7 +247,7 @@ LastMaxModifyTime 即上一次抽取的数据最大ModifyTime值(第一次抽取
"QueryCommand": {
"Taken": 41267,
"Command": "Select * From T_ProductSearchLog With(NoLock) Where Id>@LastMaxId",
- "Paramters": {
+ "Parameters": {
"LastMaxId": -1,
"LastQueryTime": "1970-01-01T08:00:00",
"LastMaxModifyTime": "1970-01-01T08:00:00"
diff --git a/doc/SmartCode.json b/doc/SmartCode.json
index 217b9bb..b4d00a6 100644
--- a/doc/SmartCode.json
+++ b/doc/SmartCode.json
@@ -1,420 +1,800 @@
{
- "Module": "SmartSql.Starter",
- "Author": "Ahoo Wang",
- "DataSource": {
- "Name": "Db",
- "Paramters": {
- "DbName": "SmartSqlStarterDB",
- "DbProvider": "SqlServer",
- "ConnectionString": "Data Source=.;Initial Catalog=SmartSqlStarterDB;Integrated Security=True"
+ "ConfigPath": null,
+ "Module": "SmartSql.Starter",
+ "Author": "Ahoo Wang",
+ "DataSource": {
+ "Name": "DbTable",
+ "Parameters": {
+ "DbName": "SmartSqlTestDB",
+ "DbProvider": "SqlServer",
+ "ConnectionString": "Data Source=.;Initial Catalog=SmartSqlTestDB;Integrated Security=True"
+ }
+ },
+ "TemplateEngine": {
+ "Name": "Razor",
+ "Root": "CSharp"
+ },
+ "Language": "CSharp",
+ "Output": {
+ "Type": "File",
+ "Path": "E:\\SmartSql-Starter"
+ },
+ "Parameters": {
+ "SmartSqlVersion": "4.0.86",
+ "SmartSqlSchemaVersion": "4.0.82",
+ "BuildDir": "E:\\SmartSql-Starter\\build",
+ "DockerImage": "smartsql.starter"
+ },
+ "BuildTasks": {
+ "MakeBuildDir": {
+ "Type": "Process",
+ "TemplateEngine": {
+ "Name": "Razor",
+ "Root": "CSharp"
+ },
+ "IgnoreNoPKTable": true,
+ "IgnoreView": true,
+ "NamingConverter": {
+ "Table": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "T_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal",
+ "Parameters": {}
+ }
+ },
+ "View": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "V_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ },
+ "Column": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
}
+ },
+ "Parameters": {
+ "FileName": "powershell",
+ "Args": "mkdir '{{Project.Parameters.BuildDir}}'"
+ }
},
- "TemplateEngine": "Razor",
- "Language": "CSharp",
- "Output": {
- "Type": "File",
- "Path": "E://SmartSql-Starter",
- "Name": null,
- "Extension": null
+ "Copy": {
+ "Type": "Process",
+ "IgnoreNoPKTable": true,
+ "IgnoreView": true,
+ "NamingConverter": {
+ "Table": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "T_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal",
+ "Parameters": {}
+ }
+ },
+ "View": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "V_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ },
+ "Column": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ }
+ },
+ "Parameters": {
+ "FileName": "powershell",
+ "Args": "cp '{{Project.ConfigPath}}' '{{Project.Parameters.BuildDir}}'"
+ }
},
- "Paramters": null,
- "BuildTasks": {
- "ClearDir": {
- "Type": "Clear",
- "Module": null,
- "TemplateEngine": "Razor",
- "Template": null,
- "Output": null,
- "IncludeTables": null,
- "IgnoreTables": null,
- "NamingConverter": {
- "Table": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- },
- "View": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- },
- "Column": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- }
- },
- "Paramters": {
- "Dirs": "."
+ "Scaffolding": {
+ "Type": "MultiTemplate",
+ "TemplateEngine": {
+ "Name": "Razor",
+ "Root": "CSharp"
+ },
+ "Output": {
+ "Type": "File",
+ "Path": "."
+ },
+ "IgnoreNoPKTable": true,
+ "IgnoreView": true,
+ "NamingConverter": {
+ "Table": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "T_",
+ "Delimiter": "_"
}
+ },
+ "Converter": {
+ "Type": "Pascal",
+ "Parameters": {}
+ }
},
- "Solution": {
- "Type": "Project",
- "Module": null,
- "TemplateEngine": "Razor",
- "Template": "Sln.cshtml",
- "Output": {
- "Type": "File",
- "Path": ".",
- "Name": "{{Project.Module}}",
- "Extension": ".sln"
- },
- "IncludeTables": null,
- "IgnoreTables": null,
- "NamingConverter": {
- "Table": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- },
- "View": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- },
- "Column": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- }
- },
- "Paramters": null
+ "View": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "V_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
},
- "SmartSqlConfig": {
- "Type": "Project",
- "Module": null,
- "TemplateEngine": "Razor",
- "Template": "SqlMapConfig.cshtml",
+ "Column": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ }
+ },
+ "Parameters": {
+ "Templates": [
+ {
+ "Key": "Sln.cshtml",
"Output": {
- "Type": "File",
- "Path": "{{Project.Module}}.API",
- "Name": "SmartSqlMapConfig",
- "Extension": ".xml"
- },
- "IncludeTables": null,
- "IgnoreTables": null,
- "NamingConverter": {
- "Table": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- },
- "View": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- },
- "Column": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- }
- },
- "Paramters": null
- },
- "Entity_Project": {
- "Type": "Project",
- "Module": null,
- "TemplateEngine": "Razor",
- "Template": "Proj.cshtml",
+ "Name": "{{Project.Module}}",
+ "Extension": ".sln"
+ }
+ },
+ {
+ "Key": "Sln-Directory.Build.cshtml",
"Output": {
- "Type": "File",
- "Path": "{{Project.Module}}.Entity",
- "Name": "{{Project.Module}}.Entity",
- "Extension": ".csproj"
- },
- "IncludeTables": null,
- "IgnoreTables": null,
- "NamingConverter": {
- "Table": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- },
- "View": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- },
- "Column": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- }
- },
- "Paramters": null
- },
- "Entity": {
- "Type": "Table",
- "Module": "Entity",
- "TemplateEngine": "Razor",
- "Template": "Entity.cshtml",
+ "Name": "Directory.Build",
+ "Extension": ".props"
+ }
+ },
+ {
+ "Key": "Sln-Version.cshtml",
"Output": {
- "Type": "File",
- "Path": "{{Project.Module}}.{{Build.Module}}",
- "Name": null,
- "Extension": ".cs"
- },
- "IncludeTables": null,
- "IgnoreTables": null,
- "NamingConverter": {
- "Table": {
- "Tokenizer": {
- "Type": "Default",
- "Paramters": {
- "IgnorePrefix": "T_",
- "Delimiter": "_"
- }
- },
- "Converter": {
- "Type": "Default",
- "Paramters": {}
- }
- },
- "View": {
- "Tokenizer": {
- "Type": "Default",
- "Paramters": {
- "IgnorePrefix": "V_",
- "Delimiter": "_"
- }
- },
- "Converter": {
- "Type": "Pascal",
- "Paramters": null
- }
- },
- "Column": {
- "Tokenizer": {
- "Type": "Default",
- "Paramters": {
- "Delimiter": "_"
- }
- },
- "Converter": {
- "Type": "Pascal",
- "Paramters": null
- }
- }
- },
- "Paramters": null
- },
- "Repository_Project": {
- "Type": "Project",
- "Module": null,
- "TemplateEngine": "Razor",
- "Template": "Proj-Repository.cshtml",
+ "Path": "build",
+ "Name": "version",
+ "Extension": ".props"
+ }
+ },
+ {
+ "Key": "Sln-Dockerfile.cshtml",
"Output": {
- "Type": "File",
- "Path": "{{Project.Module}}.Repository",
- "Name": "{{Project.Module}}.Repository",
- "Extension": ".csproj"
- },
- "IncludeTables": null,
- "IgnoreTables": null,
- "NamingConverter": {
- "Table": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- },
- "View": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- },
- "Column": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- }
- },
- "Paramters": null
- },
- "Repository": {
- "Type": "Table",
- "Module": "Repository",
- "TemplateEngine": "Razor",
- "Template": "Repository.cshtml",
+ "Name": "Dockerfile",
+ "Extension": ""
+ }
+ },
+ {
+ "Key": "Sln-DockerIgnore.cshtml",
"Output": {
- "Type": "File",
- "Path": "{{Project.Module}}.{{Build.Module}}",
- "Name": "I{{OutputName}}Repository",
- "Extension": ".cs"
- },
- "IncludeTables": null,
- "IgnoreTables": null,
- "NamingConverter": {
- "Table": {
- "Tokenizer": {
- "Type": "Default",
- "Paramters": {
- "IgnorePrefix": "T_",
- "Delimiter": "_"
- }
- },
- "Converter": {
- "Type": "Default",
- "Paramters": null
- }
- },
- "View": {
- "Tokenizer": {
- "Type": "Default",
- "Paramters": {
- "IgnorePrefix": "V_",
- "Delimiter": "_"
- }
- },
- "Converter": {
- "Type": "Default",
- "Paramters": null
- }
- },
- "Column": {
- "Tokenizer": {
- "Type": "Defalut",
- "Paramters": {}
- },
- "Converter": {
- "Type": "Defalut",
- "Paramters": {}
- }
- }
- },
- "Paramters": null
- },
- "SqlMap": {
- "Type": "Table",
- "Module": null,
- "TemplateEngine": "Razor",
- "Template": "SqlMap-SqlServer.cshtml",
+ "Name": ".dockerignore",
+ "Extension": ""
+ }
+ },
+ {
+ "Key": "Sln-GitIgnore.cshtml",
+ "Output": {
+ "Name": ".gitignore",
+ "Extension": ""
+ }
+ },
+ {
+ "Key": "Proj-Entity.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.Entity",
+ "Name": "{{Project.Module}}.Entity",
+ "Extension": ".csproj"
+ }
+ },
+ {
+ "Key": "Proj-Repository.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.Repository",
+ "Name": "{{Project.Module}}.Repository",
+ "Extension": ".csproj"
+ }
+ },
+ {
+ "Key": "Proj-Service.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.Service",
+ "Name": "{{Project.Module}}.Service",
+ "Extension": ".csproj"
+ }
+ },
+ {
+ "Key": "Proj-API.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.API",
+ "Name": "{{Project.Module}}.API",
+ "Extension": ".csproj"
+ }
+ },
+ {
+ "Key": "API/LaunchSettings.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.API/Properties",
+ "Name": "launchSettings",
+ "Extension": ".json"
+ }
+ },
+ {
+ "Key": "API/AppSettings.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.API",
+ "Name": "appsettings",
+ "Extension": ".json"
+ }
+ },
+ {
+ "Key": "API/AppSettings-Development.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.API",
+ "Name": "appsettings.Development",
+ "Extension": ".json"
+ }
+ },
+ {
+ "Key": "API/Program.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.API",
+ "Name": "Program",
+ "Extension": ".cs"
+ }
+ },
+ {
+ "Key": "API/Startup.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.API",
+ "Name": "Startup",
+ "Extension": ".cs"
+ }
+ },
+ {
+ "Key": "API/APIException.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.API/Exceptions",
+ "Name": "APIException",
+ "Extension": ".cs"
+ }
+ },
+ {
+ "Key": "API/GlobalExceptionFilter.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.API/Filters",
+ "Name": "GlobalExceptionFilter",
+ "Extension": ".cs"
+ }
+ },
+ {
+ "Key": "API/GlobalValidateModelFilter.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.API/Filters",
+ "Name": "GlobalValidateModelFilter",
+ "Extension": ".cs"
+ }
+ },
+ {
+ "Key": "API/QueryRequest.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.API/Messages",
+ "Name": "QueryRequest",
+ "Extension": ".cs"
+ }
+ },
+ {
+ "Key": "API/QueryByPageRequest.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.API/Messages",
+ "Name": "QueryByPageRequest",
+ "Extension": ".cs"
+ }
+ },
+ {
+ "Key": "API/ResponseMessage.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.API/Messages",
+ "Name": "ResponseMessage",
+ "Extension": ".cs"
+ }
+ },
+ {
+ "Key": "API/QueryResponse.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.API/Messages",
+ "Name": "QueryResponse",
+ "Extension": ".cs"
+ }
+ },
+ {
+ "Key": "API/QueryByPageResponse.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.API/Messages",
+ "Name": "QueryByPageResponse",
+ "Extension": ".cs"
+ }
+ },
+ {
+ "Key": "API/ResponseMessage.cshtml",
"Output": {
- "Type": "File",
- "Path": "{{Project.Module}}.API/Maps",
- "Name": null,
- "Extension": ".xml"
- },
- "IncludeTables": null,
- "IgnoreTables": null,
- "NamingConverter": {
- "Table": {
- "Tokenizer": {
- "Type": "Default",
- "Paramters": {
- "IgnorePrefix": "T_",
- "Delimiter": "_"
- }
- },
- "Converter": {
- "Type": "Default",
- "Paramters": null
- }
- },
- "View": {
- "Tokenizer": {
- "Type": "Default",
- "Paramters": {
- "IgnorePrefix": "V_",
- "Delimiter": "_"
- }
- },
- "Converter": {
- "Type": "Default",
- "Paramters": null
- }
- },
- "Column": {
- "Tokenizer": {
- "Type": "Default",
- "Paramters": {
- "IgnorePrefix": "T_",
- "Delimiter": "_"
- }
- },
- "Converter": {
- "Type": "Default",
- "Paramters": null
- }
- }
- },
- "Paramters": null
+ "Path": "src/{{Project.Module}}.API/Messages",
+ "Name": "ResponseMessage",
+ "Extension": ".cs"
+ }
+ },
+ {
+ "Key": "SqlMapConfig.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.Repository",
+ "Name": "SmartSqlMapConfig",
+ "Extension": ".xml"
+ }
+ },
+ {
+ "Key": "SqlMapConfig.cshtml",
+ "Output": {
+ "Path": "src/{{Project.Module}}.Repository",
+ "Name": "SmartSqlMapConfig.Development",
+ "Extension": ".xml"
+ }
+ }
+ ]
+ }
+ },
+ "Entity": {
+ "Type": "Table",
+ "Module": "Entity",
+ "TemplateEngine": {
+ "Name": "Razor",
+ "Root": "CSharp",
+ "Path": "Entity.cshtml"
+ },
+ "Output": {
+ "Type": "File",
+ "Path": "src/{{Project.Module}}.{{Build.Module}}",
+ "Mode": 1,
+ "Name": "{{Items.CurrentTable.ConvertedName}}",
+ "Extension": ".cs"
+ },
+ "IgnoreNoPKTable": false,
+ "IgnoreView": false,
+ "NamingConverter": {
+ "Table": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "T_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal",
+ "Parameters": {}
+ }
+ },
+ "View": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "V_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ },
+ "Column": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ }
+ }
+ },
+ "Repository": {
+ "Type": "Table",
+ "Module": "Repository",
+ "TemplateEngine": {
+ "Name": "Razor",
+ "Root": "CSharp",
+ "Path": "Repository.cshtml"
+ },
+ "Output": {
+ "Type": "File",
+ "Path": "src/{{Project.Module}}.{{Build.Module}}",
+ "Mode": 1,
+ "Name": "I{{Items.CurrentTable.ConvertedName}}Repository",
+ "Extension": ".cs"
+ },
+ "IgnoreNoPKTable": true,
+ "IgnoreView": true,
+ "NamingConverter": {
+ "Table": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "T_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal",
+ "Parameters": {}
+ }
+ },
+ "View": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "V_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ },
+ "Column": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ }
+ }
+ },
+ "Service": {
+ "Type": "Table",
+ "Module": "Service",
+ "TemplateEngine": {
+ "Name": "Razor",
+ "Root": "CSharp",
+ "Path": "Service.cshtml"
+ },
+ "Output": {
+ "Type": "File",
+ "Path": "src/{{Project.Module}}.{{Build.Module}}",
+ "Name": "{{Items.CurrentTable.ConvertedName}}Service",
+ "Extension": ".cs"
+ },
+ "IgnoreNoPKTable": true,
+ "IgnoreView": true,
+ "NamingConverter": {
+ "Table": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "T_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal",
+ "Parameters": {}
+ }
+ },
+ "View": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "V_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ },
+ "Column": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ }
+ }
+ },
+ "APIController": {
+ "Type": "Table",
+ "Module": "API",
+ "TemplateEngine": {
+ "Name": "Razor",
+ "Root": "CSharp",
+ "Path": "API/APIController.cshtml"
+ },
+ "Output": {
+ "Type": "File",
+ "Path": "src/{{Project.Module}}.{{Build.Module}}/Controllers",
+ "Name": "{{Items.CurrentTable.ConvertedName}}Controller",
+ "Extension": ".cs"
+ },
+ "IgnoreNoPKTable": true,
+ "IgnoreView": true,
+ "NamingConverter": {
+ "Table": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "T_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal",
+ "Parameters": {}
+ }
+ },
+ "View": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "V_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ },
+ "Column": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ }
+ }
+ },
+ "SqlMap": {
+ "Type": "Table",
+ "TemplateEngine": {
+ "Name": "Razor",
+ "Root": "CSharp",
+ "Path": "SqlMap.cshtml"
+ },
+ "Output": {
+ "Type": "File",
+ "Path": "src/{{Project.Module}}.Repository/Maps",
+ "Name": "{{Items.CurrentTable.ConvertedName}}",
+ "Extension": ".xml"
+ },
+ "IgnoreNoPKTable": true,
+ "IgnoreView": true,
+ "NamingConverter": {
+ "Table": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "T_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal",
+ "Parameters": {}
+ }
+ },
+ "View": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "V_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ },
+ "Column": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
}
+ }
},
- "OutputPath": "E://SmartSql-Starter"
+ "CodeFormat": {
+ "Type": "Process",
+ "IgnoreNoPKTable": true,
+ "IgnoreView": true,
+ "NamingConverter": {
+ "Table": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "T_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ },
+ "View": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "V_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ },
+ "Column": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ }
+ },
+ "Parameters": {
+ "FileName": "powershell",
+ "WorkingDirectory": "{{Project.Output.Path}}",
+ "Args": "dotnet-format"
+ }
+ },
+ "ReStore": {
+ "Type": "Process",
+ "IgnoreNoPKTable": true,
+ "IgnoreView": true,
+ "NamingConverter": {
+ "Table": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "T_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal",
+ "Parameters": {}
+ }
+ },
+ "View": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "V_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ },
+ "Column": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ }
+ },
+ "Parameters": {
+ "FileName": "powershell",
+ "WorkingDirectory": "{{Project.Output.Path}}",
+ "Args": "dotnet restore"
+ }
+ }
+ },
+ "OutputPath": "E:\\SmartSql-Starter",
+ "NamingConverter": {
+ "Table": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "T_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ },
+ "View": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "IgnorePrefix": "V_",
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal"
+ }
+ },
+ "Column": {
+ "Tokenizer": {
+ "Type": "Default",
+ "Parameters": {
+ "Delimiter": "_"
+ }
+ },
+ "Converter": {
+ "Type": "Pascal",
+ "Parameters": null
+ }
+ }
+ },
+ "TableFilter": {
+ "IgnoreNoPKTable": true,
+ "IgnoreView": true
+ }
}
\ No newline at end of file
diff --git a/doc/SmartCode.yml b/doc/SmartCode.yml
index 67861ab..6cd9397 100644
--- a/doc/SmartCode.yml
+++ b/doc/SmartCode.yml
@@ -2,183 +2,206 @@ Module: SmartSql.Starter
Author: Ahoo Wang
DataSource:
Name: DbTable
- Paramters:
- DbName: SmartSqlDB
+ Parameters:
+ DbName: SmartSqlTestDB
DbProvider: SqlServer
- ConnectionString: Data Source=.;Initial Catalog=SmartSqlDB;Integrated Security=True
+ ConnectionString: Data Source=.;Initial Catalog=SmartSqlTestDB;Integrated Security=True
Language: CSharp
TemplateEngine:
Name: Razor
Root: CSharp
Output:
Type: File
- Path: 'E://SmartSql-Starter'
+ Path: 'D:\SmartSql-Starter'
+Parameters:
+ SmartSqlVersion: '4.1.42'
+ SmartSqlSchemaVersion: '4.1.30'
+ BuildDir: 'D:\SmartSql-Starter\build'
+ DockerImage: 'smartsql.starter'
+
+NamingConverter:
+ Table:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ IgnorePrefix: 'T_'
+ Delimiter: '_'
+ Converter:
+ Type: Pascal
+ Parameters: { }
+ View:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ IgnorePrefix: 'V_'
+ Delimiter: '_'
+ Converter:
+ Type: Pascal
+ Column:
+ Tokenizer:
+ Type: Default
+ Parameters:
+ Delimiter: '_'
+ Converter:
+ Type: Pascal
+
+TableFilter:
+ IgnoreNoPKTable: true
+ IgnoreView: true
# 构建任务
Build:
- ClearDir:
- Type: Clear
- Paramters:
- Dirs: '.'
+# ClearDir:
+# Type: Clear
+# Parameters:
+# Dirs: '.'
+
+ MakeBuildDir:
+ Type: Process
+ Parameters:
+ FileName: powershell
+ Args: mkdir '{{Project.Parameters.BuildDir}}'
+ Copy:
+ Type: Process
+ Parameters:
+ FileName: powershell
+ Args: cp '{{Project.ConfigPath}}' '{{Project.Parameters.BuildDir}}'
Scaffolding:
Type: MultiTemplate
- Output:
+ Output:
Path: '.'
- Paramters:
+ Parameters:
Templates: [{Key: 'Sln.cshtml',Output: {Name: '{{Project.Module}}',Extension: '.sln'}},
- {Key: "Proj-Entity.cshtml",Output: {Path: '{{Project.Module}}.Entity',Name: '{{Project.Module}}.Entity',Extension: '.csproj'}},
- {Key: "Proj-Repository.cshtml",Output: {Path: '{{Project.Module}}.Repository',Name: '{{Project.Module}}.Repository',Extension: '.csproj'}},
- {Key: "Proj-Service.cshtml",Output: {Path: '{{Project.Module}}.Service',Name: '{{Project.Module}}.Service',Extension: '.csproj'}},
- {Key: "Proj-API.cshtml",Output: {Path: '{{Project.Module}}.API',Name: '{{Project.Module}}.API',Extension: '.csproj'}},
- {Key: "API/LaunchSettings.cshtml",Output: {Path: '{{Project.Module}}.API/Properties',Name: 'launchSettings',Extension: '.json'}},
- {Key: "API/AppSettings.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'appsettings',Extension: '.json'}},
- {Key: "API/AppSettings-Development.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'appsettings.Development',Extension: '.json'}},
- {Key: "API/Program.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'Program',Extension: '.cs'}},
- {Key: "API/Startup.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'Startup',Extension: '.cs'}},
- {Key: "API/APIException.cshtml",Output: {Path: '{{Project.Module}}.API/Exceptions',Name: 'APIException',Extension: '.cs'}},
- {Key: "API/GlobalExceptionFilter.cshtml",Output: {Path: '{{Project.Module}}.API/Filters',Name: 'GlobalExceptionFilter',Extension: '.cs'}},
- {Key: "API/GlobalValidateModelFilter.cshtml",Output: {Path: '{{Project.Module}}.API/Filters',Name: 'GlobalValidateModelFilter',Extension: '.cs'}},
- {Key: "API/QueryRequest.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'QueryRequest',Extension: '.cs'}},
- {Key: "API/QueryByPageRequest.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'QueryByPageRequest',Extension: '.cs'}},
- {Key: "API/ResponseMessage.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'ResponseMessage',Extension: '.cs'}},
- {Key: "API/QueryResponse.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'QueryResponse',Extension: '.cs'}},
- {Key: "API/QueryByPageResponse.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'QueryByPageResponse',Extension: '.cs'}},
- {Key: "API/ResponseMessage.cshtml",Output: {Path: '{{Project.Module}}.API/Messages',Name: 'ResponseMessage',Extension: '.cs'}},
- {Key: "SqlMapConfig.cshtml",Output: {Path: '{{Project.Module}}.API',Name: 'SmartSqlMapConfig',Extension: '.xml'}}
- ]
+ {Key: 'Sln-Directory.Build.cshtml',Output: {Name: 'Directory.Build',Extension: '.props'}},
+ {Key: 'Sln-Version.cshtml',Output: {Path: 'build',Name: 'version',Extension: '.props'}},
+ {Key: 'Sln-Dockerfile.cshtml',Output: {Name: 'Dockerfile',Extension: ''}},
+ {Key: 'Sln-DockerIgnore.cshtml',Output: {Name: '.dockerignore',Extension: ''}},
+ {Key: 'Sln-GitIgnore.cshtml',Output: {Name: '.gitignore',Extension: ''}},
+ {Key: "Proj-Entity.cshtml",Output: {Path: 'src/{{Project.Module}}.Entity',Name: '{{Project.Module}}.Entity',Extension: '.csproj'}},
+ {Key: "Proj-Repository.cshtml",Output: {Path: 'src/{{Project.Module}}.Repository',Name: '{{Project.Module}}.Repository',Extension: '.csproj'}},
+ {Key: "Proj-Service.cshtml",Output: {Path: 'src/{{Project.Module}}.Service',Name: '{{Project.Module}}.Service',Extension: '.csproj'}},
+ {Key: "Proj-API.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: '{{Project.Module}}.API',Extension: '.csproj'}},
+ {Key: "API/LaunchSettings.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Properties',Name: 'launchSettings',Extension: '.json'}},
+ {Key: "API/AppSettings.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: 'appsettings',Extension: '.json'}},
+ {Key: "API/AppSettings-Development.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: 'appsettings.Development',Extension: '.json'}},
+ {Key: "API/Program.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: 'Program',Extension: '.cs'}},
+ {Key: "API/Startup.cshtml",Output: {Path: 'src/{{Project.Module}}.API',Name: 'Startup',Extension: '.cs'}},
+ {Key: "API/APIException.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Exceptions',Name: 'APIException',Extension: '.cs'}},
+ {Key: "API/GlobalExceptionFilter.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Filters',Name: 'GlobalExceptionFilter',Extension: '.cs'}},
+ {Key: "API/GlobalValidateModelFilter.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Filters',Name: 'GlobalValidateModelFilter',Extension: '.cs'}},
+ {Key: "API/QueryRequest.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'QueryRequest',Extension: '.cs'}},
+ {Key: "API/QueryByPageRequest.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'QueryByPageRequest',Extension: '.cs'}},
+ {Key: "API/ResponseMessage.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'ResponseMessage',Extension: '.cs'}},
+ {Key: "API/QueryResponse.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'QueryResponse',Extension: '.cs'}},
+ {Key: "API/QueryByPageResponse.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'QueryByPageResponse',Extension: '.cs'}},
+ {Key: "API/ResponseMessage.cshtml",Output: {Path: 'src/{{Project.Module}}.API/Messages',Name: 'ResponseMessage',Extension: '.cs'}},
+ {Key: "SqlMapConfig.cshtml",Output: {Path: 'src/{{Project.Module}}.Repository',Name: 'SmartSqlMapConfig',Extension: '.xml'}},
+ {Key: "SqlMapConfig.cshtml",Output: {Path: 'src/{{Project.Module}}.Repository',Name: 'SmartSqlMapConfig.Development',Extension: '.xml'}}]
Entity:
Type: Table
Module: Entity
TemplateEngine:
Path: Entity.cshtml
+ IgnoreNoPKTable: false
+ IgnoreView: false
Output:
- Path: '{{Project.Module}}.{{Build.Module}}'
+ Path: 'src/{{Project.Module}}.{{Build.Module}}'
Name: '{{Items.CurrentTable.ConvertedName}}'
Extension: '.cs'
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
- Paramters: { }
- View:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'V_'
- Delimiter: '_'
- Converter:
- Type: Pascal
- Column:
- Tokenizer:
- Type: Default
- Paramters:
- Delimiter: '_'
- Converter:
- Type: Pascal
Repository:
Type: Table
Module: Repository
TemplateEngine:
Path: Repository.cshtml
- IgnoreNoPKTable: true
- IgnoreView: true
Output:
- Path: '{{Project.Module}}.{{Build.Module}}'
+ Path: 'src/{{Project.Module}}.{{Build.Module}}'
Name: 'I{{Items.CurrentTable.ConvertedName}}Repository'
Extension: .cs
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
Service:
Type: Table
Module: Service
TemplateEngine:
Path: Service.cshtml
- IgnoreNoPKTable: true
- IgnoreView: true
Output:
- Path: '{{Project.Module}}.{{Build.Module}}'
+ Path: 'src/{{Project.Module}}.{{Build.Module}}'
Name: '{{Items.CurrentTable.ConvertedName}}Service'
Extension: .cs
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
APIController:
Type: Table
Module: API
TemplateEngine:
Path: API/APIController.cshtml
- IgnoreNoPKTable: true
- IgnoreView: true
Output:
- Path: '{{Project.Module}}.{{Build.Module}}/Controllers'
+ Path: 'src/{{Project.Module}}.{{Build.Module}}/Controllers'
Name: '{{Items.CurrentTable.ConvertedName}}Controller'
Extension: .cs
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
SqlMap:
Type: Table
TemplateEngine:
Path: SqlMap.cshtml
Output:
- Path: '{{Project.Module}}.API/Maps'
+ Path: 'src/{{Project.Module}}.Repository/Maps'
Name: '{{Items.CurrentTable.ConvertedName}}'
Extension: .xml
- IgnoreNoPKTable: true
- IgnoreView: true
- NamingConverter:
- Table:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
- View:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'V_'
- Delimiter: '_'
- Converter:
- Type: Pascal
- Column:
- Tokenizer:
- Type: Default
- Paramters:
- IgnorePrefix: 'T_'
- Delimiter: '_'
- Converter:
- Type: Pascal
\ No newline at end of file
+
+# Please install dotnet-format first!
+# dotnet tool install -g dotnet-format
+ CodeFormat:
+ Type: Process
+ Parameters:
+ FileName: powershell
+ WorkingDirectory: '{{Project.Output.Path}}'
+ Args: dotnet-format
+
+ ReStore:
+ Type: Process
+ Parameters:
+ FileName: powershell
+ WorkingDirectory: '{{Project.Output.Path}}'
+ Args: dotnet restore
+
+# BuildDocker:
+# Type: Process
+# Parameters:
+# FileName: powershell
+# WorkingDirectory: '{{Project.Output.Path}}'
+# Args: docker build -t {{Project.Parameters.DockerImage}}:v1.0.0 .
+
+# RunDocker:
+# Type: Process
+# Parameters:
+# FileName: powershell
+# WorkingDirectory: '{{Project.Output.Path}}'
+# Args: docker run --name {{Project.Parameters.DockerImage}} --rm -d -p 8008:80 {{Project.Parameters.DockerImage}}:v1.0.0 .
+
+# Publish:
+# Type: Process
+# Parameters:
+# FileName: powershell
+# WorkingDirectory: '{{Project.Output.Path}}'
+# Args: dotnet publish -c Release -o '{{Project.Output.Path}}\publish'
+
+# Run:
+# Type: Process
+# Parameters:
+# FileName: powershell
+# WorkingDirectory: '{{Project.Output.Path}}\publish'
+# CreateNoWindow: false
+# RedirectStandardOutput: false
+# RedirectStandardError: false
+# WaitForExit: false
+# WriteLines: ['dotnet {{Project.Module}}.API.dll']
+
+# RunChrome:
+# Type: Process
+# Parameters:
+# FileName: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
+# CreateNoWindow: false
+# Args: http://localhost:8008/swagger
\ No newline at end of file
diff --git a/doc/smartcode-etl.db b/doc/smartcode-etl.db
index 745c1f7..87d7ac0 100644
Binary files a/doc/smartcode-etl.db and b/doc/smartcode-etl.db differ
diff --git a/src/SmartCode.App/BuildTasks/AbstractBuildTask.cs b/src/SmartCode.App/BuildTasks/AbstractBuildTask.cs
index 14c43d4..32415f6 100644
--- a/src/SmartCode.App/BuildTasks/AbstractBuildTask.cs
+++ b/src/SmartCode.App/BuildTasks/AbstractBuildTask.cs
@@ -22,7 +22,7 @@ public AbstractBuildTask(string name, ILogger logger)
public abstract Task Build(BuildContext context);
- public virtual void Initialize(IDictionary paramters)
+ public virtual void Initialize(IDictionary parameters)
{
Initialized = true;
}
diff --git a/src/SmartCode.App/BuildTasks/ClearBuildTask.cs b/src/SmartCode.App/BuildTasks/ClearBuildTask.cs
index f8c9aa6..87a7d9f 100644
--- a/src/SmartCode.App/BuildTasks/ClearBuildTask.cs
+++ b/src/SmartCode.App/BuildTasks/ClearBuildTask.cs
@@ -20,9 +20,9 @@ public ClearBuildTask(ILogger logger)
public Task Build(BuildContext context)
{
- var paramters = context.Build.Paramters;
- if (paramters == null) { return Task.CompletedTask; ; }
- if (paramters.Value("Dirs", out string clearDirs))
+ var parameters = context.Build.Parameters;
+ if (parameters == null) { return Task.CompletedTask; ; }
+ if (parameters.Value("Dirs", out string clearDirs))
{
var _clearDirs = clearDirs.Split(',');
foreach (var dir in _clearDirs)
@@ -36,7 +36,7 @@ public Task Build(BuildContext context)
_logger.LogInformation($"ClearBuildTask Delete directory:{fullDir} End!");
}
}
- if (paramters.Value("Files", out string clearFiles))
+ if (parameters.Value("Files", out string clearFiles))
{
var _clearFiles = clearFiles.Split(',');
foreach (var file in _clearFiles)
@@ -54,7 +54,7 @@ public Task Build(BuildContext context)
}
private readonly ILogger _logger;
- public void Initialize(IDictionary paramters)
+ public void Initialize(IDictionary parameters)
{
}
diff --git a/src/SmartCode.App/BuildTasks/MultiTemplateBuildTask.cs b/src/SmartCode.App/BuildTasks/MultiTemplateBuildTask.cs
index 436b567..d12229f 100644
--- a/src/SmartCode.App/BuildTasks/MultiTemplateBuildTask.cs
+++ b/src/SmartCode.App/BuildTasks/MultiTemplateBuildTask.cs
@@ -4,7 +4,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
-using System.Text;
using System.Threading.Tasks;
namespace SmartCode.App.BuildTasks
@@ -30,59 +29,81 @@ public MultiTemplateBuildTask(IPluginManager pluginManager
_pluginManager = pluginManager;
_logger = logger;
}
+
public async Task Build(BuildContext context)
{
- if (context.Build.Paramters.Value(TEMPLATES_KEY, out IEnumerable templates))
+ if (context.Build.Parameters.Value(TEMPLATES_KEY, out IEnumerable templates))
{
foreach (var templateKVs in templates)
{
- var _templateKVs = (Dictionary