├── .gitattributes ├── common.props ├── src ├── AbpVnextPro.GUI.Domain │ ├── AbpVnextProGUIDomainModule.cs │ ├── AbpVnextPro.GUI.Domain.csproj │ ├── Replaces │ │ ├── ReplaceConsts.cs │ │ ├── Extensions │ │ │ └── ReplaceExtension.cs │ │ └── ReplaceManager.cs │ ├── Exceptions │ │ ├── DownSourceCodeException.cs │ │ ├── ZipException.cs │ │ └── GenerateTemplateException.cs │ ├── Zips │ │ └── ZipManager.cs │ └── Githubs │ │ └── GithubManager.cs ├── AbpVnextPro.GUI │ ├── appsettings.json │ ├── HelloWorldService.cs │ ├── App.xaml │ ├── AssemblyInfo.cs │ ├── GUIModule.cs │ ├── AbpVnextPro.GUI.csproj │ ├── MainWindow.xaml │ ├── App.xaml.cs │ └── MainWindow.xaml.cs └── AbpVnextPro.GUI.ApplicationService │ ├── AbpVnextPro.GUI.ApplicationService.csproj │ ├── AbpVnextProGUIApplicationService.cs │ └── Generates │ └── GenerateAppService.cs ├── AbpVnextPro.GUI.sln └── .gitignore /.gitattributes: -------------------------------------------------------------------------------- 1 | **/wwwroot/libs/** linguist-vendored 2 | -------------------------------------------------------------------------------- /common.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | latest 4 | 0.1.0 5 | $(NoWarn);CS1591;CS0436 6 | 7 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI.Domain/AbpVnextProGUIDomainModule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Volo.Abp.Modularity; 3 | 4 | namespace AbpVnextPro.GUI.Domain 5 | { 6 | public class AbpVnextProGUIDomainModule : AbpModule 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Github": { 3 | "AbpVnextPro": { 4 | "Author": "WangJunZzz", 5 | "RepsotiryName": "abp-vnext-pro" 6 | } 7 | }, 8 | "CompanyName": "CompanyName", 9 | "ProjectName": "ProjectName" 10 | } 11 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI/HelloWorldService.cs: -------------------------------------------------------------------------------- 1 | using Volo.Abp.DependencyInjection; 2 | 3 | namespace AbpVnextPro.GUI 4 | { 5 | public class HelloWorldService : ITransientDependency 6 | { 7 | public string SayHello() 8 | { 9 | return "Hello world!"; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI.ApplicationService/AbpVnextPro.GUI.ApplicationService.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI.Domain/AbpVnextPro.GUI.Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI.Domain/Replaces/ReplaceConsts.cs: -------------------------------------------------------------------------------- 1 | namespace AbpVnextPro.GUI.Domain.Replaces 2 | { 3 | public class ReplaceConsts 4 | { 5 | public const string OldCompanyName = "Lion"; 6 | public const string OldProjectName = "AbpPro"; 7 | /// 8 | /// 后台服务需替换的文件后缀 9 | /// 10 | public const string FileFilter = ".sln,.csproj,.cs,.cshtml,.json,.ci,.yml,.yaml,.nswag,.DotSettings,.env"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI.ApplicationService/AbpVnextProGUIApplicationService.cs: -------------------------------------------------------------------------------- 1 | using AbpVnextPro.GUI.Domain; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Volo.Abp.Modularity; 8 | 9 | namespace AbpVnextPro.GUI.ApplicationService 10 | { 11 | [DependsOn(typeof(AbpVnextProGUIDomainModule))] 12 | public class AbpVnextProGUIApplicationService:AbpModule 13 | { 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Windows; 2 | 3 | [assembly: ThemeInfo( 4 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 5 | //(used if a resource is not found in the page, 6 | // or application resource dictionaries) 7 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 8 | //(used if a resource is not found in the page, 9 | // app, or any theme specific resource dictionaries) 10 | )] -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI/GUIModule.cs: -------------------------------------------------------------------------------- 1 | using AbpVnextPro.GUI.ApplicationService; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using Volo.Abp.Autofac; 4 | using Volo.Abp.Modularity; 5 | 6 | namespace AbpVnextPro.GUI 7 | { 8 | [DependsOn( 9 | typeof(AbpAutofacModule), 10 | typeof(AbpVnextProGUIApplicationService))] 11 | public class GUIModule : AbpModule 12 | { 13 | public override void ConfigureServices(ServiceConfigurationContext context) 14 | { 15 | context.Services.AddSingleton(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI.Domain/Replaces/Extensions/ReplaceExtension.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace AbpVnextPro.GUI.Domain.Replaces.Extensions 8 | { 9 | public static class ReplaceExtension 10 | { 11 | public static string CustomReplace(this string content,string companyName,string projectName) 12 | { 13 | var result = content 14 | .Replace(ReplaceConsts.OldCompanyName, companyName) 15 | .Replace(ReplaceConsts.OldProjectName, projectName) 16 | ; 17 | 18 | return result; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI.Domain/Exceptions/DownSourceCodeException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace AbpVnextPro.GUI.Domain.Exceptions 5 | { 6 | public class DownSourceCodeException : Exception 7 | { 8 | public DownSourceCodeException() 9 | { 10 | } 11 | 12 | public DownSourceCodeException(string message) : base(message) 13 | { 14 | } 15 | 16 | public DownSourceCodeException(string message, Exception innerException) : base(message, innerException) 17 | { 18 | } 19 | 20 | protected DownSourceCodeException(SerializationInfo info, StreamingContext context) : base(info, context) 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI.Domain/Exceptions/ZipException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Serialization; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace AbpVnextPro.GUI.Domain.Exceptions 9 | { 10 | public class ZipException : Exception 11 | { 12 | public ZipException() 13 | { 14 | } 15 | 16 | public ZipException(string message) : base(message) 17 | { 18 | } 19 | 20 | public ZipException(string message, Exception innerException) : base(message, innerException) 21 | { 22 | } 23 | 24 | protected ZipException(SerializationInfo info, StreamingContext context) : base(info, context) 25 | { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI.Domain/Exceptions/GenerateTemplateException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Serialization; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace AbpVnextPro.GUI.Domain.Exceptions 9 | { 10 | public class GenerateTemplateException : Exception 11 | { 12 | public GenerateTemplateException() 13 | { 14 | } 15 | 16 | public GenerateTemplateException(string message) : base(message) 17 | { 18 | } 19 | 20 | public GenerateTemplateException(string message, Exception innerException) : base(message, innerException) 21 | { 22 | } 23 | 24 | protected GenerateTemplateException(SerializationInfo info, StreamingContext context) : base(info, context) 25 | { 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI/AbpVnextPro.GUI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | WinExe 7 | net5.0-windows 8 | true 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | Always 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI.Domain/Zips/ZipManager.cs: -------------------------------------------------------------------------------- 1 | using AbpVnextPro.GUI.Domain.Exceptions; 2 | using System; 3 | using System.IO; 4 | using System.IO.Compression; 5 | using Volo.Abp.DependencyInjection; 6 | 7 | namespace AbpVnextPro.GUI.Domain.Zips 8 | { 9 | public class ZipManager : ISingletonDependency 10 | { 11 | public string ExtractZips(string sourceZipFullPath, string commpanyName, string projectName) 12 | { 13 | try 14 | { 15 | var path = Path.Combine(Directory.GetCurrentDirectory(), "code",commpanyName+projectName); 16 | if (!Directory.Exists(path)) 17 | { 18 | Directory.CreateDirectory(path); 19 | } 20 | var decompressionPath = Path.Combine(path, Path.GetFileNameWithoutExtension(sourceZipFullPath)); 21 | if (Directory.Exists(decompressionPath)) return decompressionPath; 22 | ZipFile.ExtractToDirectory(sourceZipFullPath, path); 23 | return decompressionPath; 24 | } 25 | catch (Exception ex) 26 | { 27 | throw new ZipException($"{DateTime.Now.ToString() }解压源码失败:{ex.Message}"); 28 | } 29 | 30 | } 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI.ApplicationService/Generates/GenerateAppService.cs: -------------------------------------------------------------------------------- 1 | using AbpVnextPro.GUI.Domain.Githubs; 2 | using AbpVnextPro.GUI.Domain.Replaces; 3 | using AbpVnextPro.GUI.Domain.Zips; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using Volo.Abp.DependencyInjection; 11 | 12 | namespace AbpVnextPro.GUI.ApplicationService.Generates 13 | { 14 | public class GenerateAppService : ITransientDependency 15 | { 16 | public readonly GithubManager _githubManager; 17 | private readonly ZipManager _zipManager; 18 | private readonly ReplaceManager _replaceManager; 19 | public GenerateAppService(GithubManager githubManager, ZipManager zipManager, ReplaceManager replaceManager) 20 | { 21 | _githubManager = githubManager; 22 | _zipManager = zipManager; 23 | _replaceManager = replaceManager; 24 | } 25 | 26 | 27 | public async Task DownloadSourceAsync(string type) 28 | { 29 | return await _githubManager.GetSourceCodeAsync(type); 30 | } 31 | 32 | public string ExtractZips(string path,string commpanyName,string projectName) 33 | { 34 | return _zipManager.ExtractZips(path, commpanyName, projectName); 35 | } 36 | 37 | public void GenerateTemplate(string path, string companyName, string projectName) 38 | { 39 | _replaceManager.ReplaceTemplates(path, companyName, projectName); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/AbpVnextPro.GUI/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 |