diff --git a/Yi.Abp.Net8/Yi.Abp.sln b/Yi.Abp.Net8/Yi.Abp.sln index 5c963eaf..196f77b5 100644 --- a/Yi.Abp.Net8/Yi.Abp.sln +++ b/Yi.Abp.Net8/Yi.Abp.sln @@ -30,6 +30,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution common.props = common.props end.sh = end.sh start.sh = start.sh + usings.props = usings.props EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.SqlSugarCore.Abstractions", "framework\Yi.Framework.SqlSugarCore.Abstractions\Yi.Framework.SqlSugarCore.Abstractions.csproj", "{FD6D6860-3753-4747-8A26-977E4A3001F9}" @@ -104,6 +105,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.TenantManageme EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yi.Framework.TenantManagement.Application.Contracts", "module\tenant-management\Yi.Framework.TenantManagement.Application.Contracts\Yi.Framework.TenantManagement.Application.Contracts.csproj", "{FA735055-CBDD-4EFD-B84B-85810DA1425E}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "code-gun", "code-gun", "{4FFE7212-21F2-476D-B628-3C65E6C5075E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.CodeGun.Application", "module\code-gun\Yi.Framework.CodeGun.Application\Yi.Framework.CodeGun.Application.csproj", "{97EC40D7-DBFA-467A-98CB-221AF27B14F2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.CodeGun.Application.Contracts", "module\code-gun\Yi.Framework.CodeGun.Application.Contracts\Yi.Framework.CodeGun.Application.Contracts.csproj", "{882BC563-2F75-4B95-AC96-F4BF23F5E69D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.CodeGun.Domain", "module\code-gun\Yi.Framework.CodeGun.Domain\Yi.Framework.CodeGun.Domain.csproj", "{85CB8517-2B80-42D8-B954-081079AC9BA0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.CodeGun.Domain.Shared", "module\code-gun\Yi.Framework.CodeGun.Domain.Shared\Yi.Framework.CodeGun.Domain.Shared.csproj", "{EEFF0F05-2709-4151-A8CE-667935CEAE0B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -262,6 +273,22 @@ Global {FA735055-CBDD-4EFD-B84B-85810DA1425E}.Debug|Any CPU.Build.0 = Debug|Any CPU {FA735055-CBDD-4EFD-B84B-85810DA1425E}.Release|Any CPU.ActiveCfg = Release|Any CPU {FA735055-CBDD-4EFD-B84B-85810DA1425E}.Release|Any CPU.Build.0 = Release|Any CPU + {97EC40D7-DBFA-467A-98CB-221AF27B14F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {97EC40D7-DBFA-467A-98CB-221AF27B14F2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {97EC40D7-DBFA-467A-98CB-221AF27B14F2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {97EC40D7-DBFA-467A-98CB-221AF27B14F2}.Release|Any CPU.Build.0 = Release|Any CPU + {882BC563-2F75-4B95-AC96-F4BF23F5E69D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {882BC563-2F75-4B95-AC96-F4BF23F5E69D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {882BC563-2F75-4B95-AC96-F4BF23F5E69D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {882BC563-2F75-4B95-AC96-F4BF23F5E69D}.Release|Any CPU.Build.0 = Release|Any CPU + {85CB8517-2B80-42D8-B954-081079AC9BA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85CB8517-2B80-42D8-B954-081079AC9BA0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85CB8517-2B80-42D8-B954-081079AC9BA0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85CB8517-2B80-42D8-B954-081079AC9BA0}.Release|Any CPU.Build.0 = Release|Any CPU + {EEFF0F05-2709-4151-A8CE-667935CEAE0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EEFF0F05-2709-4151-A8CE-667935CEAE0B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EEFF0F05-2709-4151-A8CE-667935CEAE0B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EEFF0F05-2709-4151-A8CE-667935CEAE0B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -309,6 +336,11 @@ Global {9C8C3C53-3DCE-4516-867E-228858E61B26} = {73CCF2C4-B9FD-44AB-8D4B-0A421805B094} {17816837-E53B-486B-B796-53C601FE6CD9} = {499A8C71-7892-42D0-A77E-48756E1EFF16} {FA735055-CBDD-4EFD-B84B-85810DA1425E} = {499A8C71-7892-42D0-A77E-48756E1EFF16} + {4FFE7212-21F2-476D-B628-3C65E6C5075E} = {2317227D-7796-4E7B-BEDB-7CD1CAE7B853} + {97EC40D7-DBFA-467A-98CB-221AF27B14F2} = {4FFE7212-21F2-476D-B628-3C65E6C5075E} + {882BC563-2F75-4B95-AC96-F4BF23F5E69D} = {4FFE7212-21F2-476D-B628-3C65E6C5075E} + {85CB8517-2B80-42D8-B954-081079AC9BA0} = {4FFE7212-21F2-476D-B628-3C65E6C5075E} + {EEFF0F05-2709-4151-A8CE-667935CEAE0B} = {4FFE7212-21F2-476D-B628-3C65E6C5075E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {23D6FBC9-C970-4641-BC1E-2AEA59F51C18} diff --git a/Yi.Abp.Net8/common.props b/Yi.Abp.Net8/common.props index c803616c..59844637 100644 --- a/Yi.Abp.Net8/common.props +++ b/Yi.Abp.Net8/common.props @@ -1,4 +1,6 @@ + + net8.0 enable diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Field/FieldDto.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Field/FieldDto.cs new file mode 100644 index 00000000..35ab76b9 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Field/FieldDto.cs @@ -0,0 +1,42 @@ +using Volo.Abp.Application.Dtos; +using Yi.Framework.CodeGun.Domain.Shared.Enums; + +namespace Yi.Framework.CodeGun.Application.Contracts.Dtos.Field +{ + public class FieldDto : EntityDto + { + /// + /// 字段名称 + /// + public string Name { get; set; } + public string? Description { get; set; } + + public int OrderNum { get; set; } + public int Length { get; set; } + + public FieldTypeEnum FieldType { get; set; } + + public Guid TableId { get; set; } + + /// + /// 是否必填 + /// + public bool IsRequired { get; set; } + + /// + /// 是否主键 + /// + public bool IsKey { get; set; } + + /// + /// 是否自增 + /// + public bool IsAutoAdd { get; set; } + + /// + /// 是否公共 + /// + public bool IsPublic { get; set; } + public Guid Id { get; set; } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Field/FieldGetListInput.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Field/FieldGetListInput.cs new file mode 100644 index 00000000..516dbac1 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Field/FieldGetListInput.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Application.Dtos; + +namespace Yi.Framework.CodeGun.Application.Contracts.Dtos.Field +{ + public class FieldGetListInput : PagedAndSortedResultRequestDto + { + /// + /// 字段名称 + /// + public string? Name { get; set; } + + public long? TableId { get; set; } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Table/TableDto.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Table/TableDto.cs new file mode 100644 index 00000000..45421430 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Table/TableDto.cs @@ -0,0 +1,24 @@ +using Volo.Abp.Application.Dtos; +using Yi.Framework.CodeGun.Application.Contracts.Dtos.Field; + +namespace Yi.Framework.CodeGun.Application.Contracts.Dtos.Table +{ + public class TableDto : EntityDto + { + public Guid Id { get; set; } + /// + /// 表名 + /// + public string Name { get; set; } + + /// + /// 备注 + /// + public string? Description { get; set; } + + /// + /// 一表多字段 + /// + public List Fields { get; set; } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Table/TableGetListInput.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Table/TableGetListInput.cs new file mode 100644 index 00000000..42fdc266 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Table/TableGetListInput.cs @@ -0,0 +1,8 @@ +using Volo.Abp.Application.Dtos; + +namespace Yi.Framework.CodeGun.Application.Contracts.Dtos.Table +{ + public class TableGetListInput : PagedAndSortedResultRequestDto + { + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Template/TemplateDto.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Template/TemplateDto.cs new file mode 100644 index 00000000..74007317 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Template/TemplateDto.cs @@ -0,0 +1,30 @@ +using Volo.Abp.Application.Dtos; + +namespace Yi.Framework.CodeGun.Application.Contracts.Dtos.Template +{ + public class TemplateDto : EntityDto + { + public Guid Id { get; set; } + + /// + /// 模板字符串 + /// + public string TemplateStr { get; set; } = string.Empty; + + /// + /// 生成路径 + /// + public string BuildPath { get; set; } + + + /// + /// 模板名称 + /// + public string Name { get; set; } + + /// + /// 备注 + /// + public string? Remarks { get; set; } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Template/TemplateGetListInput.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Template/TemplateGetListInput.cs new file mode 100644 index 00000000..324dcaad --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Dtos/Template/TemplateGetListInput.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Application.Dtos; + +namespace Yi.Framework.CodeGun.Application.Contracts.Dtos.Template +{ + public class TemplateGetListInput : PagedAndSortedResultRequestDto + { + + /// + /// 模板名称 + /// + public string? Name { get; set; } + + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/IServices/ICodeGunService.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/IServices/ICodeGunService.cs new file mode 100644 index 00000000..5897a422 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/IServices/ICodeGunService.cs @@ -0,0 +1,8 @@ +using Volo.Abp.Application.Services; + +namespace Yi.Framework.CodeGun.Application.Contracts.IServices +{ + public interface ICodeGunService : IApplicationService + { + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/IServices/IFieldService.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/IServices/IFieldService.cs new file mode 100644 index 00000000..c4fe6e9d --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/IServices/IFieldService.cs @@ -0,0 +1,9 @@ +using Yi.Framework.CodeGun.Application.Contracts.Dtos.Field; +using Yi.Framework.Ddd.Application.Contracts; + +namespace Yi.Framework.CodeGun.Application.Contracts.IServices +{ + public interface IFieldService : IYiCrudAppService + { + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/IServices/ITableService.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/IServices/ITableService.cs new file mode 100644 index 00000000..82302c4f --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/IServices/ITableService.cs @@ -0,0 +1,9 @@ +using Yi.Framework.CodeGun.Application.Contracts.Dtos.Table; +using Yi.Framework.Ddd.Application.Contracts; + +namespace Yi.Framework.CodeGun.Application.Contracts.IServices +{ + public interface ITableService : IYiCrudAppService + { + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/IServices/ITemplateService.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/IServices/ITemplateService.cs new file mode 100644 index 00000000..bc461f1c --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/IServices/ITemplateService.cs @@ -0,0 +1,9 @@ +using Yi.Framework.CodeGun.Application.Contracts.Dtos.Template; +using Yi.Framework.Ddd.Application.Contracts; + +namespace Yi.Framework.CodeGun.Application.Contracts.IServices +{ + public interface ITemplateService : IYiCrudAppService + { + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Yi.Framework.CodeGun.Application.Contracts.csproj b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Yi.Framework.CodeGun.Application.Contracts.csproj new file mode 100644 index 00000000..3c963e90 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/Yi.Framework.CodeGun.Application.Contracts.csproj @@ -0,0 +1,14 @@ + + + + net8.0 + enable + enable + + + + + + + + diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/YiFrameworkCodeGunApplicationContractsModule.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/YiFrameworkCodeGunApplicationContractsModule.cs new file mode 100644 index 00000000..4f308531 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application.Contracts/YiFrameworkCodeGunApplicationContractsModule.cs @@ -0,0 +1,12 @@ +using Yi.Framework.CodeGun.Domain.Shared; +using Yi.Framework.Ddd.Application.Contracts; + +namespace Yi.Framework.CodeGun.Application.Contracts +{ + [DependsOn(typeof(YiFrameworkCodeGunDomainSharedModule), + typeof(YiFrameworkDddApplicationContractsModule))] + public class YiFrameworkCodeGunApplicationContractsModule:AbpModule + { + + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Services/CodeGunService.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Services/CodeGunService.cs new file mode 100644 index 00000000..809750ea --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Services/CodeGunService.cs @@ -0,0 +1,97 @@ +using System.Diagnostics; +using System.Runtime.InteropServices; +using Volo.Abp.Application.Services; +using Volo.Abp.Uow; +using Yi.Framework.CodeGun.Application.Contracts.IServices; +using Yi.Framework.CodeGun.Domain.Entities; +using Yi.Framework.CodeGun.Domain.Managers; +using Yi.Framework.SqlSugarCore.Abstractions; + +namespace Yi.Framework.CodeGun.Application.Services +{ + /// + /// CodeGun + /// + public class CodeGunService : ApplicationService, ICodeGunService + { + private ISqlSugarRepository _tableRepository; + private CodeFileManager _codeFileManager; + private WebTemplateManager _webTemplateManager; + public CodeGunService(ISqlSugarRepository tableRepository, CodeFileManager codeFileManager, WebTemplateManager webTemplateManager) + { + _tableRepository = tableRepository; + _codeFileManager = codeFileManager; + _webTemplateManager = webTemplateManager; + } + + /// + /// Web To Code + /// + /// + public async Task PostWebBuildCodeAsync(List ids) + { + //获取全部表 + 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); + } + + } + + + /// + /// Web To Db + /// + /// + public async Task PostWebBuildDbAsync() + { + throw new NotImplementedException(); + } + + /// + /// Code To Web + /// + /// + [UnitOfWork] + public async Task PostCodeBuildWebAsync() + { + var tableAggregateRoots = await _webTemplateManager.BuildCodeToWebAsync(); + //覆盖数据库,将聚合根保存到数据库 + _tableRepository._Db.DbMaintenance.TruncateTable(); + _tableRepository._Db.DbMaintenance.TruncateTable(); + + //导航插入即可 + await _tableRepository._Db.InsertNav(tableAggregateRoots).Include(x => x.Fields).ExecuteCommandAsync(); + } + + + /// + /// Code To Db + /// + /// + public async Task PostCodeBuildDbAsync() + { + throw new NotImplementedException(); + } + + /// + /// 打开目录 + /// + /// + public async Task PostDir(string path) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + path = Uri.UnescapeDataString(path); + //去除包含@的目录 + path = string.Join("\\", path.Split("\\").Where(x => !x.Contains("@")).ToList()); + Process.Start("explorer.exe", path); + } + else + { + throw new UserFriendlyException("当前操作系统不支持打开目录"); + } + } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Services/FieldService.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Services/FieldService.cs new file mode 100644 index 00000000..a6560d7b --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Services/FieldService.cs @@ -0,0 +1,54 @@ +using System; +using System.Reflection; +using System.Xml.Linq; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json.Linq; +using SqlSugar; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Domain.Repositories; +using Yi.Framework.CodeGun.Application.Contracts.Dtos.Field; +using Yi.Framework.CodeGun.Application.Contracts.IServices; +using Yi.Framework.CodeGun.Domain.Entities; +using Yi.Framework.CodeGun.Domain.Shared.Enums; +using Yi.Framework.Ddd.Application; +using Yi.Framework.SqlSugarCore.Abstractions; + +namespace Yi.Framework.CodeGun.Application.Services +{ + /// + /// 字段管理 + /// + public class FieldService : YiCrudAppService, IFieldService + { + private ISqlSugarRepository _repository; + public FieldService(ISqlSugarRepository repository) : base(repository) + { + _repository = repository; + } + + public async override Task> GetListAsync([FromQuery] FieldGetListInput input) + { + RefAsync total = 0; + var entities = await _repository._DbQueryable.WhereIF(input.TableId is not null, x => x.TableId.Equals(input.TableId!)) + .WhereIF(input.Name is not null, x => x.Name!.Contains(input.Name!)) + + .ToPageListAsync(input.SkipCount, input.MaxResultCount, total); + + return new PagedResultDto + { + TotalCount = total, + Items = await MapToGetListOutputDtosAsync(entities) + }; + } + + /// + /// 获取类型枚举 + /// + /// + [Route("type")] + public object GetFieldTypeEnum() + { + return typeof(FieldTypeEnum).GetFields(BindingFlags.Static | BindingFlags.Public).Select(x => new { lable = x.Name, value = (int)Enum.Parse(typeof(FieldTypeEnum), x.Name) }).ToList(); + } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Services/TableService.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Services/TableService.cs new file mode 100644 index 00000000..446e05c7 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Services/TableService.cs @@ -0,0 +1,15 @@ +using Volo.Abp.Domain.Repositories; +using Yi.Framework.CodeGun.Application.Contracts.Dtos.Table; +using Yi.Framework.CodeGun.Application.Contracts.IServices; +using Yi.Framework.CodeGun.Domain.Entities; +using Yi.Framework.Ddd.Application; + +namespace Yi.Framework.CodeGun.Application.Services +{ + public class TableService : YiCrudAppService, ITableService + { + public TableService(IRepository repository) : base(repository) + { + } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Services/TemplateService.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Services/TemplateService.cs new file mode 100644 index 00000000..caf361d0 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Services/TemplateService.cs @@ -0,0 +1,33 @@ +using Microsoft.AspNetCore.Mvc; +using SqlSugar; +using Volo.Abp.Application.Dtos; +using Yi.Framework.CodeGun.Application.Contracts.Dtos.Template; +using Yi.Framework.CodeGun.Application.Contracts.IServices; +using Yi.Framework.CodeGun.Domain.Entities; +using Yi.Framework.Ddd.Application; +using Yi.Framework.SqlSugarCore.Abstractions; + +namespace Yi.Framework.CodeGun.Application.Services; + +public class TemplateService : YiCrudAppService, ITemplateService + { + private ISqlSugarRepository _repository; + public TemplateService(ISqlSugarRepository repository) : base(repository) + { + _repository = repository; + } + + public async override Task> GetListAsync([FromQuery] TemplateGetListInput input) + { + RefAsync total = 0; + var entities = await _repository._DbQueryable.WhereIF(input.Name is not null, x => x.Name.Equals(input.Name!)) + .ToPageListAsync(input.SkipCount, input.MaxResultCount, total); + + return new PagedResultDto + { + TotalCount = total, + Items = await MapToGetListOutputDtosAsync(entities) + }; + } +} + diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Yi.Framework.CodeGun.Application.csproj b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Yi.Framework.CodeGun.Application.csproj new file mode 100644 index 00000000..d82944fd --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/Yi.Framework.CodeGun.Application.csproj @@ -0,0 +1,15 @@ + + + + net8.0 + enable + enable + + + + + + + + + diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/YiFrameworkCodeGunApplicationModule.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/YiFrameworkCodeGunApplicationModule.cs new file mode 100644 index 00000000..83163c3d --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Application/YiFrameworkCodeGunApplicationModule.cs @@ -0,0 +1,14 @@ +using Yi.Framework.CodeGun.Application.Contracts; +using Yi.Framework.CodeGun.Domain; +using Yi.Framework.Ddd.Application; + +namespace Yi.Framework.CodeGun.Application +{ + [DependsOn(typeof(YiFrameworkCodeGunApplicationContractsModule), + typeof(YiFrameworkCodeGunDomainModule), + typeof(YiFrameworkDddApplicationModule))] + public class YiFrameworkCodeGunApplicationModule : AbpModule + { + + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain.Shared/Enums/FieldTypeEnum.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain.Shared/Enums/FieldTypeEnum.cs new file mode 100644 index 00000000..e4a4657d --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain.Shared/Enums/FieldTypeEnum.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.CodeGun.Domain.Shared.Enums +{ + public enum FieldTypeEnum + { + [Display(Name = "string", Description = "String")] + String, + + [Display(Name = "int", Description = "Int32")] + Int, + + [Display(Name = "long", Description = "Int64")] + Long, + + [Display(Name = "bool", Description = "Boolean")] + Bool, + + [Display(Name = "decimal", Description = "Decimal")] + Decimal, + + [Display(Name = "DateTime", Description = "DateTime")] + DateTime, + } + +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain.Shared/Yi.Framework.CodeGun.Domain.Shared.csproj b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain.Shared/Yi.Framework.CodeGun.Domain.Shared.csproj new file mode 100644 index 00000000..ee49c085 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain.Shared/Yi.Framework.CodeGun.Domain.Shared.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain.Shared/YiFrameworkCodeGunDomainSharedModule.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain.Shared/YiFrameworkCodeGunDomainSharedModule.cs new file mode 100644 index 00000000..54bceede --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain.Shared/YiFrameworkCodeGunDomainSharedModule.cs @@ -0,0 +1,11 @@ +using Volo.Abp.Domain; +using Volo.Abp.Modularity; + +namespace Yi.Framework.CodeGun.Domain.Shared +{ + [DependsOn(typeof(AbpDddDomainSharedModule))] + public class YiFrameworkCodeGunDomainSharedModule:AbpModule + { + + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Entities/FieldEntity.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Entities/FieldEntity.cs new file mode 100644 index 00000000..c01e7537 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Entities/FieldEntity.cs @@ -0,0 +1,45 @@ +using SqlSugar; +using Volo.Abp.Domain.Entities; +using Yi.Framework.CodeGun.Domain.Shared.Enums; + +namespace Yi.Framework.CodeGun.Domain.Entities +{ + [SugarTable("YiField")] + public class FieldEntity : Entity + { + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true)] + public override Guid Id { get; protected set; } + /// + /// 字段名称 + /// + public string Name { get; set; } + public string? Description { get; set; } + + public int OrderNum { get; set; } + public int Length { get; set; } + + public FieldTypeEnum FieldType { get; set; } + + public Guid TableId { get; set; } + + /// + /// 是否必填 + /// + public bool IsRequired { get; set; } + + /// + /// 是否主键 + /// + public bool IsKey { get; set; } + + /// + /// 是否自增 + /// + public bool IsAutoAdd { get; set; } + + /// + /// 是否公共 + /// + public bool IsPublic { get; set; } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Entities/TableAggregateRoot.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Entities/TableAggregateRoot.cs new file mode 100644 index 00000000..3ccbe957 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Entities/TableAggregateRoot.cs @@ -0,0 +1,28 @@ +using SqlSugar; +using Volo.Abp.Domain.Entities; + +namespace Yi.Framework.CodeGun.Domain.Entities +{ + [SugarTable("YiTable")] + public class TableAggregateRoot : AggregateRoot + { + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true)] + public override Guid Id { get; protected set; } + /// + /// 表名 + /// + public string Name { get; set; } + + /// + /// 备注 + /// + + public string? Description { get; set; } + + /// + /// 一表多字段 + /// + [Navigate(NavigateType.OneToMany, nameof(FieldEntity.TableId))] + public List Fields { get; set; } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Entities/TemplateEntity.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Entities/TemplateEntity.cs new file mode 100644 index 00000000..08a25088 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Entities/TemplateEntity.cs @@ -0,0 +1,34 @@ +using SqlSugar; +using Volo.Abp.Domain.Entities; + +namespace Yi.Framework.CodeGun.Domain.Entities +{ + [SugarTable("YiTemplate")] + public class TemplateEntity : Entity + { + + [SugarColumn(ColumnName = "Id", IsPrimaryKey = true)] + public override Guid Id { get; protected set; } + + /// + /// 模板字符串 + /// + [SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString)] + public string TemplateStr { get; set; } = string.Empty; + + /// + /// 生成路径 + /// + public string BuildPath { get; set; } + + /// + /// 模板名称 + /// + public string Name { get; set; } + + /// + /// 备注 + /// + public string? Remarks { get; set; } + } +} \ No newline at end of file diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/FieldTemplateHandler.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/FieldTemplateHandler.cs new file mode 100644 index 00000000..69d8160d --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/FieldTemplateHandler.cs @@ -0,0 +1,70 @@ +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using System.Text; +using Yi.Framework.CodeGun.Domain.Shared.Enums; + +namespace Yi.Framework.CodeGun.Domain.Handlers +{ + public class FieldTemplateHandler : TemplateHandlerBase, ITemplateHandler + { + public HandledTemplate Invoker(string str, string path) + { + var output = new HandledTemplate(); + output.TemplateStr = str.Replace("@field", BuildFields()); + output.BuildPath = path; + return output; + } + + + /// + /// 生成Fields + /// + /// + public string BuildFields() + { + StringBuilder fieldStrs = new StringBuilder(); + + + foreach (var field in Table.Fields) + { + var typeStr = typeof(FieldTypeEnum).GetFields().Where(x => x.Name == field.FieldType.ToString())?.FirstOrDefault().GetCustomAttribute().Name; + + if (typeStr is null) + { + continue; + } + var nameStr = field.Name; + + //添加备注 + if (!string.IsNullOrEmpty(field.Description)) + { + var desStr = "/// \n" + + $"///{field.Description}\n" + + "/// \n"; + fieldStrs.AppendLine(desStr); + } + + //添加长度 + if (field.Length != 0) + { + var lengthStr = $"[SugarColumn(Length ={field.Length})]"; + fieldStrs.AppendLine(lengthStr); + } + + //添加可空类型 + string nullStr = ""; + if (field.IsRequired == false) + { + nullStr = "?"; + } + + //添加字段 + var fieldStr = $"public {typeStr}{nullStr} {nameStr} {{ get; set; }}"; + + fieldStrs.AppendLine(fieldStr); + } + + return fieldStrs.ToString(); + } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/HandledTemplate.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/HandledTemplate.cs new file mode 100644 index 00000000..bcea3ee7 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/HandledTemplate.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Yi.Framework.CodeGun.Domain.Handlers +{ + public class HandledTemplate + { + public string TemplateStr { get; set; } + + public string BuildPath { get; set; } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/ITemplateHandler.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/ITemplateHandler.cs new file mode 100644 index 00000000..1127981f --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/ITemplateHandler.cs @@ -0,0 +1,11 @@ +using Volo.Abp.DependencyInjection; +using Yi.Framework.CodeGun.Domain.Entities; + +namespace Yi.Framework.CodeGun.Domain.Handlers +{ + public interface ITemplateHandler: ISingletonDependency + { + void SetTable(TableAggregateRoot table); + HandledTemplate Invoker(string str, string path); + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/ModelTemplateHandler.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/ModelTemplateHandler.cs new file mode 100644 index 00000000..dfff3394 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/ModelTemplateHandler.cs @@ -0,0 +1,13 @@ +namespace Yi.Framework.CodeGun.Domain.Handlers +{ + public class ModelTemplateHandler : TemplateHandlerBase, ITemplateHandler + { + public HandledTemplate Invoker(string str, string path) + { + var output = new HandledTemplate(); + output.TemplateStr = str.Replace("@model", char.ToLowerInvariant(Table.Name[0]) + Table.Name.Substring(1)).Replace("@Model", char.ToUpperInvariant(Table.Name[0]) + Table.Name.Substring(1)); + output.BuildPath = path.Replace("@model", char.ToLowerInvariant(Table.Name[0]) + Table.Name.Substring(1)).Replace("@Model", char.ToUpperInvariant(Table.Name[0]) + Table.Name.Substring(1)); + return output; + } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/NameSpaceTemplateHandler.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/NameSpaceTemplateHandler.cs new file mode 100644 index 00000000..06ffd2f7 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/NameSpaceTemplateHandler.cs @@ -0,0 +1,13 @@ +namespace Yi.Framework.CodeGun.Domain.Handlers +{ + public class NameSpaceTemplateHandler : TemplateHandlerBase, ITemplateHandler + { + public HandledTemplate Invoker(string str, string path) + { + var output = new HandledTemplate(); + output.TemplateStr = str.Replace("@namespace", ""); + output.BuildPath = path; + return output; + } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/TemplateHandlerBase.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/TemplateHandlerBase.cs new file mode 100644 index 00000000..73668cdf --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Handlers/TemplateHandlerBase.cs @@ -0,0 +1,14 @@ +using Yi.Framework.CodeGun.Domain.Entities; + +namespace Yi.Framework.CodeGun.Domain.Handlers +{ + public class TemplateHandlerBase + { + protected TableAggregateRoot Table { get; set; } + + public void SetTable(TableAggregateRoot table) + { + Table = table; + } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Managers/CodeFileManager.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Managers/CodeFileManager.cs new file mode 100644 index 00000000..7966528f --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Managers/CodeFileManager.cs @@ -0,0 +1,53 @@ +using Volo.Abp.Domain.Services; +using Yi.Framework.CodeGun.Domain.Entities; +using Yi.Framework.CodeGun.Domain.Handlers; +using Yi.Framework.SqlSugarCore.Abstractions; + +namespace Yi.Framework.CodeGun.Domain.Managers +{ + /// + /// 代码文件领域服务,与代码文件生成相关,web to code + /// + public class CodeFileManager : DomainService + { + private IEnumerable _templateHandlers; + private ISqlSugarRepository _repository; + private ISqlSugarRepository _fieldRepository; + public CodeFileManager(IEnumerable templateHandlers, ISqlSugarRepository fieldRepository, ISqlSugarRepository repository) + { + _templateHandlers = templateHandlers; + _repository = repository; + _fieldRepository = fieldRepository; + } + public async Task BuildWebToCodeAsync(TableAggregateRoot tableEntity) + { + var templates = await _repository.GetListAsync(); + foreach (var template in templates) + { + var handledTempalte = new HandledTemplate(); + handledTempalte.TemplateStr = template.TemplateStr; + handledTempalte.BuildPath = template.BuildPath; + foreach (var templateHandler in _templateHandlers) + { + templateHandler.SetTable(tableEntity); + handledTempalte = templateHandler.Invoker(handledTempalte.TemplateStr, handledTempalte.BuildPath); + } + await BuildToFileAsync(handledTempalte); + + } + } + + + private async Task BuildToFileAsync(HandledTemplate handledTemplate) + { + if (!Directory.Exists(Path.GetDirectoryName(handledTemplate.BuildPath))) + { + Directory.CreateDirectory(Path.GetDirectoryName(handledTemplate.BuildPath)); + } + await File.WriteAllTextAsync(handledTemplate.BuildPath, handledTemplate.TemplateStr); + } + + + } + +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Managers/DataBaseManger.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Managers/DataBaseManger.cs new file mode 100644 index 00000000..c8a231c2 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Managers/DataBaseManger.cs @@ -0,0 +1,11 @@ +using Volo.Abp.Domain.Services; + +namespace Yi.Framework.CodeGun.Domain.Managers +{ + /// + /// 数据库领域服务,与数据库相关,同步到数据库,web to db ,code to db + /// + public class DataBaseManger : DomainService + { + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Managers/WebTemplateManager.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Managers/WebTemplateManager.cs new file mode 100644 index 00000000..20249b1a --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Managers/WebTemplateManager.cs @@ -0,0 +1,123 @@ +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using SqlSugar; +using Volo.Abp.Domain.Services; +using Yi.Framework.CodeGun.Domain.Entities; +using Yi.Framework.CodeGun.Domain.Shared.Enums; +using Yi.Framework.SqlSugarCore.Abstractions; + +namespace Yi.Framework.CodeGun.Domain.Managers +{ + /// + /// 与webfrist相关,同步到web,code to web + /// + public class WebTemplateManager : DomainService + { + private ISqlSugarRepository _repository; + private IModuleContainer _moduleContainer; + public WebTemplateManager(ISqlSugarRepository repository, IModuleContainer moduleContainer) + { + _repository = repository; + _moduleContainer= moduleContainer; + } + /// + /// 通过当前的实体代码获取表存储 + /// + /// + + public Task> BuildCodeToWebAsync() + { + List entityTypes = new List(); + foreach (var module in _moduleContainer.Modules) + { + entityTypes.AddRange(module.Assembly.GetTypes() + .Where(x => x.GetCustomAttribute() == null) + .Where(x => x.GetCustomAttribute() != null) + .Where(x => x.GetCustomAttribute() is null)); + } + + var tableAggregateRoots = new List(); + foreach (var entityType in entityTypes) + { + tableAggregateRoots.Add(EntityTypeMapperToTable(entityType)); + } + + return Task.FromResult(tableAggregateRoots); + } + + private TableAggregateRoot EntityTypeMapperToTable(Type entityType) + { + var tableAggregateRoot = new TableAggregateRoot(); + tableAggregateRoot.Fields = new List(); + var table = entityType.GetCustomAttribute(); + + tableAggregateRoot.Name = table.TableName; + + foreach (var p in entityType.GetProperties()) + { + tableAggregateRoot.Fields.Add(PropertyMapperToFiled(p)); + } + tableAggregateRoot.Fields.ForEach(x => x.TableId = tableAggregateRoot.Id); + return tableAggregateRoot; + } + + + private FieldEntity PropertyMapperToFiled(PropertyInfo propertyInfo) + { + var fieldEntity = new FieldEntity(); + fieldEntity.Name = propertyInfo.Name; + + + //获取数据类型,包括可空类型 + Type? fieldType = null; + // 如果字段类型是 Nullable 泛型类型 + if (propertyInfo.PropertyType.IsGenericType && propertyInfo.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + Type nullableType = Nullable.GetUnderlyingType(propertyInfo.PropertyType)!; + fieldType = nullableType; + } + else + { + fieldType = propertyInfo.PropertyType; + } + + //判断类型 + var enumName = typeof(FieldTypeEnum).GetFields(BindingFlags.Static | BindingFlags.Public).Where(x => x.GetCustomAttribute()?.Description == fieldType.Name).FirstOrDefault()?.Name; + if (enumName is null) + { + fieldEntity.FieldType = FieldTypeEnum.String; + // App.GetRequiredService>().LogError($"字段类型:{propertyInfo.PropertyType.Name},未定义"); + } + else + { + fieldEntity.FieldType = (FieldTypeEnum)Enum.Parse(typeof(FieldTypeEnum), enumName); + } + + //判断是否可空 + if (propertyInfo.PropertyType.IsGenericType && propertyInfo.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + fieldEntity.IsRequired = false; + } + else + { + fieldEntity.IsRequired = true; + } + + + + //判断是否主键 + if (propertyInfo.GetCustomAttribute()?.IsPrimaryKey == true) + { + fieldEntity.IsKey = true; + } + + //判断长度 + var colum = propertyInfo.GetCustomAttribute(); + if (colum is not null && colum.Length != 0) + { + fieldEntity.Length = colum.Length; + } + return fieldEntity; + } + } +} diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Yi.Framework.CodeGun.Domain.csproj b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Yi.Framework.CodeGun.Domain.csproj new file mode 100644 index 00000000..f4ed654f --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/Yi.Framework.CodeGun.Domain.csproj @@ -0,0 +1,22 @@ + + + + net8.0 + enable + enable + + + + + + + + + + + + + + + + diff --git a/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/YiFrameworkCodeGunDomainModule.cs b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/YiFrameworkCodeGunDomainModule.cs new file mode 100644 index 00000000..af09e906 --- /dev/null +++ b/Yi.Abp.Net8/module/code-gun/Yi.Framework.CodeGun.Domain/YiFrameworkCodeGunDomainModule.cs @@ -0,0 +1,15 @@ +using Volo.Abp.Domain; +using Volo.Abp.Modularity; +using Yi.Framework.CodeGun.Domain.Shared; +using Yi.Framework.SqlSugarCore.Abstractions; + +namespace Yi.Framework.CodeGun.Domain +{ + [DependsOn(typeof(YiFrameworkCodeGunDomainSharedModule), + typeof(AbpDddDomainModule), + typeof(YiFrameworkSqlSugarCoreAbstractionsModule))] + public class YiFrameworkCodeGunDomainModule : AbpModule + { + + } +} diff --git a/Yi.Abp.Net8/src/Yi.Abp.Application/Yi.Abp.Application.csproj b/Yi.Abp.Net8/src/Yi.Abp.Application/Yi.Abp.Application.csproj index 19c953bb..122bbf9a 100644 --- a/Yi.Abp.Net8/src/Yi.Abp.Application/Yi.Abp.Application.csproj +++ b/Yi.Abp.Net8/src/Yi.Abp.Application/Yi.Abp.Application.csproj @@ -8,6 +8,7 @@ + diff --git a/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs b/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs index 19cc853e..dc670dbf 100644 --- a/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs +++ b/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs @@ -25,6 +25,7 @@ using Yi.Framework.AspNetCore.Authentication.OAuth.QQ; using Yi.Framework.AspNetCore.Microsoft.AspNetCore.Builder; using Yi.Framework.AspNetCore.Microsoft.Extensions.DependencyInjection; using Yi.Framework.Bbs.Application; +using Yi.Framework.CodeGun.Application; using Yi.Framework.Rbac.Application; using Yi.Framework.Rbac.Domain.Authorization; using Yi.Framework.Rbac.Domain.Shared.Consts; @@ -74,6 +75,7 @@ namespace Yi.Abp.Web options.ConventionalControllers.Create(typeof(YiFrameworkRbacApplicationModule).Assembly, options => options.RemoteServiceName = "rbac"); options.ConventionalControllers.Create(typeof(YiFrameworkBbsApplicationModule).Assembly, options => options.RemoteServiceName = "bbs"); options.ConventionalControllers.Create(typeof(YiFrameworkTenantManagementApplicationModule).Assembly, options => options.RemoteServiceName = "tenant-management"); + options.ConventionalControllers.Create(typeof(YiFrameworkCodeGunApplicationModule).Assembly, options => options.RemoteServiceName = "code-gun"); }); //设置api格式 diff --git a/Yi.Abp.Net8/usings.props b/Yi.Abp.Net8/usings.props new file mode 100644 index 00000000..cde3be23 --- /dev/null +++ b/Yi.Abp.Net8/usings.props @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Yi.RuoYi.Vue3/src/views/webfirst/field/components/FieldList.vue b/Yi.RuoYi.Vue3/src/views/code/field/components/FieldList.vue similarity index 100% rename from Yi.RuoYi.Vue3/src/views/webfirst/field/components/FieldList.vue rename to Yi.RuoYi.Vue3/src/views/code/field/components/FieldList.vue diff --git a/Yi.RuoYi.Vue3/src/views/webfirst/field/components/TableList.vue b/Yi.RuoYi.Vue3/src/views/code/field/components/TableList.vue similarity index 100% rename from Yi.RuoYi.Vue3/src/views/webfirst/field/components/TableList.vue rename to Yi.RuoYi.Vue3/src/views/code/field/components/TableList.vue diff --git a/Yi.RuoYi.Vue3/src/views/webfirst/field/hooks/useTable.js b/Yi.RuoYi.Vue3/src/views/code/field/hooks/useTable.js similarity index 100% rename from Yi.RuoYi.Vue3/src/views/webfirst/field/hooks/useTable.js rename to Yi.RuoYi.Vue3/src/views/code/field/hooks/useTable.js diff --git a/Yi.RuoYi.Vue3/src/views/webfirst/field/index.vue b/Yi.RuoYi.Vue3/src/views/code/field/index.vue similarity index 100% rename from Yi.RuoYi.Vue3/src/views/webfirst/field/index.vue rename to Yi.RuoYi.Vue3/src/views/code/field/index.vue diff --git a/Yi.RuoYi.Vue3/src/views/webfirst/table/index.vue b/Yi.RuoYi.Vue3/src/views/code/table/index.vue similarity index 100% rename from Yi.RuoYi.Vue3/src/views/webfirst/table/index.vue rename to Yi.RuoYi.Vue3/src/views/code/table/index.vue diff --git a/Yi.RuoYi.Vue3/src/views/webfirst/template/components/ReplaceText.vue b/Yi.RuoYi.Vue3/src/views/code/template/components/ReplaceText.vue similarity index 100% rename from Yi.RuoYi.Vue3/src/views/webfirst/template/components/ReplaceText.vue rename to Yi.RuoYi.Vue3/src/views/code/template/components/ReplaceText.vue diff --git a/Yi.RuoYi.Vue3/src/views/webfirst/template/components/TempalteTip.vue b/Yi.RuoYi.Vue3/src/views/code/template/components/TempalteTip.vue similarity index 100% rename from Yi.RuoYi.Vue3/src/views/webfirst/template/components/TempalteTip.vue rename to Yi.RuoYi.Vue3/src/views/code/template/components/TempalteTip.vue diff --git a/Yi.RuoYi.Vue3/src/views/webfirst/template/index.vue b/Yi.RuoYi.Vue3/src/views/code/template/index.vue similarity index 100% rename from Yi.RuoYi.Vue3/src/views/webfirst/template/index.vue rename to Yi.RuoYi.Vue3/src/views/code/template/index.vue