Beispiel #1
0
        public void TestGetTableClass()
        {
            var basePath       = @"G:\Temp\";
            var domainAssembly = typeof(MenuManagement.MenuManagementDomainModule).Assembly;
            var domain         = @"\AppSettings";
            var options        = new GeneratorOptions()
            {
                DbContext             = "EquipmentQuotationAppDbContext",
                Namespace             = "EquipmentQuotationApp",
                ControllerBase        = "EquipmentQuotationAppController",
                CreateContractsPath   = @$ "{basePath}trunk\src\SupplyDemandPlatform.Application.Contracts{domain}",
                CreateApplicationPath = @$ "{basePath}trunk\src\SupplyDemandPlatform.Application{domain}",
                CreateDomainPath      = @$ "{basePath}trunk\src\SupplyDemandPlatform.Domain{domain}",
                CreateEfCorePath      = @$ "{basePath}trunk\src\SupplyDemandPlatform.EntityFrameworkCore{domain}",
                CreateHttpApiPath     = @$ "{basePath}trunk\src\SupplyDemandPlatform.HttpApi\v1{domain}",
                //不需要domain做文件夹
                CreateHtmlPath         = @$ "{basePath}trunk\host\SupplyDemandPlatform.Web.Unified\wwwroot\main\view",
                CreateHtmlTemplatePath = @"G:\github\mygithub\Jh.Abp.QuickComponents\src\GeneratorCoding\Jh.SourceGenerator.Common\CodeBuilders\Html\Layui"
            };
            var service = new GeneratorService(domainAssembly, options);

            Assert.True(service.GeneratorCode());
        }
Beispiel #2
0
        public void GeneratorTest()
        {
            var domainAssembly = typeof(FormCustomDomainModule).Assembly;
            var domain         = @"\Forms";
            var options        = new GeneratorOptions()
            {
                DbContext             = "SupplyDemandPlatformDbContext",
                Namespace             = "SupplyDemandPlatform",
                ControllerBase        = "SupplyDemandPlatformController",
                CreateContractsPath   = @"E:\CompanyWork\website_XinZhou\trunk\src\SupplyDemandPlatform.Application.Contracts" + domain,
                CreateApplicationPath = @"E:\CompanyWork\website_XinZhou\trunk\src\SupplyDemandPlatform.Application" + domain,
                CreateDomainPath      = @"E:\CompanyWork\website_XinZhou\trunk\src\SupplyDemandPlatform.Domain" + domain,
                CreateEfCorePath      = @"E:\CompanyWork\website_XinZhou\trunk\src\SupplyDemandPlatform.EntityFrameworkCore" + domain,
                //不需要表名做文件夹
                CreateHttpApiPath      = @"E:\CompanyWork\website_XinZhou\trunk\src\SupplyDemandPlatform.HttpApi\v1" + domain,
                CreateHtmlPath         = @"E:\CompanyWork\website_XinZhou\trunk\host\SupplyDemandPlatform.HttpApi.Host\wwwroot\main\view",
                CreateHtmlTemplatePath = @"E:\CompanyWork\website_XinZhou\documents\CodeTemplate\Layui",
            };

            /*var options = new GeneratorOptions()
             * {
             *  DbContext = "SupplyDemandPlatformDbContext",
             *  Namespace = "SupplyDemandPlatform",
             *  ControllerBase = "SupplyDemandPlatformController",
             *  CreateContractsPath = @"E:\Temp\Contracts",
             *  CreateApplicationPath = @"E:\Temp\Application",
             *  CreateDomainPath = @"E:\Temp\Domain",
             *  CreateEfCorePath = @"E:\Temp\EntityFrameworkCore",
             *  //不需要表名做文件夹
             *  CreateHttpApiPath = @"E:\Temp\HttpApi\v1",
             *  CreateHtmlPath = @"E:\Temp\website_XinZhou\trunk\host\SupplyDemandPlatform.HttpApi.Host\wwwroot\main\view",
             *  CreateHtmlTemplatePath = @"E:\CompanyWork\website_XinZhou\documents\CodeTemplate\Layui",
             * };*/
            var service = new GeneratorService(domainAssembly, options);

            Assert.True(service.GeneratorCode());
        }