代码生成增加预览功能、其他功能优化

This commit is contained in:
izory
2021-09-24 18:37:51 +08:00
parent 3a418df47f
commit a4a6f673b2
21 changed files with 516 additions and 622 deletions

View File

@@ -10,30 +10,29 @@ namespace ZR.CodeGenerator.Model
public class GenerateDto
{
public long TableId { get; set; }
public string[] QueryColumn { get; set; }
//public string[] QueryColumn { get; set; }
/// <summary>
/// 是否预览代码
/// </summary>
public int IsPreview { get; set; }
/// <summary>
/// 要生成的文件
/// </summary>
public int[] genFiles { get; set; }
public int[] GenCodeFiles { get; set; }
/// <summary>
/// 如果目标文件存在是否覆盖。默认为false
/// </summary>
public bool coverd { get; set; } = true;
public bool Coverd { get; set; } = true;
/// <summary>
/// 生成代码的数据库类型 0、mysql 1、sqlserver
/// </summary>
public int DbType { get; set; }
public GenTable GenTable { get; set; }
#region
//public string ModelPath { get; set; }
//public string ServicePath { get; set; }
//public string RepositoryPath { get; set; }
//public string ApiPath { get; set; }
//public string VuePath { get; set; }
//public string VueApiPath { get; set; }
//public string ParentPath { get; set; } = "..";
/// <summary>
/// 代码模板预览存储路径存放
/// </summary>
public List<GenCode> GenCodes { get; set; } = new List<GenCode>();
/// <summary>
/// 代码生成路径
/// </summary>
@@ -48,4 +47,20 @@ namespace ZR.CodeGenerator.Model
public string ZipFileName { get; set; }
#endregion
}
public class GenCode
{
public int Type { get; set; }
public string Title { get; set; }
public string Path { get; set; }
public string Content { get; set; }
public GenCode(int type, string title, string path, string content)
{
Type = type;
Title = title;
Path = path;
Content = content;
}
}
}

View File

@@ -100,5 +100,7 @@ namespace ZR.CodeGenerator.Model
/// views、js文件名
/// </summary>
public string ViewsFileName { get; set; }
public string Author { get; set; }
public string AddTime { get; set; } = DateTime.Now.ToString("yyyy-MM-dd");
}
}