This commit is contained in:
2026-02-06 18:34:35 +08:00
commit f7f4c94c00
3285 changed files with 563208 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using iMES.Core.BaseProvider;
using iMES.Entity.DomainModels;
using iMES.Core.Extensions.AutofacManager;
namespace iMES.Builder.IRepositories
{
public partial interface ISys_TableInfoRepository : IDependency,IRepository<Sys_TableInfo>
{
}
}

View File

@@ -0,0 +1,10 @@
using iMES.Core.BaseProvider;
using iMES.Entity.DomainModels;
namespace iMES.Builder.IServices
{
public partial interface ISys_TableInfoService : IService<Sys_TableInfo>
{
}
}

View File

@@ -0,0 +1,26 @@
using iMES.Core.BaseProvider;
using iMES.Entity.DomainModels;
using System.Collections.Generic;
using System.Threading.Tasks;
using iMES.Core.Utilities;
namespace iMES.Builder.IServices
{
public partial interface ISys_TableInfoService
{
Task<(string, string)> GetTableTree();
string CreateEntityModel(Sys_TableInfo tableInfo);
WebResponseContent SaveEidt(Sys_TableInfo sysTableInfo);
string CreateServices(string tableName, string nameSpace, string foldername, bool webController, bool apiController);
string CreateVuePage(Sys_TableInfo sysTableInfo, string vuePath);
object LoadTable(int parentId, string tableName, string columnCNName, string nameSpace, string foldername, int table_Id, bool isTreeLoad,string dbServer);
Task<WebResponseContent> SyncTable(string tableName);
Task<WebResponseContent> DelTree(int table_Id);
}
}

View File

@@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:34188/",
"sslPort": 44309
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"iMES.Builder": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:5001;http://localhost:5000"
}
}
}

View File

@@ -0,0 +1,22 @@
using iMES.Builder.IRepositories;
using iMES.Core.BaseProvider;
using iMES.Core.EFDbContext;
using iMES.Core.Extensions.AutofacManager;
using iMES.Entity.DomainModels;
namespace iMES.Builder.Repositories
{
public partial class Sys_TableInfoRepository : RepositoryBase<Sys_TableInfo>, ISys_TableInfoRepository
{
public Sys_TableInfoRepository(SysDbContext dbContext)
: base(dbContext)
{
}
public static ISys_TableInfoRepository GetService
{
get { return AutofacContainerModule.GetService<ISys_TableInfoRepository>(); }
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
using iMES.Builder.IRepositories;
using iMES.Builder.IServices;
using iMES.Core.BaseProvider;
using iMES.Core.Extensions.AutofacManager;
using iMES.Entity.DomainModels;
namespace iMES.Builder.Services
{
public partial class Sys_TableInfoService : ServiceBase<Sys_TableInfo, ISys_TableInfoRepository>, ISys_TableInfoService, IDependency
{
public Sys_TableInfoService(ISys_TableInfoRepository repository)
: base(repository)
{
Init(repository);
}
public static ISys_TableInfoService Instance
{
get { return AutofacContainerModule.GetService<ISys_TableInfoService>(); }
}
}
}

View File

@@ -0,0 +1,93 @@
using System.IO;
using System.Linq;
using iMES.Core.Extensions;
namespace iMES.Builder.Utility
{
public class ProjectPath
{
// private int findCount = 1;
/// <summary>
/// 获取web父目录所在位置
/// </summary>
/// <returns></returns>
public static DirectoryInfo GetProjectDirectoryInfo()
{
return GetProjectDirectoryInfo(new DirectoryInfo("".MapPath()), 1);
}
public static string GetProjectFileName(string startsWith)
{
string fileNames = GetProjectDirectoryInfo()?.GetDirectories()
.Where(
c =>
//c.Name.StartsWith(startsWith)&&
c.Name != startsWith + ".Core"
&& c.Name != startsWith + ".Entity"
&& !c.Name.ToLower().EndsWith(".web")
&& !c.Name.ToLower().EndsWith(".webapi")
&& !c.Name.ToLower().EndsWith(".builder")
&& c.Name.ToLower()!=".vs"
).Select(x => x.Name).ToList().Serialize();
if (string.IsNullOrEmpty(fileNames))
{
fileNames = new DirectoryInfo("".MapPath()).GetFiles().Where(x => x.Name.EndsWith(".dll")
//&& x.Name.StartsWith(startsWith)
&& !x.Name.EndsWith(".Core.dll")
&& !x.Name.EndsWith(".Entity.dll")
&& !x.Name.EndsWith(".Builder.dll")
&& !x.Name.ToLower().EndsWith(".web")
&& !x.Name.ToLower().EndsWith(".webapi")
&& !x.Name.ToLower().EndsWith(".builder")
).Select(x => x.Name.Replace(".dll", "")).ToList().Serialize();
}
return fileNames ?? "''";
}
/// <summary>
/// 获取指定结尾的项目名称
/// </summary>
/// <param name="lastIndexOfName"></param>
/// <returns></returns>
public static string GetLastIndexOfDirectoryName(string lastIndexOfName)
{
string projectName = GetProjectDirectoryInfo()?.GetDirectories()
.Where(c => c.Name.LastIndexOf(lastIndexOfName) != -1).Select(x => x.Name).FirstOrDefault();
if (string.IsNullOrEmpty(projectName))
{
projectName = new DirectoryInfo("".MapPath()).GetFiles().Where(x => x.Name.LastIndexOf(lastIndexOfName + ".dll") != -1).FirstOrDefault().Name;
if (!string.IsNullOrEmpty(projectName))
{
projectName = projectName.Replace(".dll", "");
}
}
return projectName;
}
/// <summary>
/// 获取项目所在路径
/// </summary>
/// <param name="directoryInfo"></param>
/// <returns></returns>
private static DirectoryInfo GetProjectDirectoryInfo(DirectoryInfo directoryInfo, int findCount)
{
if (directoryInfo == null)
{
return null;
}
if (directoryInfo.Exists
&& directoryInfo.GetDirectories().Where(x => x.Name.LastIndexOf(".Web") != -1).FirstOrDefault() != null)
{
return directoryInfo;
}
if (findCount < 7)
{
findCount++;
DirectoryInfo dir = GetProjectDirectoryInfo(directoryInfo.Parent, findCount);
if (dir != null)
{
return dir;
}
}
return null;
}
}
}

View File

@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Globals">
<SccProjectName></SccProjectName>
<SccProvider></SccProvider>
<SccAuxPath></SccAuxPath>
<SccLocalPath></SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ApplicationIcon />
<OutputType>Library</OutputType>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="6.2.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\iMES.Core\iMES.Core.csproj" />
<ProjectReference Include="..\iMES.Entity\iMES.Entity.csproj" />
</ItemGroup>
</Project>