feat: webfrist基本流程已完成
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -27,17 +28,17 @@ namespace Yi.Framework.Module.WebFirstManager.Impl
|
||||
{
|
||||
_tableRepository = tableRepository;
|
||||
_codeFileManager = codeFileManager;
|
||||
_webTemplateManager= webTemplateManager;
|
||||
_webTemplateManager = webTemplateManager;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Web To Code
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task PostWebBuildCodeAsync()
|
||||
public async Task PostWebBuildCodeAsync(List<long> ids)
|
||||
{
|
||||
//获取全部表
|
||||
var tables = await _tableRepository.GetListAsync();
|
||||
var tables = await _tableRepository._DbQueryable.Where(x => ids.Contains(x.Id)).Includes(x => x.Fields).ToListAsync();
|
||||
foreach (var table in tables)
|
||||
{
|
||||
await _codeFileManager.BuildWebToCodeAsync(table);
|
||||
@@ -61,7 +62,7 @@ namespace Yi.Framework.Module.WebFirstManager.Impl
|
||||
[UnitOfWork]
|
||||
public async Task PostCodeBuildWebAsync()
|
||||
{
|
||||
var tableAggregateRoots =await _webTemplateManager.BuildCodeToWebAsync();
|
||||
var tableAggregateRoots = await _webTemplateManager.BuildCodeToWebAsync();
|
||||
//覆盖数据库,将聚合根保存到数据库
|
||||
_tableRepository._Db.DbMaintenance.TruncateTable<TableAggregateRoot>();
|
||||
_tableRepository._Db.DbMaintenance.TruncateTable<FieldEntity>();
|
||||
@@ -69,7 +70,7 @@ namespace Yi.Framework.Module.WebFirstManager.Impl
|
||||
//导航插入即可
|
||||
await _tableRepository._Db.InsertNav(tableAggregateRoots).Include(x => x.Fields).ExecuteCommandAsync();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -80,5 +81,17 @@ namespace Yi.Framework.Module.WebFirstManager.Impl
|
||||
public async Task PostCodeBuildDbAsync()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打开目录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task PostDir(string path)
|
||||
{
|
||||
path = Uri.UnescapeDataString(path);
|
||||
//去除包含@的目录
|
||||
path = string.Join("\\", path.Split("\\").Where(x => !x.Contains("@")).ToList());
|
||||
Process.Start("explorer.exe", path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user