File tree Expand file tree Collapse file tree 13 files changed +84
-30
lines changed Expand file tree Collapse file tree 13 files changed +84
-30
lines changed Original file line number Diff line number Diff line change 22 <PropertyGroup >
33 <VersionMajor >2</VersionMajor >
44 <VersionMinor >2</VersionMinor >
5- <VersionPatch >55 </VersionPatch >
5+ <VersionPatch >56 </VersionPatch >
66 <VersionPrefix >$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix >
77 </PropertyGroup >
88</Project >
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ TemplateEngine:
1212 Name : Razor
1313 Root : .
1414Parameters :
15- ExtractMode : QueryTime
15+ ExtractMode : LastMaxModifyTime
1616 ModifyTime : ModifyTime
1717 ExtractConnectionString : Data Source=localhost;database=SqlServerDB;uid=SmartSql;pwd=SmartSql
1818 LoadDbProvider : PostgreSql
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ Output:
1414 Type : File
1515 Path : ' E:\SmartSql-Starter'
1616Parameters :
17- SmartSqlVersion : ' 4.0.58 '
18- SmartSqlSchemaVersion : ' 4.0.42 '
17+ SmartSqlVersion : ' 4.0.71 '
18+ SmartSqlSchemaVersion : ' 4.0.65 '
1919 BuildDir : ' E:\SmartSql-Starter\build'
2020 DockerImage : ' smartsql.starter'
2121
Original file line number Diff line number Diff line change 55 </PropertyGroup >
66
77 <ItemGroup >
8- <PackageReference Include =" SmartSql.Options" Version =" 4.0.58 " />
9- <PackageReference Include =" SmartSql.TypeHandler" Version =" 4.0.58 " />
10- <PackageReference Include =" SmartSql.TypeHandler.PostgreSql" Version =" 4.0.58 " />
8+ <PackageReference Include =" SmartSql.Options" Version =" 4.0.71 " />
9+ <PackageReference Include =" SmartSql.TypeHandler" Version =" 4.0.71 " />
10+ <PackageReference Include =" SmartSql.TypeHandler.PostgreSql" Version =" 4.0.71 " />
1111 <PackageReference Include =" System.Data.SqlClient" Version =" 4.6.1" />
1212 <PackageReference Include =" System.Data.SQLite" Version =" 1.0.110" />
1313 <PackageReference Include =" MySql.Data" Version =" 8.0.16" />
Original file line number Diff line number Diff line change 1- <Project Sdk =" Microsoft.NET.Sdk" >
1+ <Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
44 <TargetFramework >netstandard2.0</TargetFramework >
55 </PropertyGroup >
66
77 <ItemGroup >
8- <PackageReference Include =" System.Data.SQLite" Version =" 1.0.110 " />
8+ <PackageReference Include =" System.Data.SQLite" Version =" 1.0.111 " />
99 </ItemGroup >
1010
1111 <ItemGroup >
Original file line number Diff line number Diff line change 55 </PropertyGroup >
66
77 <ItemGroup >
8- <PackageReference Include =" SmartSql.Bulk.MySql" Version =" 4.0.58 " />
9- <PackageReference Include =" SmartSql.Bulk.PostgreSql" Version =" 4.0.58 " />
10- <PackageReference Include =" SmartSql.Bulk.SqlServer" Version =" 4.0.58 " />
8+ <PackageReference Include =" SmartSql.Bulk.MySql" Version =" 4.0.71 " />
9+ <PackageReference Include =" SmartSql.Bulk.PostgreSql" Version =" 4.0.71 " />
10+ <PackageReference Include =" SmartSql.Bulk.SqlServer" Version =" 4.0.71 " />
1111 </ItemGroup >
1212
1313 <ItemGroup >
Original file line number Diff line number Diff line change 1- namespace SmartCode . Generator . Entity {
2-
3- public static class ColumnExtensions {
1+ using System ;
2+ using System . Text ;
43
4+ namespace SmartCode . Generator . Entity
5+ {
6+ public static class ColumnExtensions
7+ {
58 /// <summary>
69 /// 获取列的摘要说明,如果 Description 不为空, 则返回 Description;
710 /// 否则返回 Name + DbType
811 /// </summary>
9- public static string GetSummary ( this Column column ) {
10- if ( ! string . IsNullOrEmpty ( column . Description ) ) {
12+ public static string GetSummary ( this Column column )
13+ {
14+ if ( ! string . IsNullOrEmpty ( column . Description ) )
15+ {
1116 return column . Description ;
1217 }
18+
1319 return column . Name + ", " + column . DbType ;
1420 }
1521 }
16- }
22+ }
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Text ;
3+ using SmartCode . Generator . Entity ;
4+
5+ namespace SmartCode . Generator . Extensions
6+ {
7+ public static class SummaryExtensions
8+ {
9+ public static string GetCSharpSummary ( this Column column )
10+ {
11+ var summary = column . GetSummary ( ) ;
12+ return GetCSharpSummary ( summary ) ;
13+ }
14+
15+ public static string GetCSharpSummary ( this Table table )
16+ {
17+ var summary = table . GetSummary ( ) ;
18+ return GetCSharpSummary ( summary ) ;
19+ }
20+ public static string GetCSharpSummary ( this string summary )
21+ {
22+ StringBuilder csharpSummary = new StringBuilder ( ) ;
23+ csharpSummary . AppendLine ( "///<summary>" ) ;
24+ if ( summary . Contains ( Environment . NewLine ) )
25+ {
26+ foreach ( var summaryLine in summary . Split ( Environment . NewLine . ToCharArray ( ) ) )
27+ {
28+ if ( String . IsNullOrEmpty ( summaryLine ) )
29+ {
30+ continue ;
31+ }
32+
33+ csharpSummary . AppendLine ( $ "/// { summaryLine } ") ;
34+ }
35+ }
36+ else
37+ {
38+ csharpSummary . AppendLine ( $ "/// { summary } ") ;
39+ }
40+
41+ csharpSummary . Append ( "///</summary>" ) ;
42+ return csharpSummary . ToString ( ) ;
43+ }
44+ }
45+ }
Original file line number Diff line number Diff line change 11@using SmartCode
2+ @using SmartCode .Generator .Extensions
23@model BuildContext
34@{
45 Layout = " ../_CSharpLayout.cshtml" ;
@@ -25,6 +26,7 @@ using @(project.Module).API.Messages;
2526
2627namespace @( project .Module ) .API.Controllers
2728{
29+ @table.GetCSharpSummary()
2830 [ApiController ]
2931 [Route (" [controller]/[action]" )]
3032 public class @(table.ConvertedName)Controller : Controller
Original file line number Diff line number Diff line change 1313 " environmentVariables" : {
1414 " ASPNETCORE_ENVIRONMENT" : " Development"
1515 } ,
16- " applicationUrl" : " http://localhost:8088/ "
16+ " applicationUrl" : " http://localhost:8088"
1717 }
1818 }
1919 }
You can’t perform that action at this time.
0 commit comments