diff --git a/.gitignore b/.gitignore
index 17b904c..ec12543 100644
--- a/.gitignore
+++ b/.gitignore
@@ -339,3 +339,4 @@ ASALocalRun/
/src/UI/module-common/package-lock.json
/src/WebHost/wwwroot
/src/UI/module-code-generator/package-lock.json
+/src/UI/module-codegenerator/package-lock.json
diff --git a/CodeGenerator.sln b/CodeGenerator.sln
index 111b173..8367058 100644
--- a/CodeGenerator.sln
+++ b/CodeGenerator.sln
@@ -23,6 +23,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebHost", "src\WebHost\WebH
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Application", "src\Library\Application\Application.csproj", "{792B8CBF-AB02-4A87-AB5E-A6CB8E9DE39C}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{8DF8B7CB-7E3C-485B-A2AA-FBBD837FD2DB}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure.Test", "test\Infrastructure.Test\Infrastructure.Test.csproj", "{6442C161-8D83-47DF-98CE-98CCE2706EA5}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -49,6 +53,10 @@ Global
{792B8CBF-AB02-4A87-AB5E-A6CB8E9DE39C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{792B8CBF-AB02-4A87-AB5E-A6CB8E9DE39C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{792B8CBF-AB02-4A87-AB5E-A6CB8E9DE39C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6442C161-8D83-47DF-98CE-98CCE2706EA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6442C161-8D83-47DF-98CE-98CCE2706EA5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6442C161-8D83-47DF-98CE-98CCE2706EA5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6442C161-8D83-47DF-98CE-98CCE2706EA5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -60,6 +68,7 @@ Global
{C2D01E40-4038-4527-9AAF-323359CD5CF0} = {B4D3AF99-D551-4B7A-82F3-CE0950FCAA08}
{CEAE0B43-438D-4778-BF3A-8665246EF718} = {B4D3AF99-D551-4B7A-82F3-CE0950FCAA08}
{792B8CBF-AB02-4A87-AB5E-A6CB8E9DE39C} = {E58182FC-0950-453F-8C3A-ABCB477C8A28}
+ {6442C161-8D83-47DF-98CE-98CCE2706EA5} = {8DF8B7CB-7E3C-485B-A2AA-FBBD837FD2DB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1A6F430A-4015-48B1-BD5B-32C30485B34D}
diff --git a/build/module.build.targets b/build/module.build.targets
index 5068c63..4cd5729 100644
--- a/build/module.build.targets
+++ b/build/module.build.targets
@@ -1,28 +1,19 @@
-
- _modules\$(Id)
- $(ModulesDir)\_module.json
- {"Id": "$(Id)","Name":"$(Name)","Version":"$(Version)"}
-
+
+ _modules\$(Id)_$(Code)
+ $(ModulesDir)\_module.json
+ {"Id": "$(Id)","Name":"$(Name)","Code":"$(Code)","Icon":"$(Icon)","Version":"$(Version)","Description":"$(Description)"}
+
-
-
-
-
+
-
-
-
+
+
-
+
+
-
-
+
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/data/MySql/nm_admin.sql b/data/MySql/nm_admin.sql
deleted file mode 100644
index 001231e..0000000
--- a/data/MySql/nm_admin.sql
+++ /dev/null
@@ -1,631 +0,0 @@
-/*
- Navicat Premium Data Transfer
-
- Source Server : localhost
- Source Server Type : MySQL
- Source Server Version : 80015
- Source Host : 127.0.0.1:3306
- Source Schema : nm_admin
-
- Target Server Type : MySQL
- Target Server Version : 80015
- File Encoding : 65001
-
- Date: 24/10/2019 13:32:49
-*/
-
-SET NAMES utf8mb4;
-SET FOREIGN_KEY_CHECKS = 0;
-
--- ----------------------------
--- Table structure for account
--- ----------------------------
-DROP TABLE IF EXISTS `account`;
-CREATE TABLE `account` (
- `Id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Type` smallint(3) NOT NULL DEFAULT 0,
- `UserName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Email` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `LoginTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `LoginIP` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Status` smallint(3) NOT NULL DEFAULT 0,
- `IsLock` bit(1) NOT NULL DEFAULT b'0',
- `ClosedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `ClosedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `CreatedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `CreatedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModifiedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `ModifiedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Deleted` bit(1) NOT NULL DEFAULT b'0',
- `DeletedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `DeletedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of account
--- ----------------------------
-INSERT INTO `account` VALUES ('2E23D1D9-4A72-ACC2-F6FF-39ED21CB6A4A', 0, 'admin', 'E739279CB28CDAFD7373618313803524', '管理员', '', '', '2019-10-24 13:30:23', '0.0.0.1', 1, b'0', '2019-10-09 00:00:00', '00000000-0000-0000-0000-000000000000', '2019-10-09 00:00:00', '00000000-0000-0000-0000-000000000000', '2019-10-09 00:00:00', '00000000-0000-0000-0000-000000000000', b'0', '2019-10-09 00:00:00', '00000000-0000-0000-0000-000000000000');
-
--- ----------------------------
--- Table structure for account_config
--- ----------------------------
-DROP TABLE IF EXISTS `account_config`;
-CREATE TABLE `account_config` (
- `Id` int(11) NOT NULL AUTO_INCREMENT,
- `AccountId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Skin` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Theme` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `FontSize` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of account_config
--- ----------------------------
-INSERT INTO `account_config` VALUES (1, '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', 'pretty', 'default', 'medium');
-
--- ----------------------------
--- Table structure for account_role
--- ----------------------------
-DROP TABLE IF EXISTS `account_role`;
-CREATE TABLE `account_role` (
- `Id` int(11) NOT NULL AUTO_INCREMENT,
- `AccountId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `RoleId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of account_role
--- ----------------------------
-INSERT INTO `account_role` VALUES (2, '2E23D1D9-4A72-ACC2-F6FF-39ED21CB6A4A', '39f08d5b-173b-1cbb-7381-407c87b2e8e2');
-
--- ----------------------------
--- Table structure for auditinfo
--- ----------------------------
-DROP TABLE IF EXISTS `auditinfo`;
-CREATE TABLE `auditinfo` (
- `Id` bigint(20) NOT NULL AUTO_INCREMENT,
- `AccountId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '账户编号',
- `Area` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '区域',
- `Controller` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '控制器',
- `ControllerDesc` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '控制器说明',
- `Action` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '操作',
- `ActionDesc` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '操作说明',
- `Parameters` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '参数',
- `Result` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '返回数据',
- `ExecutionTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '方法开始执行时间',
- `ExecutionDuration` bigint(20) NOT NULL COMMENT '方法执行总用时(ms)',
- `BrowserInfo` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '浏览器信息',
- `Platform` smallint(6) NOT NULL COMMENT '平台',
- `IP` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 39837 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Table structure for button
--- ----------------------------
-DROP TABLE IF EXISTS `button`;
-CREATE TABLE `button` (
- `Id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `MenuCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
- `Code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `CreatedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `CreatedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModifiedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `ModifiedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of button
--- ----------------------------
-INSERT INTO `button` VALUES ('39f08dae-46e6-f6f2-cbff-fe925a9d9946', 'personnelfiles_company', '添加', 'add', 'personnelfiles_company_add', '2019-09-29 13:32:23', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:23', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-46fc-9606-cae1-2c04803de11f', 'personnelfiles_company', '编辑', 'edit', 'personnelfiles_company_edit', '2019-09-29 13:32:23', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:23', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-4709-666f-39e8-11cfb7db4594', 'personnelfiles_company', '删除', 'delete', 'personnelfiles_company_del', '2019-09-29 13:32:23', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:23', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-5305-3dc4-ebe6-771d999a8e44', 'personnelfiles_department', '添加', 'add', 'personnelfiles_department_add', '2019-09-29 13:32:26', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:26', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-5315-b2cb-bd0a-65aaec059274', 'personnelfiles_department', '编辑', 'edit', 'personnelfiles_department_edit', '2019-09-29 13:32:26', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:26', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-5323-c008-deeb-865f8b94be29', 'personnelfiles_department', '删除', 'delete', 'personnelfiles_department_del', '2019-09-29 13:32:26', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:26', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-5327-e25c-ff40-0523a20e5d8c', 'personnelfiles_department', '岗位', 'edit', 'personnelfiles_department_position', '2019-09-29 13:32:26', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:26', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-533a-604e-b0f7-a987eeb2f0de', 'personnelfiles_department', '岗位添加', 'add', 'personnelfiles_department_position_add', '2019-09-29 13:32:26', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:26', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-534a-fcdd-27dc-2f5b0f8eb80c', 'personnelfiles_department', '岗位编辑', 'edit', 'personnelfiles_department_position_edit', '2019-09-29 13:32:26', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:26', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-5358-b231-a8c5-0116ba761066', 'personnelfiles_department', '岗位删除', 'delete', 'personnelfiles_department_position_del', '2019-09-29 13:32:26', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:26', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-5e49-6a91-4661-55c6f645cc45', 'personnelfiles_position', '删除', 'delete', 'personnelfiles_position_del', '2019-09-29 13:32:29', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:29', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-886e-6a3e-9a33-4f95f1bed0ae', 'personnelfiles_user', '添加', 'add', 'personnelfiles_user_add', '2019-09-29 13:32:40', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:40', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-887d-fda0-3bf1-e76c7c490364', 'personnelfiles_user', '编辑', 'edit', 'personnelfiles_user_edit', '2019-09-29 13:32:40', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:40', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-8886-697c-73d1-0ab76ecaf2b9', 'personnelfiles_user', '删除', 'delete', 'personnelfiles_user_del', '2019-09-29 13:32:40', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:40', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-8895-ce81-c6ec-723849dbc839', 'personnelfiles_user', '工作经历', 'work', 'personnelfiles_user_work_history', '2019-09-29 13:32:40', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:40', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-88a0-823c-9da9-9fbe6d546612', 'personnelfiles_user', '教育经历', 'education', 'personnelfiles_user_education_history', '2019-09-29 13:32:40', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:40', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-d230-1374-d024-1123543b6a9d', 'common_area', '添加', 'add', 'common_area_add', '2019-09-29 13:32:59', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:59', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-d23c-c202-2cc8-d4ac00483563', 'common_area', '编辑', 'edit', 'common_area_edit', '2019-09-29 13:32:59', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:59', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-d240-6179-e176-bd044f544712', 'common_area', '删除', 'delete', 'common_area_del', '2019-09-29 13:32:59', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:32:59', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-e147-307d-4b87-1742fa9e5885', 'common_attachment', '删除', 'delete', 'common_attachment_del', '2019-09-29 13:33:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:03', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08dae-e157-e486-3d68-06e5152d5e50', 'common_attachment', '导出', 'export', 'common_attachment_export', '2019-09-29 13:33:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:03', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-10f0-4af0-c82e-525f06a2f2c5', 'quartz_group', '添加', 'add', 'quartz_group_add', '2019-09-29 13:33:15', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-09 15:15:37', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `button` VALUES ('39f08daf-10f7-7c83-9eec-048c3b1c9884', 'quartz_group', '删除', 'delete', 'quartz_group_del', '2019-09-29 13:33:15', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-09 15:15:37', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `button` VALUES ('39f08daf-4498-7ee7-797c-a2ab7871b505', 'quartz_job', '添加', 'add', 'quartz_job_add', '2019-09-29 13:33:28', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:28', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-44a9-d1bc-755d-c3369034e10a', 'quartz_job', '编辑', 'edit', 'quartz_job_edit', '2019-09-29 13:33:28', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:28', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-44ad-ac06-083a-c5a44b8e99dc', 'quartz_job', '暂停', 'pause', 'quartz_job_pause', '2019-09-29 13:33:28', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:28', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-44ba-da99-4a81-8dcc78efcf82', 'quartz_job', '启动', 'run', 'quartz_job_resume', '2019-09-29 13:33:28', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:28', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-44c9-7fe4-defd-0939a64171cd', 'quartz_job', '日志', 'log', 'quartz_job_log', '2019-09-29 13:33:28', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:28', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-44cd-0154-5dcd-f428972e22f2', 'quartz_job', '删除', 'delete', 'quartz_job_del', '2019-09-29 13:33:28', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:28', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-7366-40d9-6116-510f50a9949b', 'admin_moduleinfo', '同步', 'refresh', 'admin_moduleinfo_sync', '2019-09-29 13:33:40', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:40', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-7379-0830-a724-272048d335c4', 'admin_moduleinfo', '删除', 'delete', 'admin_moduleinfo_del', '2019-09-29 13:33:40', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:40', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-8092-82f1-bf83-c74b15f5fae3', 'admin_permission', '同步', 'refresh', 'admin_permission_sync', '2019-09-29 13:33:43', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:43', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-8ff9-b2e7-f6ec-bbc690f7568a', 'admin_menu', '添加', 'add', 'admin_menu_add', '2019-09-29 13:33:47', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:47', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-8ffe-d189-3f53-f2174cb2e3d4', 'admin_menu', '编辑', 'edit', 'admin_menu_edit', '2019-09-29 13:33:47', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:47', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-901a-ea1c-6dbc-fd3d68fb9757', 'admin_menu', '删除', 'delete', 'admin_menu_del', '2019-09-29 13:33:47', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:47', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-9020-8ebb-2d86-bd0adcd9d9dd', 'admin_menu', '排序', 'sort', 'admin_menu_sort', '2019-09-29 13:33:47', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:47', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-9b13-0809-b6f5-64d2430a37c4', 'admin_role', '添加', 'add', 'admin_role_add', '2019-09-29 13:33:50', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:50', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-9b1f-b315-ccc8-4ed480ae2595', 'admin_role', '编辑', 'edit', 'admin_role_edit', '2019-09-29 13:33:50', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:50', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-9b28-8f39-eeb7-289ea4c44604', 'admin_role', '删除', 'delete', 'admin_role_del', '2019-09-29 13:33:50', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:50', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-9b38-d4f7-270d-5e8629f9601d', 'admin_role', '绑定菜单', 'bind', 'admin_role_bind_menu', '2019-09-29 13:33:50', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:50', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-a6a3-772f-7559-4a22f0614589', 'admin_account', '添加', 'add', 'admin_account_add', '2019-09-29 13:33:53', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:53', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-a6b0-0ea0-58c4-918941c668b2', 'admin_account', '编辑', 'edit', 'admin_account_edit', '2019-09-29 13:33:53', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:53', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-a6b9-a4ac-5953-a4e4074ef3b0', 'admin_account', '删除', 'delete', 'admin_account_del', '2019-09-29 13:33:53', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:53', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-a6cc-8c2f-e31a-9c91f6c6afce', 'admin_account', '重置密码', 'refresh', 'admin_account_reset_password', '2019-09-29 13:33:53', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:53', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-b45e-0264-f197-063f969d3aa0', 'admin_auditinfo', '详情', 'detail', 'admin_auditinfo_details', '2019-09-29 13:33:57', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:57', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `button` VALUES ('39f08daf-f905-e02f-341a-bbc0b80cbf5e', 'admin_config', '添加', 'add', 'admin_config_add', '2019-09-29 13:34:14', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-09 15:15:07', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `button` VALUES ('39f08daf-f909-628c-9a0a-2c23a57b9103', 'admin_config', '编辑', 'edit', 'admin_config_edit', '2019-09-29 13:34:14', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-09 15:15:07', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `button` VALUES ('39f08daf-f915-e1f1-d7d8-ebd21adbebe6', 'admin_config', '删除', 'delete', 'admin_config_del', '2019-09-29 13:34:14', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-09 15:15:07', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `button` VALUES ('39f08db3-ea6b-6af7-1ef5-a226af30fbe4', 'codegenerator_project', '添加', 'add', 'codegenerator_project_add', '2019-09-29 13:38:33', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:32:03', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `button` VALUES ('39f08db3-ea80-e0e3-69ea-af5ab431ac6f', 'codegenerator_project', '编辑', 'edit', 'codegenerator_project_edit', '2019-09-29 13:38:33', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:32:03', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `button` VALUES ('39f08db3-eaa7-e42f-34fb-25baaaf55e87', 'codegenerator_project', '删除', 'delete', 'codegenerator_project_del', '2019-09-29 13:38:33', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:32:03', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `button` VALUES ('39f08db3-eada-892b-b250-c2d58279d388', 'codegenerator_project', '生成', 'download', 'codegenerator_project_build_code', '2019-09-29 13:38:33', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:32:03', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `button` VALUES ('39f08db3-f788-9a1c-f227-f372acb73cea', 'codegenerator_enum', '添加', 'add', 'codegenerator_enum_add', '2019-09-29 13:38:36', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:32:05', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `button` VALUES ('39f08db3-f7ba-4c00-d053-ca662ef2ad06', 'codegenerator_enum', '编辑', 'edit', 'codegenerator_enum_edit', '2019-09-29 13:38:36', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:32:05', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `button` VALUES ('39f08db3-f7d6-7533-682f-739e51d10ae1', 'codegenerator_enum', '删除', 'delete', 'codegenerator_enum_del', '2019-09-29 13:38:36', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:32:05', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-
--- ----------------------------
--- Table structure for button_permission
--- ----------------------------
-DROP TABLE IF EXISTS `button_permission`;
-CREATE TABLE `button_permission` (
- `Id` int(11) NOT NULL AUTO_INCREMENT,
- `ButtonCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `PermissionCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 100 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of button_permission
--- ----------------------------
-INSERT INTO `button_permission` VALUES (1, 'personnelfiles_company_add', 'personnelfiles_company_add_post');
-INSERT INTO `button_permission` VALUES (2, 'personnelfiles_company_edit', 'personnelfiles_company_edit_get');
-INSERT INTO `button_permission` VALUES (3, 'personnelfiles_company_edit', 'personnelfiles_company_update_post');
-INSERT INTO `button_permission` VALUES (4, 'personnelfiles_company_del', 'personnelfiles_company_delete_delete');
-INSERT INTO `button_permission` VALUES (5, 'personnelfiles_department_add', 'personnelfiles_department_add_post');
-INSERT INTO `button_permission` VALUES (6, 'personnelfiles_department_edit', 'personnelfiles_department_edit_get');
-INSERT INTO `button_permission` VALUES (7, 'personnelfiles_department_edit', 'personnelfiles_department_update_post');
-INSERT INTO `button_permission` VALUES (8, 'personnelfiles_department_del', 'personnelfiles_department_delete_delete');
-INSERT INTO `button_permission` VALUES (9, 'personnelfiles_department_position', 'personnelfiles_position_query_get');
-INSERT INTO `button_permission` VALUES (10, 'personnelfiles_department_position_add', 'personnelfiles_position_add_post');
-INSERT INTO `button_permission` VALUES (11, 'personnelfiles_department_position_edit', 'personnelfiles_position_edit_get');
-INSERT INTO `button_permission` VALUES (12, 'personnelfiles_department_position_edit', 'personnelfiles_position_update_post');
-INSERT INTO `button_permission` VALUES (13, 'personnelfiles_department_position_del', 'personnelfiles_position_delete_delete');
-INSERT INTO `button_permission` VALUES (14, 'personnelfiles_position_del', 'personnelfiles_position_delete_delete');
-INSERT INTO `button_permission` VALUES (15, 'personnelfiles_user_add', 'personnelfiles_user_add_post');
-INSERT INTO `button_permission` VALUES (16, 'personnelfiles_user_add', 'personnelfiles_user_uploadpicture_post');
-INSERT INTO `button_permission` VALUES (17, 'personnelfiles_user_edit', 'personnelfiles_user_edit_get');
-INSERT INTO `button_permission` VALUES (18, 'personnelfiles_user_edit', 'personnelfiles_user_update_post');
-INSERT INTO `button_permission` VALUES (19, 'personnelfiles_user_edit', 'personnelfiles_user_uploadpicture_post');
-INSERT INTO `button_permission` VALUES (20, 'personnelfiles_user_edit', 'personnelfiles_user_editcontact_get');
-INSERT INTO `button_permission` VALUES (21, 'personnelfiles_user_edit', 'personnelfiles_user_updatecontact_post');
-INSERT INTO `button_permission` VALUES (22, 'personnelfiles_user_edit', 'personnelfiles_user_contactdetails_get');
-INSERT INTO `button_permission` VALUES (23, 'personnelfiles_user_del', 'personnelfiles_user_delete_delete');
-INSERT INTO `button_permission` VALUES (24, 'personnelfiles_user_work_history', 'personnelfiles_userworkhistory_query_get');
-INSERT INTO `button_permission` VALUES (25, 'personnelfiles_user_work_history', 'personnelfiles_userworkhistory_add_post');
-INSERT INTO `button_permission` VALUES (26, 'personnelfiles_user_work_history', 'personnelfiles_userworkhistory_edit_get');
-INSERT INTO `button_permission` VALUES (27, 'personnelfiles_user_work_history', 'personnelfiles_userworkhistory_update_get');
-INSERT INTO `button_permission` VALUES (28, 'personnelfiles_user_work_history', 'personnelfiles_userworkhistory_delete_delete');
-INSERT INTO `button_permission` VALUES (29, 'personnelfiles_user_education_history', 'personnelfiles_usereducationhistory_query_get');
-INSERT INTO `button_permission` VALUES (30, 'personnelfiles_user_education_history', 'personnelfiles_usereducationhistory_add_post');
-INSERT INTO `button_permission` VALUES (31, 'personnelfiles_user_education_history', 'personnelfiles_usereducationhistory_edit_get');
-INSERT INTO `button_permission` VALUES (32, 'personnelfiles_user_education_history', 'personnelfiles_usereducationhistory_update_get');
-INSERT INTO `button_permission` VALUES (33, 'personnelfiles_user_education_history', 'personnelfiles_usereducationhistory_delete_delete');
-INSERT INTO `button_permission` VALUES (34, 'common_area_add', 'common_area_add_post');
-INSERT INTO `button_permission` VALUES (35, 'common_area_edit', 'common_area_edit_get');
-INSERT INTO `button_permission` VALUES (36, 'common_area_edit', 'common_area_update_post');
-INSERT INTO `button_permission` VALUES (37, 'common_area_del', 'common_area_delete_delete');
-INSERT INTO `button_permission` VALUES (38, 'common_attachment_del', 'common_attachment_delete_delete');
-INSERT INTO `button_permission` VALUES (39, 'common_attachment_export', 'common_attachment_export_get');
-INSERT INTO `button_permission` VALUES (42, 'quartz_job_add', 'quartz_job_add_post');
-INSERT INTO `button_permission` VALUES (43, 'quartz_job_edit', 'quartz_job_edit_get');
-INSERT INTO `button_permission` VALUES (44, 'quartz_job_edit', 'quartz_job_update_post');
-INSERT INTO `button_permission` VALUES (45, 'quartz_job_pause', 'quartz_job_pause_post');
-INSERT INTO `button_permission` VALUES (46, 'quartz_job_resume', 'quartz_job_resume_post');
-INSERT INTO `button_permission` VALUES (47, 'quartz_job_log', 'quartz_job_log_get');
-INSERT INTO `button_permission` VALUES (48, 'quartz_job_del', 'quartz_job_delete_delete');
-INSERT INTO `button_permission` VALUES (49, 'admin_moduleinfo_sync', 'admin_moduleinfo_sync_post');
-INSERT INTO `button_permission` VALUES (50, 'admin_moduleinfo_del', 'admin_moduleinfo_delete_delete');
-INSERT INTO `button_permission` VALUES (51, 'admin_permission_sync', 'admin_permission_sync_post');
-INSERT INTO `button_permission` VALUES (52, 'admin_menu_add', 'admin_menu_add_post');
-INSERT INTO `button_permission` VALUES (53, 'admin_menu_edit', 'admin_menu_edit_get');
-INSERT INTO `button_permission` VALUES (54, 'admin_menu_edit', 'admin_menu_update_post');
-INSERT INTO `button_permission` VALUES (55, 'admin_menu_del', 'admin_menu_delete_delete');
-INSERT INTO `button_permission` VALUES (56, 'admin_menu_sort', 'admin_menu_sort_get');
-INSERT INTO `button_permission` VALUES (57, 'admin_menu_sort', 'admin_menu_sort_post');
-INSERT INTO `button_permission` VALUES (58, 'admin_role_add', 'admin_role_add_post');
-INSERT INTO `button_permission` VALUES (59, 'admin_role_edit', 'admin_role_edit_get');
-INSERT INTO `button_permission` VALUES (60, 'admin_role_edit', 'admin_role_update_post');
-INSERT INTO `button_permission` VALUES (61, 'admin_role_del', 'admin_role_delete_delete');
-INSERT INTO `button_permission` VALUES (62, 'admin_role_bind_menu', 'admin_role_menulist_get');
-INSERT INTO `button_permission` VALUES (63, 'admin_role_bind_menu', 'admin_role_bindmenu_post');
-INSERT INTO `button_permission` VALUES (64, 'admin_role_bind_menu', 'admin_role_menubuttonlist_get');
-INSERT INTO `button_permission` VALUES (65, 'admin_role_bind_menu', 'admin_role_bindmenubutton_post');
-INSERT INTO `button_permission` VALUES (66, 'admin_account_add', 'admin_account_add_post');
-INSERT INTO `button_permission` VALUES (67, 'admin_account_edit', 'admin_account_edit_get');
-INSERT INTO `button_permission` VALUES (68, 'admin_account_edit', 'admin_account_update_post');
-INSERT INTO `button_permission` VALUES (69, 'admin_account_del', 'admin_account_delete_delete');
-INSERT INTO `button_permission` VALUES (70, 'admin_account_reset_password', 'admin_account_updatepassword_post');
-INSERT INTO `button_permission` VALUES (71, 'admin_auditinfo_details', 'admin_auditinfo_details_get');
-INSERT INTO `button_permission` VALUES (85, 'admin_config_add', 'admin_config_add_post');
-INSERT INTO `button_permission` VALUES (86, 'admin_config_edit', 'admin_config_edit_get');
-INSERT INTO `button_permission` VALUES (87, 'admin_config_edit', 'admin_config_update_post');
-INSERT INTO `button_permission` VALUES (88, 'admin_config_del', 'admin_config_delete_delete');
-INSERT INTO `button_permission` VALUES (89, 'quartz_group_add', 'quartz_group_add_post');
-INSERT INTO `button_permission` VALUES (90, 'quartz_group_del', 'quartz_group_delete_delete');
-INSERT INTO `button_permission` VALUES (91, 'codegenerator_project_add', 'codegenerator_project_add_post');
-INSERT INTO `button_permission` VALUES (92, 'codegenerator_project_edit', 'codegenerator_project_edit_get');
-INSERT INTO `button_permission` VALUES (93, 'codegenerator_project_edit', 'codegenerator_project_update_post');
-INSERT INTO `button_permission` VALUES (94, 'codegenerator_project_del', 'codegenerator_project_delete_delete');
-INSERT INTO `button_permission` VALUES (95, 'codegenerator_project_build_code', 'codegenerator_project_buildcode_post');
-INSERT INTO `button_permission` VALUES (96, 'codegenerator_enum_add', 'codegenerator_enum_add_post');
-INSERT INTO `button_permission` VALUES (97, 'codegenerator_enum_edit', 'codegenerator_enum_edit_get');
-INSERT INTO `button_permission` VALUES (98, 'codegenerator_enum_edit', 'codegenerator_enum_update_post');
-INSERT INTO `button_permission` VALUES (99, 'codegenerator_enum_del', 'codegenerator_enum_delete_delete');
-
--- ----------------------------
--- Table structure for config
--- ----------------------------
-DROP TABLE IF EXISTS `config`;
-CREATE TABLE `config` (
- `Id` int(11) NOT NULL AUTO_INCREMENT,
- `Key` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Value` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Remarks` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `CreatedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `CreatedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModifiedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `ModifiedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of config
--- ----------------------------
-INSERT INTO `config` VALUES (1, 'sys_title', '通用权限管理系统', '系统标题', '2019-09-29 12:02:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:40:32', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `config` VALUES (2, 'sys_logo', '', '系统Logo', '2019-09-29 12:02:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:40:32', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `config` VALUES (3, 'sys_home', '/admin/home', '系统首页', '2019-09-29 12:02:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:40:32', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `config` VALUES (4, 'sys_userinfo_page', '', '个人信息页', '2019-09-29 12:02:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:40:32', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `config` VALUES (5, 'sys_button_permission', 'True', '启用按钮权限', '2019-09-29 12:02:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:40:32', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `config` VALUES (6, 'sys_permission_validate', 'True', '启用权限验证功能', '2019-09-29 12:02:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:40:32', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `config` VALUES (7, 'sys_auditing', 'True', '启用审计日志', '2019-09-29 12:02:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:40:32', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `config` VALUES (8, 'sys_verify_code', 'False', '启用登录验证码功能', '2019-09-29 12:02:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:40:32', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `config` VALUES (9, 'sys_toolbar_fullscreen', 'True', '显示工具栏全屏按钮', '2019-09-29 12:02:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:40:32', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `config` VALUES (10, 'sys_toolbar_skin', 'True', '显示工具栏皮肤按钮', '2019-09-29 12:02:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:40:32', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `config` VALUES (11, 'sys_toolbar_logout', 'True', '显示工具栏退出按钮', '2019-09-29 12:02:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:40:32', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `config` VALUES (12, 'sys_toolbar_userinfo', 'True', '显示工具栏用户信息按钮', '2019-09-29 12:02:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:40:32', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `config` VALUES (13, 'sys_toolbar_customcss', '', '自定义CSS样式', '2019-09-29 12:02:03', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:40:32', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-
--- ----------------------------
--- Table structure for menu
--- ----------------------------
-DROP TABLE IF EXISTS `menu`;
-CREATE TABLE `menu` (
- `Id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModuleCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Type` smallint(3) NOT NULL DEFAULT 0,
- `ParentId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `RouteName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `RouteParams` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `RouteQuery` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Url` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `IconColor` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
- `Level` int(11) NOT NULL DEFAULT 0,
- `Show` bit(1) NOT NULL DEFAULT b'0',
- `Sort` int(11) NOT NULL DEFAULT 0,
- `Target` smallint(3) NOT NULL DEFAULT 0,
- `DialogWidth` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
- `DialogHeight` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
- `DialogFullscreen` bit(1) NOT NULL DEFAULT b'0',
- `Remarks` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
- `CreatedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `CreatedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModifiedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `ModifiedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of menu
--- ----------------------------
-INSERT INTO `menu` VALUES ('39f08dac-84e1-54e2-22ee-e5d7e3606f90', '', 0, '00000000-0000-0000-0000-000000000000', '系统设置', '', '', '', '', 'system', '', 0, b'1', 2, -1, '', '', b'1', '', '2019-09-29 13:30:28', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:32:25', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `menu` VALUES ('39f08dac-9b84-9a56-20b9-26789223a74f', '', 0, '00000000-0000-0000-0000-000000000000', '权限管理', '', '', '', '', 'permission', '', 0, b'1', 1, -1, '', '', b'1', '', '2019-09-29 13:30:34', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:32:25', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `menu` VALUES ('39f08dad-aca0-7ddf-61d1-0b6ac0841b64', '', 2, '00000000-0000-0000-0000-000000000000', 'GitHub', '', '', '', 'https://github.com/iamoldli/NetModular', 'github', '', 0, b'1', 4, 0, '', '', b'1', '', '2019-09-29 13:31:44', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:32:25', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `menu` VALUES ('39f08daf-7355-6fb9-cfe6-b9804de226f9', 'Admin', 1, '39f08dac-9b84-9a56-20b9-26789223a74f', '模块管理', 'admin_moduleinfo', '', '', '', 'product', '', 1, b'1', 0, 0, '', '', b'1', '', '2019-09-29 13:33:40', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:40', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `menu` VALUES ('39f08daf-8081-2b67-5f77-3c4119b2ab66', 'Admin', 1, '39f08dac-9b84-9a56-20b9-26789223a74f', '权限列表', 'admin_permission', '', '', '', 'verifycode', '', 1, b'1', 0, 0, '', '', b'1', '', '2019-09-29 13:33:43', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:43', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `menu` VALUES ('39f08daf-8feb-d2ce-66dc-12fff451a969', 'Admin', 1, '39f08dac-9b84-9a56-20b9-26789223a74f', '菜单管理', 'admin_menu', '', '', '', 'menu', '', 1, b'1', 0, 0, '', '', b'1', '', '2019-09-29 13:33:47', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:47', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `menu` VALUES ('39f08daf-9b05-80d5-a7f5-21e450af9b70', 'Admin', 1, '39f08dac-9b84-9a56-20b9-26789223a74f', '角色管理', 'admin_role', '', '', '', 'role', '', 1, b'1', 0, 0, '', '', b'1', '', '2019-09-29 13:33:50', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:50', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `menu` VALUES ('39f08daf-a689-5e91-dce9-e6d0088d29dc', 'Admin', 1, '39f08dac-9b84-9a56-20b9-26789223a74f', '账户管理', 'admin_account', '', '', '', 'user', '', 1, b'1', 0, 0, '', '', b'1', '', '2019-09-29 13:33:53', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:53', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `menu` VALUES ('39f08daf-b44b-8fbf-3a88-629dc0922e84', 'Admin', 1, '39f08dac-9b84-9a56-20b9-26789223a74f', '审计日志', 'admin_auditinfo', '', '', '', 'log', '', 1, b'1', 0, 0, '', '', b'1', '', '2019-09-29 13:33:57', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:33:57', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `menu` VALUES ('39f08daf-e02b-bd7b-be06-12eeee0f4da4', 'Admin', 1, '39f08dac-84e1-54e2-22ee-e5d7e3606f90', '系统配置', 'admin_system', '', '', '', 'system', '', 1, b'1', 0, 0, '', '', b'1', '', '2019-09-29 13:34:08', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-09-29 13:40:00', '39f08d5b-177c-a334-34e7-408ef121c6e0');
-INSERT INTO `menu` VALUES ('39f08daf-f8f6-2dad-42c0-c73c787c6def', 'Admin', 1, '39f08dac-84e1-54e2-22ee-e5d7e3606f90', '配置项', 'admin_config', '', '', '', 'tag', '', 1, b'1', 0, 0, '', '', b'1', '', '2019-09-29 13:34:14', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-09 15:15:07', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `menu` VALUES ('39f08db0-067d-fc37-84cb-b5283891fcce', 'Admin', 1, '39f08dac-84e1-54e2-22ee-e5d7e3606f90', '图标管理', 'admin_icon', '', '', '', 'photo', '', 1, b'1', 0, 0, '', '', b'1', '', '2019-09-29 13:34:18', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-09 15:15:24', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `menu` VALUES ('39f10ddc-b762-96c9-58a3-9ce21ae7ebcd', '', 2, '00000000-0000-0000-0000-000000000000', '官方文档', '', '', '', 'https://nm.iamoldli.com/docs', 'archives', '', 0, b'1', 3, 0, '', '', b'1', '', '2019-10-24 10:54:30', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:32:25', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `menu` VALUES ('39f10e6c-c0c3-011e-b172-5cf586d41c10', '', 0, '00000000-0000-0000-0000-000000000000', '代码生成', '', '', '', '', 'develop', '', 0, b'1', 0, -1, '', '', b'1', '', '2019-10-24 13:31:50', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:32:25', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `menu` VALUES ('39f10e6c-f280-2e8c-6eba-3ae5e3353366', 'CodeGenerator', 1, '39f10e6c-c0c3-011e-b172-5cf586d41c10', '项目列表', 'codegenerator_project', '', '', '', 'project', '', 1, b'1', 0, 0, '', '', b'1', '', '2019-10-24 13:32:03', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:32:03', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `menu` VALUES ('39f10e6c-fce2-97c7-e3f7-0fe8be590899', 'CodeGenerator', 1, '39f10e6c-c0c3-011e-b172-5cf586d41c10', '枚举列表', 'codegenerator_enum', '', '', '', '', '', 1, b'1', 0, 0, '', '', b'1', '', '2019-10-24 13:32:05', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:32:05', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-
--- ----------------------------
--- Table structure for menu_permission
--- ----------------------------
-DROP TABLE IF EXISTS `menu_permission`;
-CREATE TABLE `menu_permission` (
- `Id` int(11) NOT NULL AUTO_INCREMENT,
- `MenuCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `PermissionCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 28 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of menu_permission
--- ----------------------------
-INSERT INTO `menu_permission` VALUES (1, 'personnelfiles_company', 'personnelfiles_company_query_get');
-INSERT INTO `menu_permission` VALUES (2, 'personnelfiles_department', 'personnelfiles_department_query_get');
-INSERT INTO `menu_permission` VALUES (3, 'personnelfiles_department', 'personnelfiles_department_tree_get');
-INSERT INTO `menu_permission` VALUES (4, 'personnelfiles_user', 'personnelfiles_user_query_get');
-INSERT INTO `menu_permission` VALUES (5, 'common_area', 'common_area_query_get');
-INSERT INTO `menu_permission` VALUES (6, 'common_area', 'common_area_querychildren_get');
-INSERT INTO `menu_permission` VALUES (7, 'common_attachment', 'common_attachment_query_get');
-INSERT INTO `menu_permission` VALUES (9, 'quartz_job', 'quartz_job_query_get');
-INSERT INTO `menu_permission` VALUES (10, 'admin_moduleinfo', 'admin_moduleinfo_query_get');
-INSERT INTO `menu_permission` VALUES (11, 'admin_permission', 'admin_permission_query_get');
-INSERT INTO `menu_permission` VALUES (12, 'admin_menu', 'admin_menu_query_get');
-INSERT INTO `menu_permission` VALUES (13, 'admin_menu', 'admin_menu_tree_get');
-INSERT INTO `menu_permission` VALUES (14, 'admin_role', 'admin_role_query_get');
-INSERT INTO `menu_permission` VALUES (15, 'admin_account', 'admin_account_query_get');
-INSERT INTO `menu_permission` VALUES (16, 'admin_auditinfo', 'admin_auditinfo_query_get');
-INSERT INTO `menu_permission` VALUES (22, 'admin_system', 'admin_system_config_post');
-INSERT INTO `menu_permission` VALUES (23, 'admin_system', 'admin_system_uploadlogo_post');
-INSERT INTO `menu_permission` VALUES (24, 'admin_config', 'admin_config_query_get');
-INSERT INTO `menu_permission` VALUES (25, 'quartz_group', 'quartz_group_query_get');
-INSERT INTO `menu_permission` VALUES (26, 'codegenerator_project', 'codegenerator_project_query_get');
-INSERT INTO `menu_permission` VALUES (27, 'codegenerator_enum', 'codegenerator_enum_query_get');
-
--- ----------------------------
--- Table structure for moduleinfo
--- ----------------------------
-DROP TABLE IF EXISTS `moduleinfo`;
-CREATE TABLE `moduleinfo` (
- `Id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Version` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Remarks` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
- `CreatedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `CreatedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModifiedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `ModifiedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of moduleinfo
--- ----------------------------
-INSERT INTO `moduleinfo` VALUES ('39f08d5b-ba44-6817-6d57-fd07e0c9a482', '权限管理', 'Admin', '1.4.0-beta1', '', '2019-09-29 12:02:13', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:27', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `moduleinfo` VALUES ('39f10e6b-8c7e-a8f1-d185-664af23edff3', '代码生成', 'CodeGenerator', '1.4.0', '', '2019-10-24 13:30:31', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:27', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-
--- ----------------------------
--- Table structure for permission
--- ----------------------------
-DROP TABLE IF EXISTS `permission`;
-CREATE TABLE `permission` (
- `Id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModuleCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Controller` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Action` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `HttpMethod` smallint(3) NOT NULL DEFAULT 0,
- `Code` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `CreatedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `CreatedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModifiedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `ModifiedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of permission
--- ----------------------------
-INSERT INTO `permission` VALUES ('39f08d5b-d104-dad2-d611-3586643f34b7', '账户管理_绑定角色', 'Admin', 'Account', 'BindRole', 2, 'admin_account_bindrole_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d110-8a6f-5d0c-1acc4cd6e713', '账户管理_查询', 'Admin', 'Account', 'Query', 0, 'admin_account_query_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d11d-e539-b8e1-58967d8fd541', '账户管理_添加', 'Admin', 'Account', 'Add', 2, 'admin_account_add_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d131-df4d-fb47-2698f84c7cf6', '账户管理_编辑', 'Admin', 'Account', 'Edit', 0, 'admin_account_edit_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d136-91f1-39c4-eec8eb28f490', '账户管理_更新', 'Admin', 'Account', 'Update', 2, 'admin_account_update_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d149-b5a9-3e89-d13f3cedb1c6', '账户管理_删除', 'Admin', 'Account', 'Delete', 3, 'admin_account_delete_delete', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d158-c047-51d7-509b0606fd96', '账户管理_重置密码', 'Admin', 'Account', 'ResetPassword', 2, 'admin_account_resetpassword_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d175-9882-0f7c-fb2bae67f6c8', '审计信息_查询', 'Admin', 'AuditInfo', 'Query', 0, 'admin_auditinfo_query_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d1ae-0b50-d74d-23ea07538398', '审计信息_详情', 'Admin', 'AuditInfo', 'Details', 0, 'admin_auditinfo_details_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d1cc-e9c7-bd4d-da331764b4a3', '按钮管理_查询', 'Admin', 'Button', 'Query', 0, 'admin_button_query_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d1d6-55c8-3580-cda4932af779', '配置项管理_查询', 'Admin', 'Config', 'Query', 0, 'admin_config_query_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d1e0-65f2-73d4-8424438c8567', '配置项管理_添加', 'Admin', 'Config', 'Add', 2, 'admin_config_add_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d1e5-9e0e-0c29-ddf2a73482b8', '配置项管理_删除', 'Admin', 'Config', 'Delete', 3, 'admin_config_delete_delete', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d1ec-13f3-a1f5-23a2bc892d15', '配置项管理_编辑', 'Admin', 'Config', 'Edit', 0, 'admin_config_edit_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d1f1-f48b-9ebe-766fcb346c63', '配置项管理_修改', 'Admin', 'Config', 'Update', 2, 'admin_config_update_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d200-dee4-a526-d3422506a692', '菜单管理_菜单树', 'Admin', 'Menu', 'Tree', 0, 'admin_menu_tree_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d210-2150-33bc-f8b9b97d2b10', '菜单管理_查询菜单列表', 'Admin', 'Menu', 'Query', 0, 'admin_menu_query_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d21c-40fb-6de2-3bddb3a1682a', '菜单管理_添加', 'Admin', 'Menu', 'Add', 2, 'admin_menu_add_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d225-a13c-7b44-e8c3e7d3d128', '菜单管理_删除', 'Admin', 'Menu', 'Delete', 3, 'admin_menu_delete_delete', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d22e-ee56-933a-ed09cfb4a706', '菜单管理_编辑', 'Admin', 'Menu', 'Edit', 0, 'admin_menu_edit_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d236-7004-f0ca-925788da03aa', '菜单管理_更新', 'Admin', 'Menu', 'Update', 2, 'admin_menu_update_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d243-8f1a-7c50-6feeb098432e', '菜单管理_更新排序信息', 'Admin', 'Menu', 'Sort', 0, 'admin_menu_sort_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d24b-cfa0-96e6-9242c9cdff31', '菜单管理_更新排序信息', 'Admin', 'Menu', 'Sort', 2, 'admin_menu_sort_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d259-2ac7-dfa6-1bf0ae78e4f0', '模块信息_查询', 'Admin', 'ModuleInfo', 'Query', 0, 'admin_moduleinfo_query_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d264-13cc-1cc2-a4c2639e7fda', '模块信息_同步模块数据', 'Admin', 'ModuleInfo', 'Sync', 2, 'admin_moduleinfo_sync_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d269-43b8-2d42-48a8cf8a3c38', '模块信息_删除', 'Admin', 'ModuleInfo', 'Delete', 3, 'admin_moduleinfo_delete_delete', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d27d-241c-b966-5a4ce019fe3e', '权限接口_查询', 'Admin', 'Permission', 'Query', 0, 'admin_permission_query_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d286-6b4b-82cf-b8f4c8052fef', '权限接口_同步', 'Admin', 'Permission', 'Sync', 2, 'admin_permission_sync_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d28c-73c8-d195-f2de0713cbf3', '角色管理_查询', 'Admin', 'Role', 'Query', 0, 'admin_role_query_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d298-0e81-694f-723d60c55bda', '角色管理_添加', 'Admin', 'Role', 'Add', 2, 'admin_role_add_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d29d-7195-e52b-5b20e346f898', '角色管理_删除', 'Admin', 'Role', 'Delete', 3, 'admin_role_delete_delete', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:33', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d2a5-3475-50d1-d3984f82f5d3', '角色管理_编辑', 'Admin', 'Role', 'Edit', 0, 'admin_role_edit_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:33', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d2aa-77a2-7f52-72d9974f7020', '角色管理_修改', 'Admin', 'Role', 'Update', 2, 'admin_role_update_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:33', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d2b5-55c5-995d-17557580db07', '角色管理_获取角色的关联菜单列表', 'Admin', 'Role', 'MenuList', 0, 'admin_role_menulist_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:33', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d2b8-0db7-9575-bd6cd85f12b0', '角色管理_绑定菜单', 'Admin', 'Role', 'BindMenu', 2, 'admin_role_bindmenu_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:33', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d2bc-3e4d-3993-a7a34ef134af', '角色管理_获取角色关联的菜单按钮列表', 'Admin', 'Role', 'MenuButtonList', 0, 'admin_role_menubuttonlist_get', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:33', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d2c5-438b-194f-6b5f35cb587b', '角色管理_绑定菜单按钮', 'Admin', 'Role', 'BindMenuButton', 2, 'admin_role_bindmenubutton_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:33', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d2cd-b7a0-c335-9b298cb1a765', '系统_修改系统配置', 'Admin', 'System', 'Config', 2, 'admin_system_config_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:33', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f08d5b-d2d4-846e-7503-ee323474339d', '系统_上传Logo', 'Admin', 'System', 'UploadLogo', 2, 'admin_system_uploadlogo_post', '2019-09-29 12:02:19', '39f08d5b-177c-a334-34e7-408ef121c6e0', '2019-10-24 13:31:33', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7d70-dfc7-c5ea-3e8f366da479', '实体管理_查询', 'CodeGenerator', 'Class', 'Query', 0, 'codegenerator_class_query_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7d7b-248e-08d0-b668e367e081', '实体管理_添加', 'CodeGenerator', 'Class', 'Add', 2, 'codegenerator_class_add_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7d81-b442-7fa2-926c19e04836', '实体管理_删除', 'CodeGenerator', 'Class', 'Delete', 3, 'codegenerator_class_delete_delete', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7d88-78d2-ca14-d5f41f3dbd96', '实体管理_编辑', 'CodeGenerator', 'Class', 'Edit', 0, 'codegenerator_class_edit_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7d8e-6bdb-4a7b-8222bc43dde6', '实体管理_修改', 'CodeGenerator', 'Class', 'Update', 2, 'codegenerator_class_update_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7d94-b2e3-cae1-563d920a5072', '实体管理_生成代码', 'CodeGenerator', 'Class', 'BuildCode', 0, 'codegenerator_class_buildcode_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7d9a-e113-46aa-f6916583e5ab', '枚举管理_查询', 'CodeGenerator', 'Enum', 'Query', 0, 'codegenerator_enum_query_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7da0-2a3a-50fc-5116b3f0c98e', '枚举管理_添加', 'CodeGenerator', 'Enum', 'Add', 2, 'codegenerator_enum_add_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7da7-db7a-d3d4-6f44ae7d6f9c', '枚举管理_删除', 'CodeGenerator', 'Enum', 'Delete', 3, 'codegenerator_enum_delete_delete', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7dad-fe9b-7bdf-866698d3c954', '枚举管理_编辑', 'CodeGenerator', 'Enum', 'Edit', 0, 'codegenerator_enum_edit_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7db3-d92b-f9a2-41239eac4114', '枚举管理_修改', 'CodeGenerator', 'Enum', 'Update', 2, 'codegenerator_enum_update_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7dbb-d157-03b2-99e38607552f', '枚举项管理_查询', 'CodeGenerator', 'EnumItem', 'Query', 0, 'codegenerator_enumitem_query_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7dc1-e145-6b70-e6f97b3c1d31', '枚举项管理_添加', 'CodeGenerator', 'EnumItem', 'Add', 2, 'codegenerator_enumitem_add_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7dc8-5f59-e6f5-64fc4448e9ff', '枚举项管理_删除', 'CodeGenerator', 'EnumItem', 'Delete', 3, 'codegenerator_enumitem_delete_delete', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7dce-3613-be42-a3171afec2a9', '枚举项管理_编辑', 'CodeGenerator', 'EnumItem', 'Edit', 0, 'codegenerator_enumitem_edit_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7dd3-6338-a635-604a737aae56', '枚举项管理_修改', 'CodeGenerator', 'EnumItem', 'Update', 2, 'codegenerator_enumitem_update_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7ddb-5474-5952-33228a83d322', '枚举项管理_获取排序信息', 'CodeGenerator', 'EnumItem', 'Sort', 0, 'codegenerator_enumitem_sort_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7de0-9f12-bb80-281bd6527d57', '枚举项管理_更新排序信息', 'CodeGenerator', 'EnumItem', 'Sort', 2, 'codegenerator_enumitem_sort_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7de6-c1d3-7b4f-f5b8e90f4a1d', '模型属性管理_查询', 'CodeGenerator', 'ModelProperty', 'Query', 0, 'codegenerator_modelproperty_query_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7ded-3f1d-bf51-3c5e513e6a62', '模型属性管理_添加', 'CodeGenerator', 'ModelProperty', 'Add', 2, 'codegenerator_modelproperty_add_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7df3-9b33-a25b-a79ef2fd92d9', '模型属性管理_删除', 'CodeGenerator', 'ModelProperty', 'Delete', 3, 'codegenerator_modelproperty_delete_delete', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7dfa-6e07-451f-66a104202462', '模型属性管理_编辑', 'CodeGenerator', 'ModelProperty', 'Edit', 0, 'codegenerator_modelproperty_edit_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e00-7a13-c788-75b4d9cba809', '模型属性管理_修改', 'CodeGenerator', 'ModelProperty', 'Update', 2, 'codegenerator_modelproperty_update_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e05-a9ab-1bb7-e95872fcc4a5', '模型属性管理_获取排序信息', 'CodeGenerator', 'ModelProperty', 'Sort', 0, 'codegenerator_modelproperty_sort_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e0d-0bb7-22b0-a8639cf60f95', '模型属性管理_更新排序信息', 'CodeGenerator', 'ModelProperty', 'Sort', 2, 'codegenerator_modelproperty_sort_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e13-9d06-296c-2aea20a52912', '模型属性管理_修改可空状态', 'CodeGenerator', 'ModelProperty', 'UpdateNullable', 2, 'codegenerator_modelproperty_updatenullable_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e19-1a8d-f880-33d698a44d4f', '模型属性管理_获取下拉列表', 'CodeGenerator', 'ModelProperty', 'Select', 0, 'codegenerator_modelproperty_select_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e20-f64b-6256-3fd67ca21b7b', '模型属性管理_从实体中导入属性', 'CodeGenerator', 'ModelProperty', 'ImportFromEntity', 2, 'codegenerator_modelproperty_importfromentity_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e25-7e1b-3c74-0a8fa17df3a8', '项目管理_查询', 'CodeGenerator', 'Project', 'Query', 0, 'codegenerator_project_query_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e2c-6a4e-012d-c16fa45125fd', '项目管理_添加', 'CodeGenerator', 'Project', 'Add', 2, 'codegenerator_project_add_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e33-4782-5ae1-eac0a534b43b', '项目管理_删除', 'CodeGenerator', 'Project', 'Delete', 3, 'codegenerator_project_delete_delete', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e39-1184-c52d-c6070907ee57', '项目管理_编辑', 'CodeGenerator', 'Project', 'Edit', 0, 'codegenerator_project_edit_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e40-fdaf-12e2-6bacb9fb9b61', '项目管理_修改', 'CodeGenerator', 'Project', 'Update', 2, 'codegenerator_project_update_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e46-177d-d68f-2a986a622d20', '项目管理_生成代码', 'CodeGenerator', 'Project', 'BuildCode', 2, 'codegenerator_project_buildcode_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e4f-2478-d07f-a468b921ffcc', '实体属性管理_查询', 'CodeGenerator', 'Property', 'Query', 0, 'codegenerator_property_query_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e56-34df-5e29-2ef3d7b05503', '实体属性管理_添加', 'CodeGenerator', 'Property', 'Add', 2, 'codegenerator_property_add_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e5f-a482-76f6-f044498ac081', '实体属性管理_删除', 'CodeGenerator', 'Property', 'Delete', 3, 'codegenerator_property_delete_delete', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e66-db50-3afa-40065fd9b8e5', '实体属性管理_编辑', 'CodeGenerator', 'Property', 'Edit', 0, 'codegenerator_property_edit_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e6d-8b34-1c2d-eff59e252268', '实体属性管理_修改', 'CodeGenerator', 'Property', 'Update', 2, 'codegenerator_property_update_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e74-7b40-7391-1207895cb36a', '实体属性管理_获取属性类型下拉列表', 'CodeGenerator', 'Property', 'PropertyTypeSelect', 0, 'codegenerator_property_propertytypeselect_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e7a-3b08-fe4e-ec56986157e3', '实体属性管理_获取排序信息', 'CodeGenerator', 'Property', 'Sort', 0, 'codegenerator_property_sort_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e83-2d7c-dab5-07e0fb248723', '实体属性管理_更新排序信息', 'CodeGenerator', 'Property', 'Sort', 2, 'codegenerator_property_sort_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e89-829f-29cf-ceb718b6aefb', '实体属性管理_修改可空状态', 'CodeGenerator', 'Property', 'UpdateNullable', 2, 'codegenerator_property_updatenullable_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e91-74c1-aaa7-f64865dead3e', '实体属性管理_修改列表显示状态', 'CodeGenerator', 'Property', 'UpdateShowInList', 2, 'codegenerator_property_updateshowinlist_post', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-INSERT INTO `permission` VALUES ('39f10e6c-7e97-a1c7-5a0a-4c3bef25f4e9', '实体属性管理_获取下拉列表', 'CodeGenerator', 'Property', 'Select', 0, 'codegenerator_property_select_get', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a', '2019-10-24 13:31:32', '2e23d1d9-4a72-acc2-f6ff-39ed21cb6a4a');
-
--- ----------------------------
--- Table structure for role
--- ----------------------------
-DROP TABLE IF EXISTS `role`;
-CREATE TABLE `role` (
- `Id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Remarks` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `IsSpecified` bit(1) NOT NULL DEFAULT b'0',
- `CreatedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `CreatedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModifiedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `ModifiedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Deleted` bit(1) NOT NULL DEFAULT b'0',
- `DeletedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `DeletedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of role
--- ----------------------------
-INSERT INTO `role` VALUES ('39f08d5b-173b-1cbb-7381-407c87b2e8e2', '超级管理员', '超级管理员', b'0', '2019-09-29 12:01:31', '00000000-0000-0000-0000-000000000000', '2019-09-29 12:01:31', '00000000-0000-0000-0000-000000000000', b'0', '2019-09-29 12:01:31', '00000000-0000-0000-0000-000000000000');
-
--- ----------------------------
--- Table structure for role_menu
--- ----------------------------
-DROP TABLE IF EXISTS `role_menu`;
-CREATE TABLE `role_menu` (
- `Id` int(11) NOT NULL AUTO_INCREMENT,
- `RoleId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `MenuId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 122 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of role_menu
--- ----------------------------
-INSERT INTO `role_menu` VALUES (106, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08dac-9b84-9a56-20b9-26789223a74f');
-INSERT INTO `role_menu` VALUES (107, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-7355-6fb9-cfe6-b9804de226f9');
-INSERT INTO `role_menu` VALUES (108, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-8081-2b67-5f77-3c4119b2ab66');
-INSERT INTO `role_menu` VALUES (109, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-8feb-d2ce-66dc-12fff451a969');
-INSERT INTO `role_menu` VALUES (110, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-9b05-80d5-a7f5-21e450af9b70');
-INSERT INTO `role_menu` VALUES (111, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-a689-5e91-dce9-e6d0088d29dc');
-INSERT INTO `role_menu` VALUES (112, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-b44b-8fbf-3a88-629dc0922e84');
-INSERT INTO `role_menu` VALUES (113, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08dac-84e1-54e2-22ee-e5d7e3606f90');
-INSERT INTO `role_menu` VALUES (114, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-e02b-bd7b-be06-12eeee0f4da4');
-INSERT INTO `role_menu` VALUES (115, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-f8f6-2dad-42c0-c73c787c6def');
-INSERT INTO `role_menu` VALUES (116, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08db0-067d-fc37-84cb-b5283891fcce');
-INSERT INTO `role_menu` VALUES (117, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f10ddc-b762-96c9-58a3-9ce21ae7ebcd');
-INSERT INTO `role_menu` VALUES (118, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08dad-aca0-7ddf-61d1-0b6ac0841b64');
-INSERT INTO `role_menu` VALUES (119, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f10e6c-c0c3-011e-b172-5cf586d41c10');
-INSERT INTO `role_menu` VALUES (120, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f10e6c-f280-2e8c-6eba-3ae5e3353366');
-INSERT INTO `role_menu` VALUES (121, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f10e6c-fce2-97c7-e3f7-0fe8be590899');
-
--- ----------------------------
--- Table structure for role_menu_button
--- ----------------------------
-DROP TABLE IF EXISTS `role_menu_button`;
-CREATE TABLE `role_menu_button` (
- `Id` int(11) NOT NULL AUTO_INCREMENT,
- `RoleId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `MenuId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ButtonId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 63 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Records of role_menu_button
--- ----------------------------
-INSERT INTO `role_menu_button` VALUES (30, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-7355-6fb9-cfe6-b9804de226f9', '39f08daf-7366-40d9-6116-510f50a9949b');
-INSERT INTO `role_menu_button` VALUES (31, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-7355-6fb9-cfe6-b9804de226f9', '39f08daf-7379-0830-a724-272048d335c4');
-INSERT INTO `role_menu_button` VALUES (32, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-8081-2b67-5f77-3c4119b2ab66', '39f08daf-8092-82f1-bf83-c74b15f5fae3');
-INSERT INTO `role_menu_button` VALUES (33, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-8feb-d2ce-66dc-12fff451a969', '39f08daf-8ff9-b2e7-f6ec-bbc690f7568a');
-INSERT INTO `role_menu_button` VALUES (34, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-8feb-d2ce-66dc-12fff451a969', '39f08daf-8ffe-d189-3f53-f2174cb2e3d4');
-INSERT INTO `role_menu_button` VALUES (35, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-8feb-d2ce-66dc-12fff451a969', '39f08daf-901a-ea1c-6dbc-fd3d68fb9757');
-INSERT INTO `role_menu_button` VALUES (36, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-8feb-d2ce-66dc-12fff451a969', '39f08daf-9020-8ebb-2d86-bd0adcd9d9dd');
-INSERT INTO `role_menu_button` VALUES (37, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-9b05-80d5-a7f5-21e450af9b70', '39f08daf-9b13-0809-b6f5-64d2430a37c4');
-INSERT INTO `role_menu_button` VALUES (38, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-9b05-80d5-a7f5-21e450af9b70', '39f08daf-9b1f-b315-ccc8-4ed480ae2595');
-INSERT INTO `role_menu_button` VALUES (39, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-9b05-80d5-a7f5-21e450af9b70', '39f08daf-9b28-8f39-eeb7-289ea4c44604');
-INSERT INTO `role_menu_button` VALUES (40, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-9b05-80d5-a7f5-21e450af9b70', '39f08daf-9b38-d4f7-270d-5e8629f9601d');
-INSERT INTO `role_menu_button` VALUES (41, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-a689-5e91-dce9-e6d0088d29dc', '39f08daf-a6a3-772f-7559-4a22f0614589');
-INSERT INTO `role_menu_button` VALUES (42, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-a689-5e91-dce9-e6d0088d29dc', '39f08daf-a6b0-0ea0-58c4-918941c668b2');
-INSERT INTO `role_menu_button` VALUES (43, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-a689-5e91-dce9-e6d0088d29dc', '39f08daf-a6b9-a4ac-5953-a4e4074ef3b0');
-INSERT INTO `role_menu_button` VALUES (44, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-a689-5e91-dce9-e6d0088d29dc', '39f08daf-a6cc-8c2f-e31a-9c91f6c6afce');
-INSERT INTO `role_menu_button` VALUES (45, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-b44b-8fbf-3a88-629dc0922e84', '39f08daf-b45e-0264-f197-063f969d3aa0');
-INSERT INTO `role_menu_button` VALUES (46, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-f8f6-2dad-42c0-c73c787c6def', '39f08daf-f905-e02f-341a-bbc0b80cbf5e');
-INSERT INTO `role_menu_button` VALUES (47, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-f8f6-2dad-42c0-c73c787c6def', '39f08daf-f909-628c-9a0a-2c23a57b9103');
-INSERT INTO `role_menu_button` VALUES (48, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f08daf-f8f6-2dad-42c0-c73c787c6def', '39f08daf-f915-e1f1-d7d8-ebd21adbebe6');
-INSERT INTO `role_menu_button` VALUES (56, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f10e6c-f280-2e8c-6eba-3ae5e3353366', '39f08db3-ea6b-6af7-1ef5-a226af30fbe4');
-INSERT INTO `role_menu_button` VALUES (57, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f10e6c-f280-2e8c-6eba-3ae5e3353366', '39f08db3-ea80-e0e3-69ea-af5ab431ac6f');
-INSERT INTO `role_menu_button` VALUES (58, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f10e6c-f280-2e8c-6eba-3ae5e3353366', '39f08db3-eaa7-e42f-34fb-25baaaf55e87');
-INSERT INTO `role_menu_button` VALUES (59, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f10e6c-f280-2e8c-6eba-3ae5e3353366', '39f08db3-eada-892b-b250-c2d58279d388');
-INSERT INTO `role_menu_button` VALUES (60, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f10e6c-fce2-97c7-e3f7-0fe8be590899', '39f08db3-f788-9a1c-f227-f372acb73cea');
-INSERT INTO `role_menu_button` VALUES (61, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f10e6c-fce2-97c7-e3f7-0fe8be590899', '39f08db3-f7ba-4c00-d053-ca662ef2ad06');
-INSERT INTO `role_menu_button` VALUES (62, '39f08d5b-173b-1cbb-7381-407c87b2e8e2', '39f10e6c-fce2-97c7-e3f7-0fe8be590899', '39f08db3-f7d6-7533-682f-739e51d10ae1');
-
-SET FOREIGN_KEY_CHECKS = 1;
diff --git a/data/MySql/nm_codegenerator.sql b/data/MySql/nm_codegenerator.sql
deleted file mode 100644
index fb90f02..0000000
--- a/data/MySql/nm_codegenerator.sql
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- Navicat Premium Data Transfer
-
- Source Server : localhost
- Source Server Type : MySQL
- Source Server Version : 80015
- Source Host : localhost:3306
- Source Schema : nm_codegenerator
-
- Target Server Type : MySQL
- Target Server Version : 80015
- File Encoding : 65001
-
- Date: 29/09/2019 15:00:14
-*/
-
-SET NAMES utf8mb4;
-SET FOREIGN_KEY_CHECKS = 0;
-
--- ----------------------------
--- Table structure for class
--- ----------------------------
-DROP TABLE IF EXISTS `class`;
-CREATE TABLE `class` (
- `Id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ProjectId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `TableName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `BaseEntityType` smallint(3) NOT NULL DEFAULT 0,
- `Remarks` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `CreatedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `CreatedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModifiedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `ModifiedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Table structure for class_method
--- ----------------------------
-DROP TABLE IF EXISTS `class_method`;
-CREATE TABLE `class_method` (
- `Id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ClassId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Query` bit(1) NOT NULL DEFAULT b'0',
- `Add` bit(1) NOT NULL DEFAULT b'0',
- `Delete` bit(1) NOT NULL DEFAULT b'0',
- `Edit` bit(1) NOT NULL DEFAULT b'0',
- `CreatedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `CreatedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModifiedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `ModifiedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Table structure for enum
--- ----------------------------
-DROP TABLE IF EXISTS `enum`;
-CREATE TABLE `enum` (
- `Id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Remarks` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `CreatedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `CreatedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModifiedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `ModifiedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Table structure for enum_item
--- ----------------------------
-DROP TABLE IF EXISTS `enum_item`;
-CREATE TABLE `enum_item` (
- `Id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `EnumId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Value` int(11) NOT NULL DEFAULT 0,
- `Remarks` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Table structure for model_property
--- ----------------------------
-DROP TABLE IF EXISTS `model_property`;
-CREATE TABLE `model_property` (
- `Id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ProjectId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ClassId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModelType` smallint(3) NOT NULL DEFAULT 0,
- `Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Type` smallint(3) NOT NULL DEFAULT 0,
- `Nullable` bit(1) NOT NULL DEFAULT b'0',
- `EnumId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Remarks` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Sort` int(11) NOT NULL DEFAULT 0,
- `CreatedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `CreatedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModifiedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `ModifiedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Table structure for project
--- ----------------------------
-DROP TABLE IF EXISTS `project`;
-CREATE TABLE `project` (
- `Id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `No` int(11) NOT NULL DEFAULT 0,
- `Code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Copyright` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL,
- `CreatedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `CreatedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModifiedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `ModifiedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Deleted` bit(1) NOT NULL DEFAULT b'0',
- `DeletedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `DeletedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
--- ----------------------------
--- Table structure for property
--- ----------------------------
-DROP TABLE IF EXISTS `property`;
-CREATE TABLE `property` (
- `Id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ProjectId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ClassId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `IsPrimaryKey` bit(1) NOT NULL DEFAULT b'0',
- `IsInherit` bit(1) NOT NULL DEFAULT b'0',
- `Type` smallint(3) NOT NULL DEFAULT 0,
- `Length` int(11) NOT NULL DEFAULT 0,
- `Precision` int(11) NOT NULL DEFAULT 0,
- `Scale` int(11) NOT NULL DEFAULT 0,
- `EnumId` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Nullable` bit(1) NOT NULL DEFAULT b'0',
- `Remarks` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `Sort` int(11) NOT NULL DEFAULT 0,
- `ShowInList` bit(1) NOT NULL DEFAULT b'0',
- `HasDefaultValue` bit(1) NOT NULL DEFAULT b'0',
- `CreatedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `CreatedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- `ModifiedTime` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
- `ModifiedBy` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
- PRIMARY KEY (`Id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-
-SET FOREIGN_KEY_CHECKS = 1;
diff --git a/data/SQLite/Nm_Admin.db b/data/SQLite/Nm_Admin.db
deleted file mode 100644
index 0836d30..0000000
Binary files a/data/SQLite/Nm_Admin.db and /dev/null differ
diff --git a/data/SQLite/Nm_CodeGenerator.db b/data/SQLite/Nm_CodeGenerator.db
deleted file mode 100644
index 8106d7c..0000000
Binary files a/data/SQLite/Nm_CodeGenerator.db and /dev/null differ
diff --git a/data/SqlServer/Nm_Admin.sql b/data/SqlServer/Nm_Admin.sql
deleted file mode 100644
index dca6a3f..0000000
Binary files a/data/SqlServer/Nm_Admin.sql and /dev/null differ
diff --git a/data/SqlServer/Nm_CodeGenerator.sql b/data/SqlServer/Nm_CodeGenerator.sql
deleted file mode 100644
index bbf1109..0000000
Binary files a/data/SqlServer/Nm_CodeGenerator.sql and /dev/null differ
diff --git a/publish.ps1 b/publish.ps1
new file mode 100644
index 0000000..86fc01d
--- /dev/null
+++ b/publish.ps1
@@ -0,0 +1,29 @@
+# 让用户手动输入 NuGet 密钥
+$NugetApiKey = Read-Host "请输入 NuGet API Key"
+
+# 清理 _packages 目录
+if (Test-Path "_packages") {
+ Remove-Item "_packages\*" -Force
+ Write-Host "_packages 目录已清理"
+}
+
+# 编译项目
+dotnet build
+
+# 发布 nupkg 包
+$nupkgFiles = Get-ChildItem -Path "_packages" -Filter "*.nupkg"
+foreach ($pkg in $nupkgFiles) {
+ Write-Host "正在发布 nupkg 包: $($pkg.FullName)"
+ dotnet nuget push $pkg.FullName --api-key $NugetApiKey --source https://api.nuget.org/v3/index.json
+}
+
+# 发布 snupkg 包(符号包)
+$snupkgFiles = Get-ChildItem -Path "_packages" -Filter "*.snupkg"
+foreach ($spkg in $snupkgFiles) {
+ Write-Host "正在发布 snupkg 包: $($spkg.FullName)"
+ dotnet nuget push $spkg.FullName --api-key $NugetApiKey --source https://api.nuget.org/v3/index.json --symbol-source https://api.nuget.org/v3/index.json
+}
+
+# 运行结束后关闭窗口
+Write-Host "发布完成,窗口即将关闭..."
+Start-Sleep -
\ No newline at end of file
diff --git a/script/npm_install.ps1 b/script/npm_install.ps1
deleted file mode 100644
index 11393c2..0000000
--- a/script/npm_install.ps1
+++ /dev/null
@@ -1,3 +0,0 @@
-cd ../src/UI/module-code-generator
-npm --registry https://registry.npmjs.org/ install
-pause
\ No newline at end of file
diff --git a/script/npm_publish.ps1 b/script/npm_publish.ps1
deleted file mode 100644
index 74ab354..0000000
--- a/script/npm_publish.ps1
+++ /dev/null
@@ -1,3 +0,0 @@
-cd ../src/UI/module-code-generator
-npm --registry https://registry.npmjs.org/ publish
-pause
\ No newline at end of file
diff --git a/script/npm_update.ps1 b/script/npm_update.ps1
deleted file mode 100644
index 699166f..0000000
--- a/script/npm_update.ps1
+++ /dev/null
@@ -1,3 +0,0 @@
-cd ../src/UI/module-code-generator
-npm --registry https://registry.npmjs.org/ update
-pause
\ No newline at end of file
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index bc51e45..4b5487b 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -1,22 +1,26 @@
-
- CodeGenerator
- 代码生成器
- Oldli
- 1.4.5
- NetModular Module $(Id)($(Name)) - $(MSBuildProjectName)
- $(NoWarn);1591
- Latest
- NetModular.Module.$(Id)
- $(RootNamespacePrefix).$(MSBuildProjectName)
- $(AssemblyName)
- true
- true
-
- $(SolutionDir)\_packages
- Oldli
- Oldli
- https://nm.iamoldli.com/docs/
- https://github.com/iamoldli/NetModular.Module.CodeGenerator
-
+
+ 02
+ CodeGenerator
+ 代码生成
+ develop
+ Oldli
+ 9.0.2
+ net9.0
+ NetModular Module $(Code)($(Name)) - $(MSBuildProjectName)
+ $(NoWarn);1591
+ Latest
+ NetModular.Module.$(Code)
+ $(RootNamespacePrefix).$(MSBuildProjectName)
+ $(AssemblyName)
+ true
+ true
+
+ $(SolutionDir)\_packages
+ Oldli
+ Oldli
+ true
+ https://docs.17mkh.com/
+ https://github.com/iamoldli/NetModular.Module.CodeGenerator
+
diff --git a/src/Library/Application/Application.csproj b/src/Library/Application/Application.csproj
index 422e12b..f68657f 100644
--- a/src/Library/Application/Application.csproj
+++ b/src/Library/Application/Application.csproj
@@ -1,13 +1,9 @@
-
- netstandard2.0
-
-
-
-
+
+
diff --git a/src/Library/Application/ClassService/ClassService.cs b/src/Library/Application/ClassService/ClassService.cs
index ae9cc51..f93db49 100644
--- a/src/Library/Application/ClassService/ClassService.cs
+++ b/src/Library/Application/ClassService/ClassService.cs
@@ -2,10 +2,9 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using AutoMapper;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.ClassService.ViewModels;
-using NetModular.Module.CodeGenerator.Application.ProjectService;
-using NetModular.Module.CodeGenerator.Application.ProjectService.ResultModels;
+using NetModular.Module.CodeGenerator.Application.ModuleService;
+using NetModular.Module.CodeGenerator.Application.ModuleService.ResultModels;
using NetModular.Module.CodeGenerator.Domain.Class;
using NetModular.Module.CodeGenerator.Domain.Class.Models;
using NetModular.Module.CodeGenerator.Domain.ClassMethod;
@@ -23,10 +22,10 @@ public class ClassService : IClassService
private readonly BaseEntityPropertyCollection _baseEntityPropertyCollection;
private readonly IClassMethodRepository _classMethodRepository;
- private readonly IProjectService _projectService;
+ private readonly IModuleService _projectService;
private readonly CodeGeneratorDbContext _dbContext;
- public ClassService(IMapper mapper, IClassRepository repository, BaseEntityPropertyCollection baseEntityPropertyCollection, IPropertyRepository propertyRepository, IClassMethodRepository classMethodRepository, IProjectService projectService, CodeGeneratorDbContext dbContext)
+ public ClassService(IMapper mapper, IClassRepository repository, BaseEntityPropertyCollection baseEntityPropertyCollection, IPropertyRepository propertyRepository, IClassMethodRepository classMethodRepository, IModuleService projectService, CodeGeneratorDbContext dbContext)
{
_mapper = mapper;
_repository = repository;
@@ -156,14 +155,14 @@ public async Task Update(ClassUpdateModel model)
return ResultModel.Failed();
}
- public async Task> BuildCode(Guid id)
+ public async Task> BuildCode(Guid id)
{
- var result = new ResultModel();
+ var result = new ResultModel();
var entity = await _repository.GetAsync(id);
if (entity == null)
return result.Failed("对象不存在");
- return await _projectService.BuildCode(entity.ProjectId, new List { entity });
+ return await _projectService.BuildCode(entity.ModuleId, new List { entity });
}
}
}
diff --git a/src/Library/Application/ClassService/IClassService.cs b/src/Library/Application/ClassService/IClassService.cs
index 9487f50..354a8dd 100644
--- a/src/Library/Application/ClassService/IClassService.cs
+++ b/src/Library/Application/ClassService/IClassService.cs
@@ -1,8 +1,7 @@
using System;
using System.Threading.Tasks;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.ClassService.ViewModels;
-using NetModular.Module.CodeGenerator.Application.ProjectService.ResultModels;
+using NetModular.Module.CodeGenerator.Application.ModuleService.ResultModels;
using NetModular.Module.CodeGenerator.Domain.Class.Models;
namespace NetModular.Module.CodeGenerator.Application.ClassService
@@ -52,6 +51,6 @@ public interface IClassService
///
///
///
- Task> BuildCode(Guid id);
+ Task> BuildCode(Guid id);
}
}
\ No newline at end of file
diff --git a/src/Library/Application/ClassService/ViewModels/ClassAddModel.cs b/src/Library/Application/ClassService/ViewModels/ClassAddModel.cs
index 4d3db4e..871bdb8 100644
--- a/src/Library/Application/ClassService/ViewModels/ClassAddModel.cs
+++ b/src/Library/Application/ClassService/ViewModels/ClassAddModel.cs
@@ -9,7 +9,7 @@ public class ClassAddModel
///
/// 项目编号
///
- public Guid ProjectId { get; set; }
+ public Guid ModuleId { get; set; }
///
/// 类名称
@@ -34,6 +34,11 @@ public class ClassAddModel
[Required(ErrorMessage = "请输入类名")]
public string Remarks { get; set; }
+ ///
+ /// 菜单图标
+ ///
+ public string MenuIcon { get; set; }
+
///
/// 方法
///
diff --git a/src/Library/Application/ClassService/ViewModels/ClassUpdateModel.cs b/src/Library/Application/ClassService/ViewModels/ClassUpdateModel.cs
index 63ad0bb..2d980e3 100644
--- a/src/Library/Application/ClassService/ViewModels/ClassUpdateModel.cs
+++ b/src/Library/Application/ClassService/ViewModels/ClassUpdateModel.cs
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel.DataAnnotations;
+using NetModular.Module.CodeGenerator.Domain.Class;
namespace NetModular.Module.CodeGenerator.Application.ClassService.ViewModels
{
@@ -26,6 +27,16 @@ public class ClassUpdateModel
[Required(ErrorMessage = "请输入类名")]
public string Remarks { get; set; }
+ ///
+ /// 菜单图标
+ ///
+ public string MenuIcon { get; set; }
+
+ ///
+ /// 基类类型
+ ///
+ public BaseEntityType BaseEntityType { get; set; }
+
///
/// 方法
///
diff --git a/src/Library/Application/EnumItemService/EnumItemService.cs b/src/Library/Application/EnumItemService/EnumItemService.cs
index 62782f0..e13c0c2 100644
--- a/src/Library/Application/EnumItemService/EnumItemService.cs
+++ b/src/Library/Application/EnumItemService/EnumItemService.cs
@@ -3,7 +3,6 @@
using System.Threading.Tasks;
using AutoMapper;
using NetModular.Lib.Utils.Core.Models;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.EnumItemService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.EnumItem;
using NetModular.Module.CodeGenerator.Domain.EnumItem.Models;
diff --git a/src/Library/Application/EnumItemService/IEnumItemService.cs b/src/Library/Application/EnumItemService/IEnumItemService.cs
index b0ff31c..b0b4ac6 100644
--- a/src/Library/Application/EnumItemService/IEnumItemService.cs
+++ b/src/Library/Application/EnumItemService/IEnumItemService.cs
@@ -1,7 +1,6 @@
using System;
using System.Threading.Tasks;
using NetModular.Lib.Utils.Core.Models;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.EnumItemService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.EnumItem.Models;
diff --git a/src/Library/Application/EnumService/EnumService.cs b/src/Library/Application/EnumService/EnumService.cs
index f3184fc..b32cab5 100644
--- a/src/Library/Application/EnumService/EnumService.cs
+++ b/src/Library/Application/EnumService/EnumService.cs
@@ -2,7 +2,6 @@
using System.Linq;
using System.Threading.Tasks;
using AutoMapper;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.EnumService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.Enum;
using NetModular.Module.CodeGenerator.Domain.Enum.Models;
diff --git a/src/Library/Application/EnumService/IEnumService.cs b/src/Library/Application/EnumService/IEnumService.cs
index 4d83012..13aced5 100644
--- a/src/Library/Application/EnumService/IEnumService.cs
+++ b/src/Library/Application/EnumService/IEnumService.cs
@@ -1,6 +1,5 @@
using System;
using System.Threading.Tasks;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.EnumService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.Enum.Models;
diff --git a/src/Library/Application/ModelPropertyService/IModelPropertyService.cs b/src/Library/Application/ModelPropertyService/IModelPropertyService.cs
index 6f4b2b2..895e733 100644
--- a/src/Library/Application/ModelPropertyService/IModelPropertyService.cs
+++ b/src/Library/Application/ModelPropertyService/IModelPropertyService.cs
@@ -1,7 +1,6 @@
using System;
using System.Threading.Tasks;
using NetModular.Lib.Utils.Core.Models;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.ModelPropertyService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.ModelProperty.Models;
diff --git a/src/Library/Application/ModelPropertyService/ModelPropertyService.cs b/src/Library/Application/ModelPropertyService/ModelPropertyService.cs
index aea7bcb..f2e7f30 100644
--- a/src/Library/Application/ModelPropertyService/ModelPropertyService.cs
+++ b/src/Library/Application/ModelPropertyService/ModelPropertyService.cs
@@ -4,7 +4,6 @@
using System.Threading.Tasks;
using AutoMapper;
using NetModular.Lib.Utils.Core.Models;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.ModelPropertyService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.Class;
using NetModular.Module.CodeGenerator.Domain.ModelProperty;
@@ -48,7 +47,7 @@ public async Task Add(ModelPropertyAddModel model)
return ResultModel.Failed("关联类不存在");
var entity = _mapper.Map(model);
- entity.ProjectId = classEntity.ProjectId;
+ entity.ModuleId = classEntity.ModuleId;
if (await _repository.Exists(entity))
{
diff --git a/src/Library/Application/ProjectService/IProjectService.cs b/src/Library/Application/ModuleService/IModuleService.cs
similarity index 63%
rename from src/Library/Application/ProjectService/IProjectService.cs
rename to src/Library/Application/ModuleService/IModuleService.cs
index 1a6e28a..aa5aa67 100644
--- a/src/Library/Application/ProjectService/IProjectService.cs
+++ b/src/Library/Application/ModuleService/IModuleService.cs
@@ -1,32 +1,31 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
-using NetModular.Lib.Utils.Core.Result;
-using NetModular.Module.CodeGenerator.Application.ProjectService.ResultModels;
-using NetModular.Module.CodeGenerator.Application.ProjectService.ViewModels;
+using NetModular.Module.CodeGenerator.Application.ModuleService.ResultModels;
+using NetModular.Module.CodeGenerator.Application.ModuleService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.Class;
-using NetModular.Module.CodeGenerator.Domain.Project.Models;
+using NetModular.Module.CodeGenerator.Domain.Module.Models;
-namespace NetModular.Module.CodeGenerator.Application.ProjectService
+namespace NetModular.Module.CodeGenerator.Application.ModuleService
{
///
/// 项目服务
///
- public interface IProjectService
+ public interface IModuleService
{
///
/// 查询
///
///
///
- Task Query(ProjectQueryModel model);
+ Task Query(ModuleQueryModel model);
///
/// 创建
///
///
///
- Task Add(ProjectAddModel model);
+ Task Add(ModuleAddModel model);
///
/// 删除
@@ -47,13 +46,13 @@ public interface IProjectService
///
///
///
- Task Update(ProjectUpdateModel model);
+ Task Update(ModuleUpdateModel model);
///
/// 生成代码,返回文件的Guid
///
///
- Task> BuildCode(ProjectBuildCodeModel model);
+ Task> BuildCode(ModuleBuildCodeModel model);
///
/// 生成代码
@@ -61,6 +60,6 @@ public interface IProjectService
///
///
///
- Task> BuildCode(Guid projectId, IList classList = null);
+ Task> BuildCode(Guid projectId, IList classList = null);
}
}
diff --git a/src/Library/Application/ProjectService/ProjectService.cs b/src/Library/Application/ModuleService/ModuleService.cs
similarity index 66%
rename from src/Library/Application/ProjectService/ProjectService.cs
rename to src/Library/Application/ModuleService/ModuleService.cs
index 01752e1..c1c90ac 100644
--- a/src/Library/Application/ProjectService/ProjectService.cs
+++ b/src/Library/Application/ModuleService/ModuleService.cs
@@ -5,33 +5,30 @@
using System.Linq;
using System.Threading.Tasks;
using AutoMapper;
-using Microsoft.Extensions.Options;
-using NetModular.Lib.Utils.Core.Extensions;
-using NetModular.Lib.Utils.Core.Options;
-using NetModular.Lib.Utils.Core.Result;
-using NetModular.Module.CodeGenerator.Application.ProjectService.ResultModels;
-using NetModular.Module.CodeGenerator.Application.ProjectService.ViewModels;
+using NetModular.Lib.Config.Abstractions;
+using NetModular.Lib.Config.Abstractions.Impl;
+using NetModular.Module.CodeGenerator.Application.ModuleService.ResultModels;
+using NetModular.Module.CodeGenerator.Application.ModuleService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.Class;
using NetModular.Module.CodeGenerator.Domain.ClassMethod;
using NetModular.Module.CodeGenerator.Domain.Enum;
using NetModular.Module.CodeGenerator.Domain.EnumItem;
using NetModular.Module.CodeGenerator.Domain.ModelProperty;
-using NetModular.Module.CodeGenerator.Domain.Project;
-using NetModular.Module.CodeGenerator.Domain.Project.Models;
+using NetModular.Module.CodeGenerator.Domain.Module;
+using NetModular.Module.CodeGenerator.Domain.Module.Models;
using NetModular.Module.CodeGenerator.Domain.Property;
-using NetModular.Module.CodeGenerator.Infrastructure.Options;
+using NetModular.Module.CodeGenerator.Infrastructure;
+using NetModular.Module.CodeGenerator.Infrastructure.NuGet;
using NetModular.Module.CodeGenerator.Infrastructure.Repositories;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Default;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-namespace NetModular.Module.CodeGenerator.Application.ProjectService
+namespace NetModular.Module.CodeGenerator.Application.ModuleService
{
- public class ProjectService : IProjectService
+ public class ModuleService : IModuleService
{
private readonly IMapper _mapper;
- private readonly ModuleCommonOptions _commonOptions;
- private readonly CodeGeneratorOptions _codeGeneratorOptions;
- private readonly IProjectRepository _repository;
+ private readonly IModuleRepository _repository;
private readonly IClassRepository _classRepository;
private readonly IPropertyRepository _propertyRepository;
private readonly IEnumRepository _enumRepository;
@@ -39,8 +36,10 @@ public class ProjectService : IProjectService
private readonly IModelPropertyRepository _modelPropertyRepository;
private readonly IClassMethodRepository _classMethodRepository;
private readonly CodeGeneratorDbContext _dbContext;
+ private readonly NuGetHelper _nugetHelper;
+ private readonly IConfigProvider _configProvider;
- public ProjectService(IProjectRepository repository, IMapper mapper, IOptionsMonitor optionsMonitor, IClassRepository classRepository, IPropertyRepository propertyRepository, IEnumRepository enumRepository, IEnumItemRepository enumItemRepository, IModelPropertyRepository modelPropertyRepository, IOptionsMonitor codeGeneratorOptions, IClassMethodRepository classMethodRepository, CodeGeneratorDbContext dbContext)
+ public ModuleService(IModuleRepository repository, IMapper mapper, IClassRepository classRepository, IPropertyRepository propertyRepository, IEnumRepository enumRepository, IEnumItemRepository enumItemRepository, IModelPropertyRepository modelPropertyRepository, IClassMethodRepository classMethodRepository, CodeGeneratorDbContext dbContext, NuGetHelper nugetHelper, IConfigProvider configProvider)
{
_repository = repository;
_mapper = mapper;
@@ -51,13 +50,13 @@ public ProjectService(IProjectRepository repository, IMapper mapper, IOptionsMon
_modelPropertyRepository = modelPropertyRepository;
_classMethodRepository = classMethodRepository;
_dbContext = dbContext;
- _codeGeneratorOptions = codeGeneratorOptions.CurrentValue;
- _commonOptions = optionsMonitor.CurrentValue;
+ _nugetHelper = nugetHelper;
+ _configProvider = configProvider;
}
- public async Task Query(ProjectQueryModel model)
+ public async Task Query(ModuleQueryModel model)
{
- var result = new QueryResultModel
+ var result = new QueryResultModel
{
Rows = await _repository.Query(model),
Total = model.TotalCount
@@ -65,9 +64,9 @@ public async Task Query(ProjectQueryModel model)
return ResultModel.Success(result);
}
- public async Task Add(ProjectAddModel model)
+ public async Task Add(ModuleAddModel model)
{
- var entity = _mapper.Map(model);
+ var entity = _mapper.Map(model);
var result = await _repository.AddAsync(entity);
return ResultModel.Result(result);
}
@@ -83,13 +82,13 @@ public async Task Delete(Guid id)
var result = await _repository.SoftDeleteAsync(id, uow);
if (result)
{
- result = await _classRepository.DeleteByProject(id, uow);
+ result = await _classRepository.DeleteByModule(id, uow);
if (result)
{
- result = await _propertyRepository.DeleteByProject(id, uow);
+ result = await _propertyRepository.DeleteByModule(id, uow);
if (result)
{
- result = await _modelPropertyRepository.DeleteByProject(id, uow);
+ result = await _modelPropertyRepository.DeleteByModule(id, uow);
if (result)
{
uow.Commit();
@@ -109,11 +108,11 @@ public async Task Edit(Guid id)
if (entity == null)
return ResultModel.NotExists;
- var model = _mapper.Map(entity);
+ var model = _mapper.Map(entity);
return ResultModel.Success(model);
}
- public async Task Update(ProjectUpdateModel model)
+ public async Task Update(ModuleUpdateModel model)
{
var entity = await _repository.GetAsync(model.Id);
if (entity == null)
@@ -122,38 +121,49 @@ public async Task Update(ProjectUpdateModel model)
_mapper.Map(model, entity);
var result = await _repository.UpdateAsync(entity);
-
return ResultModel.Result(result);
}
- public Task> BuildCode(ProjectBuildCodeModel model)
+ public Task> BuildCode(ModuleBuildCodeModel model)
{
return BuildCode(model.Id);
}
- public async Task> BuildCode(Guid projectId, IList classList = null)
+ public async Task> BuildCode(Guid moduleId, IList classList = null)
{
- var result = new ResultModel();
+ var result = new ResultModel();
- var project = await _repository.GetAsync(projectId);
- if (project == null)
- return result.Failed("项目不存在");
+ var module = await _repository.GetAsync(moduleId);
+ if (module == null)
+ return result.Failed("模块不存在");
- //创建项目生成对象
- var projectBuildModel = _mapper.Map(project);
+ //创建模块生成对象
+ var moduleBuildModel = _mapper.Map(module);
- projectBuildModel.Prefix = _codeGeneratorOptions.Prefix;
+ var config = _configProvider.Get();
+ moduleBuildModel.Prefix = config.Prefix;
+ moduleBuildModel.UiPrefix = config.UiPrefix;
var id = Guid.NewGuid().ToString();
- var rootPath = Path.Combine(_commonOptions.TempPath, _codeGeneratorOptions.BuildCodePath);
+ var rootPath = config.BuildCodePath;
+ if (rootPath.IsNull())
+ {
+ var pathConfig = _configProvider.Get();
+ rootPath = Path.Combine(pathConfig.TempPath, "CodeGenerator/BuildCode");
+ }
+
+ var moduleFullName = $"{config.Prefix}.Module.{module.Code}";
var buildModel = new TemplateBuildModel
{
- RootPath = Path.Combine(rootPath, id),
+ RootPath = Path.Combine(rootPath, id, moduleFullName),
+ NuGetPackageVersions = _nugetHelper.GetVersions()
};
if (classList == null)
{
- classList = await _classRepository.QueryAllByProject(project.Id);
+ //如果classList参数为null,表示生成整个解决方案
+ buildModel.GenerateSln = true;
+ classList = await _classRepository.QueryAllByModule(module.Id);
}
foreach (var classEntity in classList)
@@ -222,20 +232,26 @@ public async Task> BuildCode(Guid proj
classBuildModel.Method = await _classMethodRepository.GetByClass(classEntity.Id);
- projectBuildModel.ClassList.Add(classBuildModel);
+ moduleBuildModel.ClassList.Add(classBuildModel);
}
- buildModel.Project = projectBuildModel;
+ buildModel.Module = moduleBuildModel;
var builder = new DefaultTemplateBuilder();
builder.Build(buildModel);
- ZipFile.CreateFromDirectory(buildModel.RootPath, Path.Combine(rootPath, id + ".zip"));
+ var sourceDir = Path.Combine(rootPath, id);
+ var outputFile = Path.Combine(rootPath, id + ".zip");
+ ZipFile.CreateFromDirectory(sourceDir, outputFile);
+
+ //删除临时文件
+ Directory.Delete(sourceDir, true);
- var resultModel = new ProjectBuildCodeResultModel
+ var resultModel = new ModuleBuildCodeResultModel
{
Id = id,
- Name = projectBuildModel.Name + ".zip"
+ Name = moduleBuildModel.Name + ".zip",
+ ZipPath = outputFile
};
return result.Success(resultModel);
diff --git a/src/Library/Application/ModuleService/ResultModels/ModuleBuildCodeResultModel.cs b/src/Library/Application/ModuleService/ResultModels/ModuleBuildCodeResultModel.cs
new file mode 100644
index 0000000..9c5392f
--- /dev/null
+++ b/src/Library/Application/ModuleService/ResultModels/ModuleBuildCodeResultModel.cs
@@ -0,0 +1,17 @@
+namespace NetModular.Module.CodeGenerator.Application.ModuleService.ResultModels
+{
+ ///
+ /// 项目生成代码返回模型
+ ///
+ public class ModuleBuildCodeResultModel
+ {
+ public string Id { get; set; }
+
+ public string Name { get; set; }
+
+ ///
+ /// 压缩文件路径
+ ///
+ public string ZipPath { get; set; }
+ }
+}
diff --git a/src/Library/Application/ModuleService/ViewModels/ModuleAddModel.cs b/src/Library/Application/ModuleService/ViewModels/ModuleAddModel.cs
new file mode 100644
index 0000000..6e30851
--- /dev/null
+++ b/src/Library/Application/ModuleService/ViewModels/ModuleAddModel.cs
@@ -0,0 +1,54 @@
+using System.ComponentModel.DataAnnotations;
+
+namespace NetModular.Module.CodeGenerator.Application.ModuleService.ViewModels
+{
+ ///
+ /// 添加模块
+ ///
+ public class ModuleAddModel
+ {
+ ///
+ /// 名称
+ ///
+ [Required(ErrorMessage = "请输入名称")]
+ public string Name { get; set; }
+
+ ///
+ /// 编号
+ ///
+ [Range(0, 59315, ErrorMessage = "编码在 0 到 59315 之间")]
+ public int No { get; set; }
+
+ ///
+ /// 编码
+ ///
+ [Required(ErrorMessage = "请输入编码")]
+ public string Code { get; set; }
+
+ ///
+ /// 图标
+ ///
+ [Required(ErrorMessage = "请选择图标")]
+ public string Icon { get; set; }
+
+ ///
+ /// 版权声明
+ ///
+ public string Copyright { get; set; }
+
+ ///
+ /// 公司单位
+ ///
+ public string Company { get; set; }
+
+ ///
+ /// 官方地址
+ ///
+ public string ProjectUrl { get; set; }
+
+ ///
+ /// 仓库地址
+ ///
+ public string RepositoryUrl { get; set; }
+ }
+}
diff --git a/src/Library/Application/ProjectService/ViewModels/ProjectBuildCodeModel.cs b/src/Library/Application/ModuleService/ViewModels/ModuleBuildCodeModel.cs
similarity index 71%
rename from src/Library/Application/ProjectService/ViewModels/ProjectBuildCodeModel.cs
rename to src/Library/Application/ModuleService/ViewModels/ModuleBuildCodeModel.cs
index 9abd7cc..b488783 100644
--- a/src/Library/Application/ProjectService/ViewModels/ProjectBuildCodeModel.cs
+++ b/src/Library/Application/ModuleService/ViewModels/ModuleBuildCodeModel.cs
@@ -1,12 +1,12 @@
using System;
using System.ComponentModel.DataAnnotations;
-namespace NetModular.Module.CodeGenerator.Application.ProjectService.ViewModels
+namespace NetModular.Module.CodeGenerator.Application.ModuleService.ViewModels
{
///
/// 生成代码模型
///
- public class ProjectBuildCodeModel
+ public class ModuleBuildCodeModel
{
///
/// 项目编号
diff --git a/src/Library/Application/ProjectService/ViewModels/ProjectUpdateModel.cs b/src/Library/Application/ModuleService/ViewModels/ModuleUpdateModel.cs
similarity index 68%
rename from src/Library/Application/ProjectService/ViewModels/ProjectUpdateModel.cs
rename to src/Library/Application/ModuleService/ViewModels/ModuleUpdateModel.cs
index 68c76e2..5e31b1d 100644
--- a/src/Library/Application/ProjectService/ViewModels/ProjectUpdateModel.cs
+++ b/src/Library/Application/ModuleService/ViewModels/ModuleUpdateModel.cs
@@ -1,12 +1,12 @@
using System;
using System.ComponentModel.DataAnnotations;
-namespace NetModular.Module.CodeGenerator.Application.ProjectService.ViewModels
+namespace NetModular.Module.CodeGenerator.Application.ModuleService.ViewModels
{
///
/// 项目编辑
///
- public class ProjectUpdateModel : ProjectAddModel
+ public class ModuleUpdateModel : ModuleAddModel
{
///
/// 编号
diff --git a/src/Library/Application/ProjectService/_MapperConfig.cs b/src/Library/Application/ModuleService/_MapperConfig.cs
similarity index 59%
rename from src/Library/Application/ProjectService/_MapperConfig.cs
rename to src/Library/Application/ModuleService/_MapperConfig.cs
index b6ad059..d20547a 100644
--- a/src/Library/Application/ProjectService/_MapperConfig.cs
+++ b/src/Library/Application/ModuleService/_MapperConfig.cs
@@ -1,24 +1,24 @@
using AutoMapper;
using NetModular.Lib.Mapper.AutoMapper;
-using NetModular.Module.CodeGenerator.Application.ProjectService.ViewModels;
+using NetModular.Module.CodeGenerator.Application.ModuleService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.Class;
using NetModular.Module.CodeGenerator.Domain.ModelProperty;
-using NetModular.Module.CodeGenerator.Domain.Project;
+using NetModular.Module.CodeGenerator.Domain.Module;
using NetModular.Module.CodeGenerator.Domain.Property;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-namespace NetModular.Module.CodeGenerator.Application.ProjectService
+namespace NetModular.Module.CodeGenerator.Application.ModuleService
{
public class MapperConfig : IMapperConfig
{
public void Bind(IMapperConfigurationExpression cfg)
{
- cfg.CreateMap();
- cfg.CreateMap();
- cfg.CreateMap();
+ cfg.CreateMap();
+ cfg.CreateMap();
+ cfg.CreateMap();
//代码生成
- cfg.CreateMap();
+ cfg.CreateMap();
cfg.CreateMap();
cfg.CreateMap();
cfg.CreateMap();
diff --git a/src/Library/Application/OnlineModuleService/IOnlineModuleService.cs b/src/Library/Application/OnlineModuleService/IOnlineModuleService.cs
new file mode 100644
index 0000000..aed390a
--- /dev/null
+++ b/src/Library/Application/OnlineModuleService/IOnlineModuleService.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Threading.Tasks;
+using NetModular.Module.CodeGenerator.Application.OnlineModuleService.ViewModels;
+using NetModular.Module.CodeGenerator.Domain.OnlineModule.Models;
+
+namespace NetModular.Module.CodeGenerator.Application.OnlineModuleService
+{
+ ///
+ /// 在线模块服务
+ ///
+ public interface IOnlineModuleService
+ {
+ ///
+ /// 查询
+ ///
+ ///
+ ///
+ Task Query(OnlineModuleQueryModel model);
+
+ ///
+ /// 创建
+ ///
+ ///
+ ///
+ Task Add(OnlineModuleAddModel model);
+
+ ///
+ /// 删除
+ ///
+ /// 编号
+ ///
+ Task Delete(Guid id);
+
+ ///
+ /// 编辑
+ ///
+ ///
+ ///
+ Task Edit(Guid id);
+
+ ///
+ /// 修改
+ ///
+ ///
+ ///
+ Task Update(OnlineModuleUpdateModel model);
+
+ }
+}
diff --git a/src/Library/Application/OnlineModuleService/OnlineModuleService.cs b/src/Library/Application/OnlineModuleService/OnlineModuleService.cs
new file mode 100644
index 0000000..298a31d
--- /dev/null
+++ b/src/Library/Application/OnlineModuleService/OnlineModuleService.cs
@@ -0,0 +1,76 @@
+using System;
+using System.Threading.Tasks;
+using AutoMapper;
+using NetModular.Module.CodeGenerator.Application.OnlineModuleService.ViewModels;
+using NetModular.Module.CodeGenerator.Domain.OnlineModule;
+using NetModular.Module.CodeGenerator.Domain.OnlineModule.Models;
+
+namespace NetModular.Module.CodeGenerator.Application.OnlineModuleService
+{
+ public class OnlineModuleService : IOnlineModuleService
+ {
+ private readonly IMapper _mapper;
+ private readonly IOnlineModuleRepository _repository;
+ public OnlineModuleService(IMapper mapper, IOnlineModuleRepository repository)
+ {
+ _mapper = mapper;
+ _repository = repository;
+ }
+
+ public async Task Query(OnlineModuleQueryModel model)
+ {
+ var result = new QueryResultModel
+ {
+ Rows = await _repository.Query(model),
+ Total = model.TotalCount
+ };
+ return ResultModel.Success(result);
+ }
+
+ public async Task Add(OnlineModuleAddModel model)
+ {
+ var entity = _mapper.Map(model);
+ //if (await _repository.Exists(entity))
+ //{
+ //return ResultModel.HasExists;
+ //}
+
+ var result = await _repository.AddAsync(entity);
+ return ResultModel.Result(result);
+ }
+
+ public async Task Delete(Guid id)
+ {
+ var result = await _repository.DeleteAsync(id);
+ return ResultModel.Result(result);
+ }
+
+ public async Task Edit(Guid id)
+ {
+ var entity = await _repository.GetAsync(id);
+ if (entity == null)
+ return ResultModel.NotExists;
+
+ var model = _mapper.Map(entity);
+ return ResultModel.Success(model);
+ }
+
+ public async Task Update(OnlineModuleUpdateModel model)
+ {
+ var entity = await _repository.GetAsync(model.Id);
+ if (entity == null)
+ return ResultModel.NotExists;
+
+ _mapper.Map(model, entity);
+
+ //if (await _repository.Exists(entity))
+ //{
+ //return ResultModel.HasExists;
+ //}
+
+ var result = await _repository.UpdateAsync(entity);
+
+ return ResultModel.Result(result);
+ }
+ }
+}
diff --git a/src/Library/Application/OnlineModuleService/ViewModels/OnlineModuleAddModel.cs b/src/Library/Application/OnlineModuleService/ViewModels/OnlineModuleAddModel.cs
new file mode 100644
index 0000000..0a85d0a
--- /dev/null
+++ b/src/Library/Application/OnlineModuleService/ViewModels/OnlineModuleAddModel.cs
@@ -0,0 +1,54 @@
+namespace NetModular.Module.CodeGenerator.Application.OnlineModuleService.ViewModels
+{
+ ///
+ /// 在线模块添加模型
+ ///
+ public class OnlineModuleAddModel
+ {
+ ///
+ /// 名称
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// 编码
+ ///
+ public string Code { get; set; }
+
+ ///
+ /// 图标
+ ///
+ public string Icon { get; set; }
+
+ ///
+ /// 介绍说明
+ ///
+ public string Description { get; set; }
+
+ ///
+ /// NuGet包ID
+ ///
+ public string NuGetId { get; set; }
+
+ ///
+ /// NPM包ID
+ ///
+ public string NpmId { get; set; }
+
+ ///
+ /// 公司名称
+ ///
+ public string Company { get; set; }
+
+ ///
+ /// 项目地址
+ ///
+ public string ProjectUrl { get; set; }
+
+ ///
+ /// 仓库地址
+ ///
+ public string RepositoryUrl { get; set; }
+
+ }
+}
diff --git a/src/Library/Application/OnlineModuleService/ViewModels/OnlineModuleUpdateModel.cs b/src/Library/Application/OnlineModuleService/ViewModels/OnlineModuleUpdateModel.cs
new file mode 100644
index 0000000..52c291c
--- /dev/null
+++ b/src/Library/Application/OnlineModuleService/ViewModels/OnlineModuleUpdateModel.cs
@@ -0,0 +1,14 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+
+namespace NetModular.Module.CodeGenerator.Application.OnlineModuleService.ViewModels
+{
+ ///
+ /// 在线模块添加模型
+ ///
+ public class OnlineModuleUpdateModel : OnlineModuleAddModel
+ {
+ [Required(ErrorMessage = "请选择要修改的在线模块")]
+ public Guid Id { get; set; }
+ }
+}
diff --git a/src/Library/Application/OnlineModuleService/_MapperConfig.cs b/src/Library/Application/OnlineModuleService/_MapperConfig.cs
new file mode 100644
index 0000000..a87c02c
--- /dev/null
+++ b/src/Library/Application/OnlineModuleService/_MapperConfig.cs
@@ -0,0 +1,17 @@
+using AutoMapper;
+using NetModular.Lib.Mapper.AutoMapper;
+using NetModular.Module.CodeGenerator.Application.OnlineModuleService.ViewModels;
+using NetModular.Module.CodeGenerator.Domain.OnlineModule;
+
+namespace NetModular.Module.CodeGenerator.Application.OnlineModuleService
+{
+ public class MapperConfig : IMapperConfig
+ {
+ public void Bind(IMapperConfigurationExpression cfg)
+ {
+ cfg.CreateMap();
+ cfg.CreateMap();
+ cfg.CreateMap();
+ }
+ }
+}
diff --git a/src/Library/Application/ProjectService/ResultModels/ProjectBuildCodeResultModel.cs b/src/Library/Application/ProjectService/ResultModels/ProjectBuildCodeResultModel.cs
deleted file mode 100644
index 30aa941..0000000
--- a/src/Library/Application/ProjectService/ResultModels/ProjectBuildCodeResultModel.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-namespace NetModular.Module.CodeGenerator.Application.ProjectService.ResultModels
-{
- ///
- /// 项目生成代码返回模型
- ///
- public class ProjectBuildCodeResultModel
- {
- public string Id { get; set; }
-
- public string Name { get; set; }
- }
-}
diff --git a/src/Library/Application/ProjectService/ViewModels/ProjectAddModel.cs b/src/Library/Application/ProjectService/ViewModels/ProjectAddModel.cs
deleted file mode 100644
index cf5a557..0000000
--- a/src/Library/Application/ProjectService/ViewModels/ProjectAddModel.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using System.ComponentModel.DataAnnotations;
-
-namespace NetModular.Module.CodeGenerator.Application.ProjectService.ViewModels
-{
- ///
- /// 项目添加
- ///
- public class ProjectAddModel
- {
- ///
- /// 名称
- ///
- [Required(ErrorMessage = "请输入项目名称")]
- public string Name { get; set; }
-
- ///
- /// 编号
- ///
- public int No { get; set; }
-
- ///
- /// 编码
- ///
- [Required(ErrorMessage = "请输入项目编码")]
- public string Code { get; set; }
-
- ///
- /// 版权声明
- ///
- public string Copyright { get; set; }
- }
-}
diff --git a/src/Library/Application/PropertyService/IPropertyService.cs b/src/Library/Application/PropertyService/IPropertyService.cs
index 32ad09a..4f96a32 100644
--- a/src/Library/Application/PropertyService/IPropertyService.cs
+++ b/src/Library/Application/PropertyService/IPropertyService.cs
@@ -1,7 +1,6 @@
using System;
using System.Threading.Tasks;
using NetModular.Lib.Utils.Core.Models;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.PropertyService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.Property.Models;
diff --git a/src/Library/Application/PropertyService/PropertyService.cs b/src/Library/Application/PropertyService/PropertyService.cs
index 4bb95ef..255aab1 100644
--- a/src/Library/Application/PropertyService/PropertyService.cs
+++ b/src/Library/Application/PropertyService/PropertyService.cs
@@ -3,7 +3,6 @@
using System.Threading.Tasks;
using AutoMapper;
using NetModular.Lib.Utils.Core.Models;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.PropertyService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.Class;
using NetModular.Module.CodeGenerator.Domain.Property;
@@ -44,7 +43,7 @@ public async Task Add(PropertyAddModel model)
return ResultModel.Failed("关联类不存在");
var entity = _mapper.Map(model);
- entity.ProjectId = classEntity.ProjectId;
+ entity.ModuleId = classEntity.ModuleId;
if (await _repository.Exists(entity))
{
diff --git a/src/Library/Domain/Class/ClassEntity.Extend.cs b/src/Library/Domain/Class/ClassEntity.Extend.cs
index 2c25d52..e772eb9 100644
--- a/src/Library/Domain/Class/ClassEntity.Extend.cs
+++ b/src/Library/Domain/Class/ClassEntity.Extend.cs
@@ -1,5 +1,4 @@
using NetModular.Lib.Data.Abstractions.Attributes;
-using NetModular.Lib.Utils.Core.Extensions;
namespace NetModular.Module.CodeGenerator.Domain.Class
{
diff --git a/src/Library/Domain/Class/ClassEntity.cs b/src/Library/Domain/Class/ClassEntity.cs
index 1d2fd43..b45ce5c 100644
--- a/src/Library/Domain/Class/ClassEntity.cs
+++ b/src/Library/Domain/Class/ClassEntity.cs
@@ -11,9 +11,9 @@ namespace NetModular.Module.CodeGenerator.Domain.Class
public partial class ClassEntity : EntityBase
{
///
- /// 项目编号
+ /// 模块ID
///
- public Guid ProjectId { get; set; }
+ public Guid ModuleId { get; set; }
///
/// 名称
@@ -34,5 +34,10 @@ public partial class ClassEntity : EntityBase
/// 说明
///
public string Remarks { get; set; }
+
+ ///
+ /// 菜单图标
+ ///
+ public string MenuIcon { get; set; }
}
}
diff --git a/src/Library/Domain/Class/IClassRepository.cs b/src/Library/Domain/Class/IClassRepository.cs
index bcbdfd7..1fd40d7 100644
--- a/src/Library/Domain/Class/IClassRepository.cs
+++ b/src/Library/Domain/Class/IClassRepository.cs
@@ -19,11 +19,11 @@ public interface IClassRepository : IRepository
Task> Query(ClassQueryModel model);
///
- /// 查询指定项目的所有类列表
+ /// 查询指定模块的所有类列表
///
- ///
+ ///
///
- Task> QueryAllByProject(Guid projectId);
+ Task> QueryAllByModule(Guid moduleId);
///
/// 是否存在
@@ -32,11 +32,11 @@ public interface IClassRepository : IRepository
Task Exists(ClassEntity entity);
///
- /// 删除制定项目的所有类
+ /// 删除制定模块的所有类
///
- ///
+ ///
///
///
- Task DeleteByProject(Guid projectId, IUnitOfWork uow);
+ Task DeleteByModule(Guid moduleId, IUnitOfWork uow);
}
}
diff --git a/src/Library/Domain/Class/Models/ClassQueryModel.cs b/src/Library/Domain/Class/Models/ClassQueryModel.cs
index 566dde0..885b6f8 100644
--- a/src/Library/Domain/Class/Models/ClassQueryModel.cs
+++ b/src/Library/Domain/Class/Models/ClassQueryModel.cs
@@ -7,10 +7,10 @@ namespace NetModular.Module.CodeGenerator.Domain.Class.Models
public class ClassQueryModel : QueryModel
{
///
- /// 所有项目
+ /// 所有模块
///
- [Required(ErrorMessage = "选择项目")]
- public Guid ProjectId { get; set; }
+ [Required(ErrorMessage = "选择模块")]
+ public Guid ModuleId { get; set; }
///
/// 名称
diff --git a/src/Library/Domain/Domain.csproj b/src/Library/Domain/Domain.csproj
index d4b2cf8..dd81c50 100644
--- a/src/Library/Domain/Domain.csproj
+++ b/src/Library/Domain/Domain.csproj
@@ -1,13 +1,9 @@
-
- netstandard2.0
-
-
-
-
-
+
+
+
diff --git a/src/Library/Domain/ModelProperty/IModelPropertyRepository.cs b/src/Library/Domain/ModelProperty/IModelPropertyRepository.cs
index 802bfe5..605d00e 100644
--- a/src/Library/Domain/ModelProperty/IModelPropertyRepository.cs
+++ b/src/Library/Domain/ModelProperty/IModelPropertyRepository.cs
@@ -36,11 +36,11 @@ public interface IModelPropertyRepository : IRepository
Task Exists(ModelPropertyEntity entity);
///
- /// 删除指定类的所有属性
+ /// 删除指定模块的所有属性
///
- ///
+ ///
///
///
- Task DeleteByProject(Guid projectId, IUnitOfWork uow);
+ Task DeleteByModule(Guid moduleId, IUnitOfWork uow);
}
}
diff --git a/src/Library/Domain/ModelProperty/ModelPropertyEntity.cs b/src/Library/Domain/ModelProperty/ModelPropertyEntity.cs
index 78190ff..717a178 100644
--- a/src/Library/Domain/ModelProperty/ModelPropertyEntity.cs
+++ b/src/Library/Domain/ModelProperty/ModelPropertyEntity.cs
@@ -9,9 +9,9 @@ namespace NetModular.Module.CodeGenerator.Domain.ModelProperty
public partial class ModelPropertyEntity : EntityBase
{
///
- /// 项目编号
+ /// 模块编号
///
- public Guid ProjectId { get; set; }
+ public Guid ModuleId { get; set; }
///
/// 所属类
diff --git a/src/Library/Domain/Project/IProjectRepository.cs b/src/Library/Domain/Module/IModuleRepository.cs
similarity index 55%
rename from src/Library/Domain/Project/IProjectRepository.cs
rename to src/Library/Domain/Module/IModuleRepository.cs
index 19aa8fb..88a836b 100644
--- a/src/Library/Domain/Project/IProjectRepository.cs
+++ b/src/Library/Domain/Module/IModuleRepository.cs
@@ -1,20 +1,20 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using NetModular.Lib.Data.Abstractions;
-using NetModular.Module.CodeGenerator.Domain.Project.Models;
+using NetModular.Module.CodeGenerator.Domain.Module.Models;
-namespace NetModular.Module.CodeGenerator.Domain.Project
+namespace NetModular.Module.CodeGenerator.Domain.Module
{
///
/// 项目仓储
///
- public interface IProjectRepository : IRepository
+ public interface IModuleRepository : IRepository
{
///
/// 查询
///
///
///
- Task> Query(ProjectQueryModel model);
+ Task> Query(ModuleQueryModel model);
}
}
diff --git a/src/Library/Domain/Project/Models/ProjectQueryModel.cs b/src/Library/Domain/Module/Models/ModuleQueryModel.cs
similarity index 70%
rename from src/Library/Domain/Project/Models/ProjectQueryModel.cs
rename to src/Library/Domain/Module/Models/ModuleQueryModel.cs
index 86cc650..ab6060e 100644
--- a/src/Library/Domain/Project/Models/ProjectQueryModel.cs
+++ b/src/Library/Domain/Module/Models/ModuleQueryModel.cs
@@ -1,8 +1,8 @@
using NetModular.Lib.Data.Query;
-namespace NetModular.Module.CodeGenerator.Domain.Project.Models
+namespace NetModular.Module.CodeGenerator.Domain.Module.Models
{
- public class ProjectQueryModel : QueryModel
+ public class ModuleQueryModel : QueryModel
{
///
/// 名称
diff --git a/src/Library/Domain/Module/ModuleEntity.Extend.cs b/src/Library/Domain/Module/ModuleEntity.Extend.cs
new file mode 100644
index 0000000..c11b72f
--- /dev/null
+++ b/src/Library/Domain/Module/ModuleEntity.Extend.cs
@@ -0,0 +1,7 @@
+namespace NetModular.Module.CodeGenerator.Domain.Module
+{
+ public partial class ModuleEntity
+ {
+
+ }
+}
diff --git a/src/Library/Domain/Module/ModuleEntity.cs b/src/Library/Domain/Module/ModuleEntity.cs
new file mode 100644
index 0000000..75519be
--- /dev/null
+++ b/src/Library/Domain/Module/ModuleEntity.cs
@@ -0,0 +1,62 @@
+using NetModular.Lib.Data.Abstractions.Attributes;
+using NetModular.Lib.Data.Core.Entities.Extend;
+
+namespace NetModular.Module.CodeGenerator.Domain.Module
+{
+ ///
+ /// 模块信息
+ ///
+ [Table("Module")]
+ public partial class ModuleEntity : EntityBaseWithSoftDelete
+ {
+ ///
+ /// 名称
+ ///
+ [Length(100)]
+ public string Name { get; set; }
+
+ ///
+ /// 编号
+ ///
+ public int No { get; set; }
+
+ ///
+ /// 编码
+ ///
+ public string Code { get; set; }
+
+ ///
+ /// 图标
+ ///
+ [Nullable]
+ public string Icon { get; set; }
+
+ ///
+ /// 版权声明
+ ///
+ [Nullable]
+ [Length(200)]
+ public string Copyright { get; set; }
+
+ ///
+ /// 公司单位
+ ///
+ [Nullable]
+ [Length(100)]
+ public string Company { get; set; }
+
+ ///
+ /// 官方地址
+ ///
+ [Nullable]
+ [Length(300)]
+ public string ProjectUrl { get; set; }
+
+ ///
+ /// 仓库地址
+ ///
+ [Nullable]
+ [Length(300)]
+ public string RepositoryUrl { get; set; }
+ }
+}
diff --git a/src/Library/Domain/OnlineModule/IOnlineModuleRepository.cs b/src/Library/Domain/OnlineModule/IOnlineModuleRepository.cs
new file mode 100644
index 0000000..434f1e1
--- /dev/null
+++ b/src/Library/Domain/OnlineModule/IOnlineModuleRepository.cs
@@ -0,0 +1,20 @@
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using NetModular.Lib.Data.Abstractions;
+using NetModular.Module.CodeGenerator.Domain.OnlineModule.Models;
+
+namespace NetModular.Module.CodeGenerator.Domain.OnlineModule
+{
+ ///
+ /// 在线模块仓储
+ ///
+ public interface IOnlineModuleRepository : IRepository
+ {
+ ///
+ /// 查询
+ ///
+ ///
+ ///
+ Task> Query(OnlineModuleQueryModel model);
+ }
+}
diff --git a/src/Library/Domain/OnlineModule/Models/OnlineModuleQueryModel.cs b/src/Library/Domain/OnlineModule/Models/OnlineModuleQueryModel.cs
new file mode 100644
index 0000000..b950356
--- /dev/null
+++ b/src/Library/Domain/OnlineModule/Models/OnlineModuleQueryModel.cs
@@ -0,0 +1,8 @@
+using NetModular.Lib.Data.Query;
+
+namespace NetModular.Module.CodeGenerator.Domain.OnlineModule.Models
+{
+ public class OnlineModuleQueryModel : QueryModel
+ {
+ }
+}
diff --git a/src/Library/Domain/OnlineModule/OnlineModuleEntity.Extend.cs b/src/Library/Domain/OnlineModule/OnlineModuleEntity.Extend.cs
new file mode 100644
index 0000000..853224e
--- /dev/null
+++ b/src/Library/Domain/OnlineModule/OnlineModuleEntity.Extend.cs
@@ -0,0 +1,7 @@
+namespace NetModular.Module.CodeGenerator.Domain.OnlineModule
+{
+ public partial class OnlineModuleEntity
+ {
+
+ }
+}
diff --git a/src/Library/Domain/OnlineModule/OnlineModuleEntity.cs b/src/Library/Domain/OnlineModule/OnlineModuleEntity.cs
new file mode 100644
index 0000000..5636e57
--- /dev/null
+++ b/src/Library/Domain/OnlineModule/OnlineModuleEntity.cs
@@ -0,0 +1,65 @@
+using NetModular.Lib.Data.Abstractions.Attributes;
+using NetModular.Lib.Data.Core.Entities;
+
+namespace NetModular.Module.CodeGenerator.Domain.OnlineModule
+{
+ ///
+ /// 在线模块
+ ///
+ [Table("Online_Module")]
+ public partial class OnlineModuleEntity : Entity
+ {
+ ///
+ /// 名称
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// 编码
+ ///
+ public string Code { get; set; }
+
+ ///
+ /// 图标
+ ///
+ public string Icon { get; set; }
+
+ ///
+ /// 介绍说明
+ ///
+ [Nullable]
+ [Length(500)]
+ public string Description { get; set; }
+
+ ///
+ /// NuGet包ID
+ ///
+ [Length(200)]
+ public string NuGetId { get; set; }
+
+ ///
+ /// NPM包ID
+ ///
+ [Length(200)]
+ public string NpmId { get; set; }
+
+ ///
+ /// 公司名称
+ ///
+ [Length(200)]
+ public string Company { get; set; }
+
+ ///
+ /// 项目地址
+ ///
+ [Length(300)]
+ public string ProjectUrl { get; set; }
+
+ ///
+ /// 仓库地址
+ ///
+ [Length(300)]
+ public string RepositoryUrl { get; set; }
+
+ }
+}
diff --git a/src/Library/Domain/Project/ProjectEntity.Extend.cs b/src/Library/Domain/Project/ProjectEntity.Extend.cs
deleted file mode 100644
index 0fe50d7..0000000
--- a/src/Library/Domain/Project/ProjectEntity.Extend.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace NetModular.Module.CodeGenerator.Domain.Project
-{
- public partial class ProjectEntity
- {
-
- }
-}
diff --git a/src/Library/Domain/Project/ProjectEntity.cs b/src/Library/Domain/Project/ProjectEntity.cs
deleted file mode 100644
index 4af2727..0000000
--- a/src/Library/Domain/Project/ProjectEntity.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using NetModular.Lib.Data.Abstractions.Attributes;
-using NetModular.Lib.Data.Core.Entities.Extend;
-
-namespace NetModular.Module.CodeGenerator.Domain.Project
-{
- ///
- /// 项目
- ///
- [Table("Project")]
- public partial class ProjectEntity : EntityBaseWithSoftDelete
- {
- ///
- /// 名称
- ///
- [Length(100)]
- public string Name { get; set; }
-
- ///
- /// 编号
- ///
- public int No { get; set; }
-
- ///
- /// 编码
- ///
- public string Code { get; set; }
-
- ///
- /// 版权声明
- ///
- [Nullable]
- [Length(200)]
- public string Copyright { get; set; }
- }
-}
diff --git a/src/Library/Domain/Property/IPropertyRepository.cs b/src/Library/Domain/Property/IPropertyRepository.cs
index abf9702..773f009 100644
--- a/src/Library/Domain/Property/IPropertyRepository.cs
+++ b/src/Library/Domain/Property/IPropertyRepository.cs
@@ -48,11 +48,11 @@ public interface IPropertyRepository : IRepository
Task DeleteByClass(Guid classId, IUnitOfWork uow);
///
- /// 删除指定类的所有属性
+ /// 删除指定项目的所有属性
///
- ///
+ ///
///
///
- Task DeleteByProject(Guid projectId, IUnitOfWork uow);
+ Task DeleteByModule(Guid moduleId, IUnitOfWork uow);
}
}
diff --git a/src/Library/Domain/Property/PropertyEntity.cs b/src/Library/Domain/Property/PropertyEntity.cs
index a02d218..12a043f 100644
--- a/src/Library/Domain/Property/PropertyEntity.cs
+++ b/src/Library/Domain/Property/PropertyEntity.cs
@@ -11,9 +11,9 @@ namespace NetModular.Module.CodeGenerator.Domain.Property
public partial class PropertyEntity : EntityBase
{
///
- /// 项目编号
+ /// 模块编号
///
- public Guid ProjectId { get; set; }
+ public Guid ModuleId { get; set; }
///
/// 类编号
diff --git a/src/Library/Infrastructure/BaseEntityPropertyCollection.cs b/src/Library/Infrastructure/BaseEntityPropertyCollection.cs
index f3742aa..13af209 100644
--- a/src/Library/Infrastructure/BaseEntityPropertyCollection.cs
+++ b/src/Library/Infrastructure/BaseEntityPropertyCollection.cs
@@ -109,7 +109,7 @@ private List GetEntityBaseWithSoftDeleteProperties(PropertyType
new PropertyEntity
{
Name = "Id", IsPrimaryKey = true, IsInherit = true, Remarks = "主键", Type = primaryKeyPropertyType,
- ShowInList = true, Length=(primaryKeyPropertyType==PropertyType.String)?50:0
+ ShowInList = true, Length = (primaryKeyPropertyType == PropertyType.String) ? 50 : 0
},
new PropertyEntity
{
@@ -129,15 +129,15 @@ private List GetEntityBaseWithSoftDeleteProperties(PropertyType
},
new PropertyEntity
{
- Name = "Deleted", IsInherit = true, Remarks = "已删除",Type = PropertyType.Bool, Sort = 1004
+ Name = "Deleted", IsInherit = true, Remarks = "已删除", Type = PropertyType.Bool, Sort = 1004
},
new PropertyEntity
{
- Name = "DeletedTime",IsInherit = true, Remarks = "删除时间",Type = PropertyType.DateTime, Sort = 1005
+ Name = "DeletedTime", IsInherit = true, Remarks = "删除时间", Type = PropertyType.DateTime, Sort = 1005
},
new PropertyEntity
{
- Name = "DeletedBy", IsInherit = true, Remarks = "删除人",Type = PropertyType.Guid, Sort = 1006
+ Name = "DeletedBy", IsInherit = true, Remarks = "删除人", Type = PropertyType.Guid, Sort = 1006
}
};
}
diff --git a/src/Library/Infrastructure/CodeGeneratorConfig.cs b/src/Library/Infrastructure/CodeGeneratorConfig.cs
new file mode 100644
index 0000000..8f0ff21
--- /dev/null
+++ b/src/Library/Infrastructure/CodeGeneratorConfig.cs
@@ -0,0 +1,22 @@
+using NetModular.Lib.Config.Abstractions;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure
+{
+ public class CodeGeneratorConfig : IConfig
+ {
+ ///
+ /// 生成代码存储路径
+ ///
+ public string BuildCodePath { get; set; }
+
+ ///
+ /// 模块前缀(后端命名空间)
+ ///
+ public string Prefix { get; set; } = "NetModular";
+
+ ///
+ /// 前端组件前缀
+ ///
+ public string UiPrefix { get; set; } = "Nm";
+ }
+}
diff --git a/src/Library/Infrastructure/Infrastructure.csproj b/src/Library/Infrastructure/Infrastructure.csproj
index 7ffd62f..2c750e1 100644
--- a/src/Library/Infrastructure/Infrastructure.csproj
+++ b/src/Library/Infrastructure/Infrastructure.csproj
@@ -1,668 +1,611 @@
-
- netstandard2.0
-
+
+
+
+
+
+
-
+
+
+
-
-
-
-
+
+
+ TextTemplatingFilePreprocessor
+ AppSettingsDevelopment.cs
+
+
+ TextTemplatingFilePreprocessor
+ AppSettings.cs
+
+
+ TextTemplatingFilePreprocessor
+ LaunchSettings.cs
+
+
+ TextTemplatingFilePreprocessor
+ ModuleServicesConfigurator.cs
+
+
+ PostgreSQLRepository.cs
+ TextTemplatingFilePreprocessor
+
+
+ TextTemplatingFilePreprocessor
+ Entity.cs
+
+
+ TextTemplatingFilePreprocessor
+ Index.cs
+
+
+ TextTemplatingFilePreprocessor
+ PublishScript.cs
+
+
+ TextTemplatingFilePreprocessor
+ ConfigPage.cs
+
+
+ TextTemplatingFilePreprocessor
+ Module.cs
+
+
+ TextTemplatingFilePreprocessor
+ Index.cs
+
+
+ TextTemplatingFilePreprocessor
+ Main.cs
+
+
+ TextTemplatingFilePreprocessor
+ SavePage.cs
+
+
+ TextTemplatingFilePreprocessor
+ Cols.cs
+
+
+ TextTemplatingFilePreprocessor
+ Page.cs
+
+
+ TextTemplatingFilePreprocessor
+ Index.cs
+
+
+ TextTemplatingFilePreprocessor
+ Store.cs
+
+
+ TextTemplatingFilePreprocessor
+ Routes.cs
+
+
+ TextTemplatingFilePreprocessor
+ Config.cs
+
+
+ TextTemplatingFilePreprocessor
+ Components.cs
+
+
+ TextTemplatingFilePreprocessor
+ Browserslistrc.cs
+
+
+ TextTemplatingFilePreprocessor
+ Eslintrc.cs
+
+
+ TextTemplatingFilePreprocessor
+ BabelConfig.cs
+
+
+ TextTemplatingFilePreprocessor
+ Package.cs
+
+
+ TextTemplatingFilePreprocessor
+ PostcssConfig.cs
+
+
+ TextTemplatingFilePreprocessor
+ VueConfig.cs
+
+
+ TextTemplatingFilePreprocessor
+ Gitattributes.cs
+
+
+ TextTemplatingFilePreprocessor
+ Solution.cs
+
+
+ TextTemplatingFilePreprocessor
+ ModuleBuildTargets.cs
+
+
+ TextTemplatingFilePreprocessor
+ Gitignore.cs
+
+
+ TextTemplatingFilePreprocessor
+ Readme.cs
+
+
+ TextTemplatingFilePreprocessor
+ Csproj.cs
+
+
+ TextTemplatingFilePreprocessor
+ Entity.cs
+
+
+ TextTemplatingFilePreprocessor
+ EntityExtend.cs
+
+
+ TextTemplatingFilePreprocessor
+ QueryModel.cs
+
+
+ TextTemplatingFilePreprocessor
+ Repository.cs
+
+
+ TextTemplatingFilePreprocessor
+ EntityEnum.cs
+
+
+ TextTemplatingFilePreprocessor
+ Csproj.cs
+
+
+ TextTemplatingFilePreprocessor
+ DbContext.cs
+
+
+ TextTemplatingFilePreprocessor
+ SqlServerRepository.cs
+
+
+ TextTemplatingFilePreprocessor
+ MySqlRepository.cs
+
+
+ TextTemplatingFilePreprocessor
+ PostgreSQLRepository.cs
+
+
+ TextTemplatingFilePreprocessor
+ SQLiteRepository.cs
+
+
+ TextTemplatingFilePreprocessor
+ Config.cs
+
+
+ TextTemplatingFilePreprocessor
+ Csproj.cs
+
+
+ TextTemplatingFilePreprocessor
+ ServiceInterface.cs
+
+
+ TextTemplatingFilePreprocessor
+ ServiceImpl.cs
+
+
+ TextTemplatingFilePreprocessor
+ AddModel.cs
+
+
+ TextTemplatingFilePreprocessor
+ UpdateModel.cs
+
+
+ TextTemplatingFilePreprocessor
+ MapperConfig.cs
+
+
+ TextTemplatingFilePreprocessor
+ Csproj.cs
+
+
+ TextTemplatingFilePreprocessor
+ ModuleController.cs
+
+
+ TextTemplatingFilePreprocessor
+ ModuleInitializer.cs
+
+
+ TextTemplatingFilePreprocessor
+ Controller.cs
+
+
+ TextTemplatingFilePreprocessor
+ Csproj.cs
+
+
+ TextTemplatingFilePreprocessor
+ Program.cs
+
+
+ TextTemplatingFilePreprocessor
+ DirectoryBuildProps.cs
+
+
+ TextTemplatingFilePreprocessor
+ settings.cs
+
+
+ TextTemplatingFilePreprocessor
+ Index.cs
+
+
+ TextTemplatingFilePreprocessor
+ Prettierrc.cs
+
+
-
-
-
+
+
+
-
-
- TextTemplatingFilePreprocessor
- ModuleOptionsConfigure.cs
-
-
- TextTemplatingFilePreprocessor
- Entity.cs
-
-
- TextTemplatingFilePreprocessor
- Index.cs
-
-
- TextTemplatingFilePreprocessor
- cache.cs
-
-
- TextTemplatingFilePreprocessor
- cacheDevelopment.cs
-
-
- TextTemplatingFilePreprocessor
- PublishScript.cs
-
-
- TextTemplatingFilePreprocessor
- Module.cs
-
-
- TextTemplatingFilePreprocessor
- Index.cs
-
-
- TextTemplatingFilePreprocessor
- Main.cs
-
-
- TextTemplatingFilePreprocessor
- Edit.cs
-
-
- TextTemplatingFilePreprocessor
- Add.cs
-
-
- TextTemplatingFilePreprocessor
- Cols.cs
-
-
- TextTemplatingFilePreprocessor
- Page.cs
-
-
- TextTemplatingFilePreprocessor
- Index.cs
-
-
- TextTemplatingFilePreprocessor
- Store.cs
-
-
- TextTemplatingFilePreprocessor
- Routes.cs
-
-
- TextTemplatingFilePreprocessor
- Config.cs
-
-
- TextTemplatingFilePreprocessor
- Components.cs
-
-
- TextTemplatingFilePreprocessor
- Browserslistrc.cs
-
-
- TextTemplatingFilePreprocessor
- EditorConfig.cs
-
-
- TextTemplatingFilePreprocessor
- Eslintrc.cs
-
-
- TextTemplatingFilePreprocessor
- BabelConfig.cs
-
-
- TextTemplatingFilePreprocessor
- Package.cs
-
-
- TextTemplatingFilePreprocessor
- PostcssConfig.cs
-
-
- TextTemplatingFilePreprocessor
- VueConfig.cs
-
-
- TextTemplatingFilePreprocessor
- Gitattributes.cs
-
-
- TextTemplatingFilePreprocessor
- Solution.cs
-
-
- TextTemplatingFilePreprocessor
- ModuleBuildTargets.cs
-
-
- TextTemplatingFilePreprocessor
- Gitignore.cs
-
-
- TextTemplatingFilePreprocessor
- Readme.cs
-
-
- TextTemplatingFilePreprocessor
- Csproj.cs
-
-
- TextTemplatingFilePreprocessor
- Entity.cs
-
-
- TextTemplatingFilePreprocessor
- EntityExtend.cs
-
-
- TextTemplatingFilePreprocessor
- QueryModel.cs
-
-
- TextTemplatingFilePreprocessor
- Repository.cs
-
-
- TextTemplatingFilePreprocessor
- EntityEnum.cs
-
-
- TextTemplatingFilePreprocessor
- Csproj.cs
-
-
- TextTemplatingFilePreprocessor
- DbContext.cs
-
-
- TextTemplatingFilePreprocessor
- SqlServerRepository.cs
-
-
- TextTemplatingFilePreprocessor
- MySqlRepository.cs
-
-
- TextTemplatingFilePreprocessor
- SQLiteRepository.cs
-
-
- TextTemplatingFilePreprocessor
- Options.cs
-
-
- TextTemplatingFilePreprocessor
- Csproj.cs
-
-
- TextTemplatingFilePreprocessor
- ServiceInterface.cs
-
-
- TextTemplatingFilePreprocessor
- ServiceImpl.cs
-
-
- TextTemplatingFilePreprocessor
- AddModel.cs
-
-
- TextTemplatingFilePreprocessor
- UpdateModel.cs
-
-
- TextTemplatingFilePreprocessor
- MapperConfig.cs
-
-
- TextTemplatingFilePreprocessor
- cache.cs
-
-
- TextTemplatingFilePreprocessor
- cacheDevelopment.cs
-
-
- TextTemplatingFilePreprocessor
- Csproj.cs
-
-
- TextTemplatingFilePreprocessor
- ModuleController.cs
-
-
- TextTemplatingFilePreprocessor
- ModuleInitializer.cs
-
-
- TextTemplatingFilePreprocessor
- Controller.cs
-
-
- TextTemplatingFilePreprocessor
- Csproj.cs
-
-
- TextTemplatingFilePreprocessor
- Program.cs
-
-
- TextTemplatingFilePreprocessor
- Startup.cs
-
-
- TextTemplatingFilePreprocessor
- db.cs
-
-
- TextTemplatingFilePreprocessor
- dbDevelopment.cs
-
-
- TextTemplatingFilePreprocessor
- host.cs
-
-
- TextTemplatingFilePreprocessor
- hostDevelopment.cs
-
-
- TextTemplatingFilePreprocessor
- jwt.cs
-
-
- TextTemplatingFilePreprocessor
- jwtDevelopment.cs
-
-
- TextTemplatingFilePreprocessor
- module.cs
-
-
- TextTemplatingFilePreprocessor
- moduleDevelopment.cs
-
-
- TextTemplatingFilePreprocessor
- logging.cs
-
-
- TextTemplatingFilePreprocessor
- loggingDevelopment.cs
-
-
- TextTemplatingFilePreprocessor
- DirectoryBuildProps.cs
-
-
- TextTemplatingFilePreprocessor
- settings.cs
-
-
- TextTemplatingFilePreprocessor
- Index.cs
-
-
+
+
+ True
+ True
+ AppSettingsDevelopment.tt
+
+
+ True
+ True
+ AppSettings.tt
+
+
+ True
+ True
+ LaunchSettings.tt
+
+
+ True
+ True
+ Config.tt
+
+
+ True
+ True
+ ConfigPage.tt
+
+
+ True
+ True
+ ModuleServicesConfigurator.tt
+
+
+ True
+ True
+ WebBuildTargets.tt
+
+
+ True
+ True
+ Gitignore.tt
+
+
+ True
+ True
+ Readme.tt
+
+
+ True
+ True
+ Solution.tt
+
+
+ True
+ True
+ Gitattributes.tt
+
+
+ True
+ True
+ Csproj.tt
+
+
+ True
+ True
+ Entity.tt
+
+
+ True
+ True
+ QueryModel.tt
+
+
+ True
+ True
+ EntityExtend.tt
+
+
+ True
+ True
+ Repository.tt
+
+
+ True
+ True
+ EntityEnum.tt
+
+
+ True
+ True
+ Csproj.tt
+
+
+ True
+ True
+ DbContext.tt
+
+
+ True
+ True
+ SqlServerRepository.tt
+
+
+ True
+ True
+ MySqlRepository.tt
+
+
+ True
+ True
+ PostgreSQLRepository.tt
+
+
+ True
+ True
+ SQLiteRepository.tt
+
+
+ True
+ True
+ Csproj.tt
+
+
+ True
+ True
+ ServiceInterface.tt
+
+
+ True
+ True
+ ServiceImpl.tt
+
+
+ True
+ True
+ AddModel.tt
+
+
+ True
+ True
+ UpdateModel.tt
+
+
+ True
+ True
+ MapperConfig.tt
+
+
+ True
+ True
+ Csproj.tt
+
+
+ True
+ True
+ ModuleController.tt
+
+
+ True
+ True
+ ModuleInitializer.tt
+
+
+ True
+ True
+ Controller.tt
+
+
+ True
+ True
+ Csproj.tt
+
+
+ True
+ True
+ Program.tt
+
+
+ True
+ True
+ Startup.tt
+
+
+ True
+ True
+ appsettings.tt
+
+
+ True
+ True
+ appsettingsDevelopment.tt
+
+
+ True
+ True
+ DirectoryBuildTargets.tt
+
+
+ True
+ True
+ DirectoryBuildProps.tt
+
+
+ True
+ True
+ settings.tt
+
+
+ True
+ True
+ VueConfig.tt
+
+
+ True
+ True
+ PostcssConfig.tt
+
+
+ True
+ True
+ Package.tt
+
+
+ True
+ True
+ BabelConfig.tt
+
+
+ True
+ True
+ Eslintrc.tt
+
+
+ True
+ True
+ Browserslistrc.tt
+
+
+ True
+ True
+ EntityApi.tt
+
+
+ True
+ True
+ Components.tt
+
+
+ True
+ True
+ Config.tt
+
+
+ True
+ True
+ Routes.tt
+
+
+ True
+ True
+ Store.tt
+
+
+ True
+ True
+ Index.tt
+
+
+ True
+ True
+ Cols.tt
+
+
+ True
+ True
+ Page.tt
+
+
+ True
+ True
+ Module.tt
+
+
+ True
+ True
+ Index.tt
+
+
+ True
+ True
+ Main.tt
+
+
+ True
+ True
+ PublishScript.tt
+
+
+ True
+ True
+ ModuleBuildTargets.tt
+
+
+ True
+ True
+ Index.tt
+
+
+ True
+ True
+ Entity.tt
+
+
+ True
+ True
+ Prettierrc.tt
+
+
+ True
+ True
+ SavePage.tt
+
+
-
-
-
-
-
-
- True
- True
- WebBuildTargets.tt
-
-
- True
- True
- Gitignore.tt
-
-
- True
- True
- Readme.tt
-
-
- True
- True
- Solution.tt
-
-
- True
- True
- Gitattributes.tt
-
-
- True
- True
- Csproj.tt
-
-
- True
- True
- Entity.tt
-
-
- True
- True
- QueryModel.tt
-
-
- True
- True
- EntityExtend.tt
-
-
- True
- True
- Repository.tt
-
-
- True
- True
- EntityEnum.tt
-
-
- True
- True
- Csproj.tt
-
-
- True
- True
- DbContext.tt
-
-
- True
- True
- SqlServerRepository.tt
-
-
- True
- True
- MySqlRepository.tt
-
-
- True
- True
- SQLiteRepository.tt
-
-
- True
- True
- Options.tt
-
-
- True
- True
- Csproj.tt
-
-
- True
- True
- ServiceInterface.tt
-
-
- True
- True
- ServiceImpl.tt
-
-
- True
- True
- AddModel.tt
-
-
- True
- True
- UpdateModel.tt
-
-
- True
- True
- MapperConfig.tt
-
-
- True
- True
- Csproj.tt
-
-
- True
- True
- ModuleController.tt
-
-
- True
- True
- ModuleInitializer.tt
-
-
- True
- True
- Controller.tt
-
-
- True
- True
- Csproj.tt
-
-
- True
- True
- Program.tt
-
-
- True
- True
- Startup.tt
-
-
- True
- True
- appsettings.tt
-
-
- True
- True
- appsettingsDevelopment.tt
-
-
- True
- True
- db.tt
-
-
- True
- True
- dbDevelopment.tt
-
-
- True
- True
- host.tt
-
-
- True
- True
- hostDevelopment.tt
-
-
- True
- True
- jwt.tt
-
-
- True
- True
- jwtDevelopment.tt
-
-
- True
- True
- module.tt
-
-
- True
- True
- moduleDevelopment.tt
-
-
- True
- True
- logging.tt
-
-
- True
- True
- loggingDevelopment.tt
-
-
- True
- True
- DirectoryBuildTargets.tt
-
-
- True
- True
- DirectoryBuildProps.tt
-
-
- True
- True
- settings.tt
-
-
- True
- True
- VueConfig.tt
-
-
- True
- True
- PostcssConfig.tt
-
-
- True
- True
- Package.tt
-
-
- True
- True
- BabelConfig.tt
-
-
- True
- True
- Eslintrc.tt
-
-
- True
- True
- EditorConfig.tt
-
-
- True
- True
- Browserslistrc.tt
-
-
- True
- True
- EntityApi.tt
-
-
- True
- True
- Components.tt
-
-
- True
- True
- Config.tt
-
-
- True
- True
- Routes.tt
-
-
- True
- True
- Store.tt
-
-
- True
- True
- Index.tt
-
-
- True
- True
- Cols.tt
-
-
- True
- True
- Page.tt
-
-
- True
- True
- Add.tt
-
-
- True
- True
- Edit.tt
-
-
- True
- True
- Module.tt
-
-
- True
- True
- Index.tt
-
-
- True
- True
- Main.tt
-
-
- True
- True
- PublishScript.tt
-
-
- True
- True
- cache.tt
-
-
- True
- True
- cacheDevelopment.tt
-
-
- True
- True
- ModuleOptionsConfigure.tt
-
-
- True
- True
- ModuleBuildTargets.tt
-
-
- True
- True
- Index.tt
-
-
- True
- True
- Entity.tt
-
-
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
+ True
+
+
diff --git a/src/Library/Infrastructure/NuGet/NuGetPackageVersions.cs b/src/Library/Infrastructure/NuGet/NuGetPackageVersions.cs
new file mode 100644
index 0000000..d0df9c8
--- /dev/null
+++ b/src/Library/Infrastructure/NuGet/NuGetPackageVersions.cs
@@ -0,0 +1,46 @@
+namespace NetModular.Module.CodeGenerator.Infrastructure.NuGet
+{
+ ///
+ /// Nuget包版本信息
+ ///
+ public class NuGetPackageVersions
+ {
+ public string Lib_Utils_Core { get; set; }
+
+ public string Lib_Utils_Mvc { get; set; }
+
+ public string Lib_Data_Core { get; set; }
+
+ public string Lib_Data_Query { get; set; }
+
+ public string Lib_Data_MySql { get; set; }
+
+ public string Lib_Data_SQLite { get; set; }
+
+ public string Lib_Data_SqlServer { get; set; }
+
+ public string Lib_Config_Abstractions { get; set; }
+
+ public string Lib_Mapper_AutoMapper { get; set; }
+
+ public string Lib_Auth_Web { get; set; }
+
+ public string Lib_Module_Abstractions { get; set; }
+
+ public string Lib_Module_AspNetCore { get; set; }
+
+ public string Lib_Validation_FluentValidation { get; set; }
+
+ public string Lib_Cache_MemoryCache { get; set; }
+
+ public string Lib_Excel_EPPlus { get; set; }
+
+ public string Lib_Host_Web { get; set; }
+
+ public string Module_Admin_Domain { get; set; }
+
+ public string Module_Admin_Web { get; set; }
+
+ public string Lib_OSS_Local { get; set; }
+ }
+}
diff --git a/src/Library/Infrastructure/NuGet/NugetHelper.cs b/src/Library/Infrastructure/NuGet/NugetHelper.cs
new file mode 100644
index 0000000..f4377cc
--- /dev/null
+++ b/src/Library/Infrastructure/NuGet/NugetHelper.cs
@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Http;
+using System.Reflection;
+using System.Threading.Tasks;
+using NetModular.Lib.Config.Abstractions;
+using NetModular.Lib.Utils.Core.Attributes;
+using Newtonsoft.Json;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.NuGet
+{
+ ///
+ /// NuGet帮助类
+ ///
+ [Singleton]
+ public class NuGetHelper
+ {
+ private const string QueryUrl = "https://azuresearch-usnc.nuget.org/query?q={0}&take=1";
+ private readonly Dictionary _infos = new Dictionary();
+ private readonly HttpClient _client;
+ private NuGetPackageVersions _versions;
+ private DateTime _lastSearchTime = DateTime.Now;
+
+ public NuGetHelper(IConfigProvider configProvider, IHttpClientFactory clientFactory)
+ {
+ _client = clientFactory.CreateClient();
+ var config = configProvider.Get();
+ var properties = typeof(NuGetPackageVersions).GetProperties();
+ foreach (var propertyInfo in properties)
+ {
+ var name = $"{config.Prefix}.{propertyInfo.Name.Replace("_", ".")}";
+ _infos.Add(name, propertyInfo);
+ }
+ }
+
+ ///
+ /// 获取最新包版本信息
+ ///
+ ///
+ public NuGetPackageVersions GetVersions()
+ {
+ //加个缓存机制,2小时
+ if (_lastSearchTime.AddHours(2) > DateTime.Now && _versions != null)
+ return _versions;
+
+ _versions = new NuGetPackageVersions();
+ var tasks = new Dictionary>();
+ foreach (var info in _infos)
+ {
+ tasks.Add(info.Value, GetVersion(info.Key));
+ }
+
+ Task.WaitAll(tasks.Values.ToArray());
+
+ foreach (var task in tasks)
+ {
+ task.Key.SetValue(_versions, task.Value.Result);
+ }
+
+ return _versions;
+ }
+
+ ///
+ /// 查询指定包ID的最新版本号
+ ///
+ ///
+ ///
+ public async Task GetVersion(string packageId)
+ {
+ var url = string.Format(QueryUrl, packageId);
+ var jsonStr = await _client.GetStringAsync(url);
+ if (jsonStr.NotNull())
+ {
+ var model = JsonConvert.DeserializeAnonymousType(jsonStr, new
+ {
+ data = new[]
+ {
+ new
+ {
+ Version = ""
+ }
+ }
+ });
+
+ if (model != null && model.data != null && model.data.Length > 0)
+ {
+ return model.data[0].Version;
+ }
+ }
+
+ return "";
+ }
+ }
+}
diff --git a/src/Library/Infrastructure/Options/CodeGeneratorOptions.cs b/src/Library/Infrastructure/Options/CodeGeneratorOptions.cs
deleted file mode 100644
index d12f590..0000000
--- a/src/Library/Infrastructure/Options/CodeGeneratorOptions.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.IO;
-
-namespace NetModular.Module.CodeGenerator.Infrastructure.Options
-{
- public class CodeGeneratorOptions
- {
- public CodeGeneratorOptions()
- {
- BuildCodePath = Path.Combine("CodeGenerator", "BuildCode");
- }
-
- ///
- /// 生成代码路径(相对于临时目录的路径)
- ///
- public string BuildCodePath { get; set; }
-
- ///
- /// 前缀
- ///
- public string Prefix { get; set; }
- }
-}
diff --git a/src/Library/Infrastructure/Options/ModuleOptionsConfigure.cs b/src/Library/Infrastructure/Options/ModuleOptionsConfigure.cs
deleted file mode 100644
index 98142c8..0000000
--- a/src/Library/Infrastructure/Options/ModuleOptionsConfigure.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using NetModular.Lib.Utils.Core.Options;
-
-namespace NetModular.Module.CodeGenerator.Infrastructure.Options
-{
- public class ModuleOptionsConfigure : IModuleOptionsConfigure
- {
- public void ConfigOptions(IServiceCollection services, IConfiguration configuration)
- {
- services.Configure(configuration);
- }
- }
-}
diff --git a/src/Library/Infrastructure/Repositories/CodeGeneratorDbContext.cs b/src/Library/Infrastructure/Repositories/CodeGeneratorDbContext.cs
index ee7805c..e5571df 100644
--- a/src/Library/Infrastructure/Repositories/CodeGeneratorDbContext.cs
+++ b/src/Library/Infrastructure/Repositories/CodeGeneratorDbContext.cs
@@ -1,12 +1,11 @@
-using System;
-using NetModular.Lib.Data.Abstractions;
+using NetModular.Lib.Data.Abstractions;
using NetModular.Lib.Data.Core;
namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories
{
public class CodeGeneratorDbContext : DbContext
{
- public CodeGeneratorDbContext(IDbContextOptions options, IServiceProvider serviceProvider) : base(options, serviceProvider)
+ public CodeGeneratorDbContext(IDbContextOptions options) : base(options)
{
}
}
diff --git a/src/Library/Infrastructure/Repositories/MySql/ProjectRepository.cs b/src/Library/Infrastructure/Repositories/MySql/ModuleRepository.cs
similarity index 53%
rename from src/Library/Infrastructure/Repositories/MySql/ProjectRepository.cs
rename to src/Library/Infrastructure/Repositories/MySql/ModuleRepository.cs
index 92fbaca..7a0f37c 100644
--- a/src/Library/Infrastructure/Repositories/MySql/ProjectRepository.cs
+++ b/src/Library/Infrastructure/Repositories/MySql/ModuleRepository.cs
@@ -2,9 +2,9 @@
namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories.MySql
{
- public class ProjectRepository : SqlServer.ProjectRepository
+ public class ModuleRepository : SqlServer.ModuleRepository
{
- public ProjectRepository(IDbContext context) : base(context)
+ public ModuleRepository(IDbContext context) : base(context)
{
}
}
diff --git a/src/Library/Infrastructure/Repositories/MySql/OnlineModuleRepository.cs b/src/Library/Infrastructure/Repositories/MySql/OnlineModuleRepository.cs
new file mode 100644
index 0000000..ed756b3
--- /dev/null
+++ b/src/Library/Infrastructure/Repositories/MySql/OnlineModuleRepository.cs
@@ -0,0 +1,11 @@
+using NetModular.Lib.Data.Abstractions;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories.MySql
+{
+ public class OnlineModuleRepository : SqlServer.OnlineModuleRepository
+ {
+ public OnlineModuleRepository(IDbContext dbContext) : base(dbContext)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Repositories/PostgreSQL/ClassMethodRepository.cs b/src/Library/Infrastructure/Repositories/PostgreSQL/ClassMethodRepository.cs
new file mode 100644
index 0000000..01a6301
--- /dev/null
+++ b/src/Library/Infrastructure/Repositories/PostgreSQL/ClassMethodRepository.cs
@@ -0,0 +1,11 @@
+using NetModular.Lib.Data.Abstractions;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories.PostgreSQL
+{
+ public class ClassMethodRepository : SqlServer.ClassMethodRepository
+ {
+ public ClassMethodRepository(IDbContext context) : base(context)
+ {
+ }
+ }
+}
diff --git a/src/Library/Infrastructure/Repositories/PostgreSQL/ClassRepository.cs b/src/Library/Infrastructure/Repositories/PostgreSQL/ClassRepository.cs
new file mode 100644
index 0000000..db58f20
--- /dev/null
+++ b/src/Library/Infrastructure/Repositories/PostgreSQL/ClassRepository.cs
@@ -0,0 +1,11 @@
+using NetModular.Lib.Data.Abstractions;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories.PostgreSQL
+{
+ public class ClassRepository : SqlServer.ClassRepository
+ {
+ public ClassRepository(IDbContext context) : base(context)
+ {
+ }
+ }
+}
diff --git a/src/Library/Infrastructure/Repositories/PostgreSQL/EnumItemRepository.cs b/src/Library/Infrastructure/Repositories/PostgreSQL/EnumItemRepository.cs
new file mode 100644
index 0000000..5bfe250
--- /dev/null
+++ b/src/Library/Infrastructure/Repositories/PostgreSQL/EnumItemRepository.cs
@@ -0,0 +1,11 @@
+using NetModular.Lib.Data.Abstractions;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories.PostgreSQL
+{
+ public class EnumItemRepository : SqlServer.EnumItemRepository
+ {
+ public EnumItemRepository(IDbContext context) : base(context)
+ {
+ }
+ }
+}
diff --git a/src/Library/Infrastructure/Repositories/PostgreSQL/EnumRepository.cs b/src/Library/Infrastructure/Repositories/PostgreSQL/EnumRepository.cs
new file mode 100644
index 0000000..39b1887
--- /dev/null
+++ b/src/Library/Infrastructure/Repositories/PostgreSQL/EnumRepository.cs
@@ -0,0 +1,11 @@
+using NetModular.Lib.Data.Abstractions;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories.PostgreSQL
+{
+ public class EnumRepository : SqlServer.EnumRepository
+ {
+ public EnumRepository(IDbContext context) : base(context)
+ {
+ }
+ }
+}
diff --git a/src/Library/Infrastructure/Repositories/PostgreSQL/ModelPropertyRepository.cs b/src/Library/Infrastructure/Repositories/PostgreSQL/ModelPropertyRepository.cs
new file mode 100644
index 0000000..c739b6f
--- /dev/null
+++ b/src/Library/Infrastructure/Repositories/PostgreSQL/ModelPropertyRepository.cs
@@ -0,0 +1,11 @@
+using NetModular.Lib.Data.Abstractions;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories.PostgreSQL
+{
+ public class ModelPropertyRepository : SqlServer.ModelPropertyRepository
+ {
+ public ModelPropertyRepository(IDbContext context) : base(context)
+ {
+ }
+ }
+}
diff --git a/src/Library/Infrastructure/Repositories/PostgreSQL/ModuleRepository.cs b/src/Library/Infrastructure/Repositories/PostgreSQL/ModuleRepository.cs
new file mode 100644
index 0000000..c840d30
--- /dev/null
+++ b/src/Library/Infrastructure/Repositories/PostgreSQL/ModuleRepository.cs
@@ -0,0 +1,11 @@
+using NetModular.Lib.Data.Abstractions;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories.PostgreSQL
+{
+ public class ModuleRepository : SqlServer.ModuleRepository
+ {
+ public ModuleRepository(IDbContext context) : base(context)
+ {
+ }
+ }
+}
diff --git a/src/Library/Infrastructure/Repositories/PostgreSQL/OnlineModuleRepository.cs b/src/Library/Infrastructure/Repositories/PostgreSQL/OnlineModuleRepository.cs
new file mode 100644
index 0000000..f2a9924
--- /dev/null
+++ b/src/Library/Infrastructure/Repositories/PostgreSQL/OnlineModuleRepository.cs
@@ -0,0 +1,11 @@
+using NetModular.Lib.Data.Abstractions;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories.PostgreSQL
+{
+ public class OnlineModuleRepository : SqlServer.OnlineModuleRepository
+ {
+ public OnlineModuleRepository(IDbContext dbContext) : base(dbContext)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Repositories/PostgreSQL/PropertyRepository.cs b/src/Library/Infrastructure/Repositories/PostgreSQL/PropertyRepository.cs
new file mode 100644
index 0000000..cb45e79
--- /dev/null
+++ b/src/Library/Infrastructure/Repositories/PostgreSQL/PropertyRepository.cs
@@ -0,0 +1,11 @@
+using NetModular.Lib.Data.Abstractions;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories.PostgreSQL
+{
+ public class PropertyRepository : SqlServer.PropertyRepository
+ {
+ public PropertyRepository(IDbContext context) : base(context)
+ {
+ }
+ }
+}
diff --git a/src/Library/Infrastructure/Repositories/SQLite/ProjectRepository.cs b/src/Library/Infrastructure/Repositories/SQLite/ModuleRepository.cs
similarity index 53%
rename from src/Library/Infrastructure/Repositories/SQLite/ProjectRepository.cs
rename to src/Library/Infrastructure/Repositories/SQLite/ModuleRepository.cs
index b2fbd87..284b7bd 100644
--- a/src/Library/Infrastructure/Repositories/SQLite/ProjectRepository.cs
+++ b/src/Library/Infrastructure/Repositories/SQLite/ModuleRepository.cs
@@ -2,9 +2,9 @@
namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories.SQLite
{
- public class ProjectRepository : SqlServer.ProjectRepository
+ public class ModuleRepository : SqlServer.ModuleRepository
{
- public ProjectRepository(IDbContext context) : base(context)
+ public ModuleRepository(IDbContext context) : base(context)
{
}
}
diff --git a/src/Library/Infrastructure/Repositories/SQLite/OnlineModuleRepository.cs b/src/Library/Infrastructure/Repositories/SQLite/OnlineModuleRepository.cs
new file mode 100644
index 0000000..b4ac4f2
--- /dev/null
+++ b/src/Library/Infrastructure/Repositories/SQLite/OnlineModuleRepository.cs
@@ -0,0 +1,11 @@
+using NetModular.Lib.Data.Abstractions;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories.SQLite
+{
+ public class OnlineModuleRepository : SqlServer.OnlineModuleRepository
+ {
+ public OnlineModuleRepository(IDbContext dbContext) : base(dbContext)
+ {
+ }
+ }
+}
diff --git a/src/Library/Infrastructure/Repositories/SqlServer/ClassRepository.cs b/src/Library/Infrastructure/Repositories/SqlServer/ClassRepository.cs
index 2ef2624..be65937 100644
--- a/src/Library/Infrastructure/Repositories/SqlServer/ClassRepository.cs
+++ b/src/Library/Infrastructure/Repositories/SqlServer/ClassRepository.cs
@@ -20,7 +20,7 @@ public ClassRepository(IDbContext context) : base(context)
public async Task> Query(ClassQueryModel model)
{
var paging = model.Paging();
- var query = Db.Find(m => m.ProjectId == model.ProjectId);
+ var query = Db.Find(m => m.ModuleId == model.ModuleId);
query.WhereNotNull(model.Name, m => m.Name.Contains(model.Name) || m.Remarks.Contains(model.Name));
var joinQuery = query.LeftJoin((x, y) => x.CreatedBy == y.Id);
@@ -37,21 +37,21 @@ public async Task> Query(ClassQueryModel model)
return list;
}
- public Task> QueryAllByProject(Guid projectId)
+ public Task> QueryAllByModule(Guid moduleId)
{
- return Db.Find(m => m.ProjectId == projectId).ToListAsync();
+ return Db.Find(m => m.ModuleId == moduleId).ToListAsync();
}
public Task Exists(ClassEntity entity)
{
- return Db.Find(m => m.ProjectId == entity.ProjectId && m.Name.Equals(entity.Name))
+ return Db.Find(m => m.ModuleId == entity.ModuleId && m.Name.Equals(entity.Name))
.WhereNotEmpty(entity.Id, m => m.Id != entity.Id)
.ExistsAsync();
}
- public Task DeleteByProject(Guid projectId, IUnitOfWork uow)
+ public Task DeleteByModule(Guid moduleId, IUnitOfWork uow)
{
- return Db.Find(m => m.ProjectId == projectId).UseUow(uow).DeleteAsync();
+ return Db.Find(m => m.ModuleId == moduleId).UseUow(uow).DeleteAsync();
}
}
}
diff --git a/src/Library/Infrastructure/Repositories/SqlServer/ModelPropertyRepository.cs b/src/Library/Infrastructure/Repositories/SqlServer/ModelPropertyRepository.cs
index be14225..a0ca4fb 100644
--- a/src/Library/Infrastructure/Repositories/SqlServer/ModelPropertyRepository.cs
+++ b/src/Library/Infrastructure/Repositories/SqlServer/ModelPropertyRepository.cs
@@ -55,9 +55,9 @@ public Task Exists(ModelPropertyEntity entity)
return query.ExistsAsync();
}
- public Task DeleteByProject(Guid projectId, IUnitOfWork uow)
+ public Task DeleteByModule(Guid moduleId, IUnitOfWork uow)
{
- return Db.Find(m => m.ProjectId == projectId).UseUow(uow).DeleteAsync();
+ return Db.Find(m => m.ModuleId == moduleId).UseUow(uow).DeleteAsync();
}
}
}
diff --git a/src/Library/Infrastructure/Repositories/SqlServer/ProjectRepository.cs b/src/Library/Infrastructure/Repositories/SqlServer/ModuleRepository.cs
similarity index 74%
rename from src/Library/Infrastructure/Repositories/SqlServer/ProjectRepository.cs
rename to src/Library/Infrastructure/Repositories/SqlServer/ModuleRepository.cs
index ddaf689..781e2c5 100644
--- a/src/Library/Infrastructure/Repositories/SqlServer/ProjectRepository.cs
+++ b/src/Library/Infrastructure/Repositories/SqlServer/ModuleRepository.cs
@@ -5,18 +5,18 @@
using NetModular.Lib.Data.Core;
using NetModular.Lib.Data.Query;
using NetModular.Module.Admin.Domain.Account;
-using NetModular.Module.CodeGenerator.Domain.Project;
-using NetModular.Module.CodeGenerator.Domain.Project.Models;
+using NetModular.Module.CodeGenerator.Domain.Module;
+using NetModular.Module.CodeGenerator.Domain.Module.Models;
namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories.SqlServer
{
- public class ProjectRepository : RepositoryAbstract, IProjectRepository
+ public class ModuleRepository : RepositoryAbstract, IModuleRepository
{
- public ProjectRepository(IDbContext context) : base(context)
+ public ModuleRepository(IDbContext context) : base(context)
{
}
- public async Task> Query(ProjectQueryModel model)
+ public async Task> Query(ModuleQueryModel model)
{
var paging = model.Paging();
diff --git a/src/Library/Infrastructure/Repositories/SqlServer/OnlineModuleRepository.cs b/src/Library/Infrastructure/Repositories/SqlServer/OnlineModuleRepository.cs
new file mode 100644
index 0000000..12fac92
--- /dev/null
+++ b/src/Library/Infrastructure/Repositories/SqlServer/OnlineModuleRepository.cs
@@ -0,0 +1,36 @@
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using NetModular.Lib.Data.Abstractions;
+using NetModular.Lib.Data.Core;
+using NetModular.Lib.Data.Query;
+using NetModular.Module.CodeGenerator.Domain.OnlineModule;
+using NetModular.Module.CodeGenerator.Domain.OnlineModule.Models;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.Repositories.SqlServer
+{
+ public class OnlineModuleRepository : RepositoryAbstract, IOnlineModuleRepository
+ {
+ public OnlineModuleRepository(IDbContext context) : base(context)
+ {
+ }
+
+ public async Task> Query(OnlineModuleQueryModel model)
+ {
+ var paging = model.Paging();
+
+ var query = Db.Find();
+
+ if (!paging.OrderBy.Any())
+ {
+ query.OrderByDescending(m => m.Id);
+ }
+
+ var result = await query.PaginationAsync(paging);
+
+ model.TotalCount = paging.TotalCount;
+
+ return result;
+ }
+ }
+}
diff --git a/src/Library/Infrastructure/Repositories/SqlServer/PropertyRepository.cs b/src/Library/Infrastructure/Repositories/SqlServer/PropertyRepository.cs
index d763ef4..ffd5bc1 100644
--- a/src/Library/Infrastructure/Repositories/SqlServer/PropertyRepository.cs
+++ b/src/Library/Infrastructure/Repositories/SqlServer/PropertyRepository.cs
@@ -62,9 +62,9 @@ public Task DeleteByClass(Guid classId, IUnitOfWork uow)
return Db.Find(m => m.ClassId == classId).UseUow(uow).DeleteAsync();
}
- public Task DeleteByProject(Guid projectId, IUnitOfWork uow)
+ public Task DeleteByModule(Guid moduleId, IUnitOfWork uow)
{
- return Db.Find(m => m.ProjectId == projectId).UseUow(uow).DeleteAsync();
+ return Db.Find(m => m.ModuleId == moduleId).UseUow(uow).DeleteAsync();
}
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/DefaultTemplateBuilder.cs b/src/Library/Infrastructure/Templates/Default/DefaultTemplateBuilder.cs
index 140cb7f..3479dec 100644
--- a/src/Library/Infrastructure/Templates/Default/DefaultTemplateBuilder.cs
+++ b/src/Library/Infrastructure/Templates/Default/DefaultTemplateBuilder.cs
@@ -1,6 +1,4 @@
-using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default
{
public class DefaultTemplateBuilder : TemplateBuilderAbstract
{
@@ -8,10 +6,5 @@ public DefaultTemplateBuilder() : base("Default")
{
}
-
- public override void Build(TemplateBuildModel model)
- {
- base.Build(model);
- }
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/Gitattributes.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/Gitattributes.Extend.cs
index 1b767c6..41ccd37 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/Gitattributes.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/Gitattributes.Extend.cs
@@ -12,10 +12,12 @@ public Gitattributes(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
var content = TransformText();
- var filePath = Path.Combine(_model.RootPath, _model.Project.Code, ".gitattributes");
+ var filePath = Path.Combine(_model.RootPath, ".gitattributes");
File.WriteAllText(filePath, content);
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/Gitattributes.cs b/src/Library/Infrastructure/Templates/Default/T4/Gitattributes.cs
index 599d771..58c7cb4 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/Gitattributes.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/Gitattributes.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\Gitattributes.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\Gitattributes.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Gitattributes : GitattributesBase
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/Gitignore.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/Gitignore.Extend.cs
index 62592df..a5724dc 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/Gitignore.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/Gitignore.Extend.cs
@@ -12,10 +12,12 @@ public Gitignore(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
var content = TransformText();
- var filePath = Path.Combine(_model.RootPath, _model.Project.Code, ".gitignore");
+ var filePath = Path.Combine(_model.RootPath, ".gitignore");
File.WriteAllText(filePath, content);
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/Gitignore.cs b/src/Library/Infrastructure/Templates/Default/T4/Gitignore.cs
index a213dc7..07ec56a 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/Gitignore.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/Gitignore.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\Gitignore.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\Gitignore.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Gitignore : GitignoreBase
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/Readme.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/Readme.Extend.cs
index 09c6270..98712be 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/Readme.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/Readme.Extend.cs
@@ -12,10 +12,12 @@ public Readme(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
var content = TransformText();
- var filePath = Path.Combine(_model.RootPath, _model.Project.Code, "README.md");
+ var filePath = Path.Combine(_model.RootPath, "README.md");
File.WriteAllText(filePath, content);
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/Readme.cs b/src/Library/Infrastructure/Templates/Default/T4/Readme.cs
index f0c5849..0e3538d 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/Readme.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/Readme.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\Readme.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\Readme.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Readme : ReadmeBase
{
@@ -27,8 +27,8 @@ public virtual string TransformText()
{
this.Write("## ");
- #line 2 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\Readme.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Name));
+ #line 2 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\Readme.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Name));
#line default
#line hidden
diff --git a/src/Library/Infrastructure/Templates/Default/T4/Readme.tt b/src/Library/Infrastructure/Templates/Default/T4/Readme.tt
index f4b7986..f5e6d5c 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/Readme.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/Readme.tt
@@ -1,4 +1,4 @@
<#@ template language="C#" #>
-## <#= _model.Project.Name #>
+## <#= _model.Module.Name #>
### 配置项
diff --git a/src/Library/Infrastructure/Templates/Default/T4/Solution.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/Solution.Extend.cs
index 0d319c8..a30e307 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/Solution.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/Solution.Extend.cs
@@ -12,15 +12,17 @@ public Solution(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
var content = TransformText();
- var dir = Path.Combine(_model.RootPath, _model.Project.Code);
+ var dir = Path.Combine(_model.RootPath);
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
- var filePath = Path.Combine(dir, _model.Project.Code + ".sln");
+ var filePath = Path.Combine(dir, _model.Module.Code + ".sln");
File.WriteAllText(filePath, content);
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/Solution.cs b/src/Library/Infrastructure/Templates/Default/T4/Solution.cs
index 59ed175..447d4bc 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/Solution.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/Solution.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\Solution.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\Solution.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Solution : SolutionBase
{
@@ -27,21 +27,21 @@ public virtual string TransformText()
{
this.Write("Microsoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio Vers" +
"ion 16\r\nVisualStudioVersion = 16.0.28803.156\r\nMinimumVisualStudioVersion = 10.0." +
- "40219.1\r\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"src\", \"src\", \"{B4D" +
- "3AF99-D551-4B7A-82F3-CE0950FCAA08}\"\r\nEndProject\r\nProject(\"{2150E333-8FDC-42A3-94" +
- "74-1A3956D46DE8}\") = \"build\", \"build\", \"{9C10C55A-E7D4-45D0-B23D-39BE8BF8DE4A}\"\r" +
- "\n\tProjectSection(SolutionItems) = preProject\r\n\t\tsrc\\Directory.Build.props = src\\" +
- "Directory.Build.props\r\n\t\tbuild\\module.build.targets = build\\module.build.targets" +
- "\r\n\tEndProjectSection\r\nEndProject\r\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8" +
- "}\") = \"Library\", \"Library\", \"{E58182FC-0950-453F-8C3A-ABCB477C8A28}\"\r\nEndProject" +
- "\r\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Domain\", \"src\\Library\\Dom" +
- "ain\\Domain.csproj\", \"{851F1CBB-A081-40C7-844F-842E0FAE0DF0}\"\r\nEndProject\r\nProjec" +
- "t(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Infrastructure\", \"src\\Library\\Inf" +
- "rastructure\\Infrastructure.csproj\", \"{2277E74A-AE69-4392-A173-8ED4BD6EB11E}\"\r\nEn" +
- "dProject\r\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Web\", \"src\\Web\\We" +
- "b.csproj\", \"{C2D01E40-4038-4527-9AAF-323359CD5CF0}\"\r\nEndProject\r\nProject(\"{9A191" +
- "03F-16F7-4668-BE54-9A1E7A4F7556}\") = \"WebHost\", \"src\\WebHost\\WebHost.csproj\", \"{" +
- "CEAE0B43-438D-4778-BF3A-8665246EF718}\"\r\nEndProject\r\nProject(\"{9A19103F-16F7-4668" +
+ "40219.1\r\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"WebHost\", \"src\\Web" +
+ "Host\\WebHost.csproj\", \"{CEAE0B43-438D-4778-BF3A-8665246EF718}\"\r\nEndProject\r\nProj" +
+ "ect(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"src\", \"src\", \"{B4D3AF99-D551-4B" +
+ "7A-82F3-CE0950FCAA08}\"\r\nEndProject\r\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46D" +
+ "E8}\") = \"build\", \"build\", \"{9C10C55A-E7D4-45D0-B23D-39BE8BF8DE4A}\"\r\n\tProjectSect" +
+ "ion(SolutionItems) = preProject\r\n\t\tsrc\\Directory.Build.props = src\\Directory.Bui" +
+ "ld.props\r\n\t\tbuild\\module.build.targets = build\\module.build.targets\r\n\tEndProject" +
+ "Section\r\nEndProject\r\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Librar" +
+ "y\", \"Library\", \"{E58182FC-0950-453F-8C3A-ABCB477C8A28}\"\r\nEndProject\r\nProject(\"{9" +
+ "A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Domain\", \"src\\Library\\Domain\\Domain.cs" +
+ "proj\", \"{851F1CBB-A081-40C7-844F-842E0FAE0DF0}\"\r\nEndProject\r\nProject(\"{9A19103F-" +
+ "16F7-4668-BE54-9A1E7A4F7556}\") = \"Infrastructure\", \"src\\Library\\Infrastructure\\I" +
+ "nfrastructure.csproj\", \"{2277E74A-AE69-4392-A173-8ED4BD6EB11E}\"\r\nEndProject\r\nPro" +
+ "ject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"Web\", \"src\\Web\\Web.csproj\", \"{" +
+ "C2D01E40-4038-4527-9AAF-323359CD5CF0}\"\r\nEndProject\r\nProject(\"{9A19103F-16F7-4668" +
"-BE54-9A1E7A4F7556}\") = \"Application\", \"src\\Library\\Application\\Application.cspr" +
"oj\", \"{792B8CBF-AB02-4A87-AB5E-A6CB8E9DE39C}\"\r\nEndProject\r\nProject(\"{2150E333-8F" +
"DC-42A3-9474-1A3956D46DE8}\") = \"Solution Items\", \"Solution Items\", \"{9BD68FC4-FD" +
diff --git a/src/Library/Infrastructure/Templates/Default/T4/Solution.tt b/src/Library/Infrastructure/Templates/Default/T4/Solution.tt
index 82a5172..78f866b 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/Solution.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/Solution.tt
@@ -3,6 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.156
MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebHost", "src\WebHost\WebHost.csproj", "{CEAE0B43-438D-4778-BF3A-8665246EF718}"
+EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B4D3AF99-D551-4B7A-82F3-CE0950FCAA08}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{9C10C55A-E7D4-45D0-B23D-39BE8BF8DE4A}"
@@ -19,8 +21,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Infrastructure", "src\Libra
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Web", "src\Web\Web.csproj", "{C2D01E40-4038-4527-9AAF-323359CD5CF0}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebHost", "src\WebHost\WebHost.csproj", "{CEAE0B43-438D-4778-BF3A-8665246EF718}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Application", "src\Library\Application\Application.csproj", "{792B8CBF-AB02-4A87-AB5E-A6CB8E9DE39C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9BD68FC4-FDB1-42F6-892A-0E752711A5BF}"
diff --git a/src/Library/Infrastructure/Templates/Default/T4/build/ModuleBuildTargets.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/build/ModuleBuildTargets.Extend.cs
index 3d10c22..7da2cf3 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/build/ModuleBuildTargets.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/build/ModuleBuildTargets.Extend.cs
@@ -12,9 +12,11 @@ public ModuleBuildTargets(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "build");
+ var dir = Path.Combine(_model.RootPath, "build");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/build/ModuleBuildTargets.cs b/src/Library/Infrastructure/Templates/Default/T4/build/ModuleBuildTargets.cs
index af8b0be..6b57b95 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/build/ModuleBuildTargets.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/build/ModuleBuildTargets.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.bu
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\build\ModuleBuildTargets.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\build\ModuleBuildTargets.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class ModuleBuildTargets : ModuleBuildTargetsBase
{
@@ -27,30 +27,21 @@ public virtual string TransformText()
{
this.Write(@"
-
- _modules\$(Id)
- $(ModulesDir)\_module.json
- {""Id"": ""$(Id)"",""Name"":""$(Name)"",""Version"":""$(Version)""}
-
+
+ _modules\$(Id)_$(Code)
+ $(ModulesDir)\_module.json
+ {""Id"": ""$(Id)"",""Name"":""$(Name)"",""Code"":""$(Code)"",""Icon"":""$(Icon)"",""Version"":""$(Version)"",""Description"":""$(Description)""}
+
-
-
-
-
+
-
-
-
+
+
-
+
+
-
-
-
-
-
-
-
+
");
return this.GenerationEnvironment.ToString();
diff --git a/src/Library/Infrastructure/Templates/Default/T4/build/ModuleBuildTargets.tt b/src/Library/Infrastructure/Templates/Default/T4/build/ModuleBuildTargets.tt
index bfe780e..4cd5729 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/build/ModuleBuildTargets.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/build/ModuleBuildTargets.tt
@@ -1,28 +1,19 @@
-
- _modules\$(Id)
- $(ModulesDir)\_module.json
- {"Id": "$(Id)","Name":"$(Name)","Version":"$(Version)"}
-
+
+ _modules\$(Id)_$(Code)
+ $(ModulesDir)\_module.json
+ {"Id": "$(Id)","Name":"$(Name)","Code":"$(Code)","Icon":"$(Icon)","Version":"$(Version)","Description":"$(Description)"}
+
-
-
-
-
+
-
-
-
+
+
-
+
+
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/DirectoryBuildProps.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/DirectoryBuildProps.Extend.cs
index 7c3488b..0c91940 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/DirectoryBuildProps.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/DirectoryBuildProps.Extend.cs
@@ -7,16 +7,26 @@ public partial class DirectoryBuildProps : ITemplateHandler
{
private readonly TemplateBuildModel _model;
private readonly string _prefix;
+ private readonly string _company;
+ private readonly string _copyright;
+ private readonly string _projectUrl;
+ private readonly string _repositoryUrl;
public DirectoryBuildProps(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
+ _company = model.Module.Company ?? "";
+ _copyright = model.Module.Copyright ?? "";
+ _projectUrl = model.Module.ProjectUrl ?? "";
+ _repositoryUrl = model.Module.RepositoryUrl ?? "";
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src");
+ var dir = Path.Combine(_model.RootPath, "src");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/DirectoryBuildProps.cs b/src/Library/Infrastructure/Templates/Default/T4/src/DirectoryBuildProps.cs
index 67c35dc..4a2685b 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/DirectoryBuildProps.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/DirectoryBuildProps.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
//
// 此代码由工具生成。
-// 运行时版本: 16.0.0.0
+// 运行时版本: 17.0.0.0
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,这些更改将会丢失。
@@ -15,8 +15,8 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ #line 1 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class DirectoryBuildProps : DirectoryBuildPropsBase
{
#line hidden
@@ -25,47 +25,76 @@ public partial class DirectoryBuildProps : DirectoryBuildPropsBase
///
public virtual string TransformText()
{
- this.Write("\r\n \r\n ");
+ this.Write("\r\n \r\n net9.0\r\n " +
+ "");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 5 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.No<10 ? "0" + _model.Module.No : _model.Module.No + ""));
#line default
#line hidden
- this.Write("\r\n ");
+ this.Write("\r\n ");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Name));
+ #line 6 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
- this.Write(@"
- Oldli
- 1.0.0
- NetModular Module $(Id)($(Name)) - $(MSBuildProjectName)
- $(NoWarn);1591
- Latest
- ");
+ this.Write("\r\n\t");
- #line 11 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
+ #line 7 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Name));
+
+ #line default
+ #line hidden
+ this.Write("\r\n Oldli\r\n ");
+
+ #line 9 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Icon));
+
+ #line default
+ #line hidden
+ this.Write("\r\n 1.0.0\r\n NetModular Module $(Code)" +
+ "($(Name)) - $(MSBuildProjectName)\r\n $(NoWarn);1591\r\n Latest\r\n ");
+
+ #line 14 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
- this.Write(@".Module.$(Id)
+ this.Write(@".Module.$(Code)
$(RootNamespacePrefix).$(MSBuildProjectName)
$(AssemblyName)
true
true
$(SolutionDir)\_packages
- Oldli
- Oldli
- https://nm.iamoldli.com/docs/
- https://github.com/iamoldli/NetModular.Module.");
+ ");
+
+ #line 21 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_company));
+
+ #line default
+ #line hidden
+ this.Write("\r\n ");
+
+ #line 22 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_copyright));
+
+ #line default
+ #line hidden
+ this.Write("\r\n ");
+
+ #line 23 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_projectUrl));
+
+ #line default
+ #line hidden
+ this.Write("\r\n ");
- #line 21 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 24 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\DirectoryBuildProps.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_repositoryUrl));
#line default
#line hidden
@@ -80,7 +109,7 @@ public virtual string TransformText()
///
/// Base class for this transformation
///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class DirectoryBuildPropsBase
{
#region Fields
@@ -95,7 +124,7 @@ public class DirectoryBuildPropsBase
///
/// The string builder that generation-time code is using to assemble generated output
///
- protected System.Text.StringBuilder GenerationEnvironment
+ public System.Text.StringBuilder GenerationEnvironment
{
get
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/DirectoryBuildProps.tt b/src/Library/Infrastructure/Templates/Default/T4/src/DirectoryBuildProps.tt
index 5bc88ca..afa7094 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/DirectoryBuildProps.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/DirectoryBuildProps.tt
@@ -1,23 +1,26 @@
<#@ template language="C#" #>
- <#= _model.Project.Code #>
- <#= _model.Project.Name #>
+ net9.0
+ <#= _model.Module.No<10 ? "0" + _model.Module.No : _model.Module.No + "" #>
+ <#= _model.Module.Code #>
+ <#= _model.Module.Name #>
Oldli
+ <#= _model.Module.Icon #>
1.0.0
- NetModular Module $(Id)($(Name)) - $(MSBuildProjectName)
+ NetModular Module $(Code)($(Name)) - $(MSBuildProjectName)
$(NoWarn);1591
Latest
- <#= _prefix #>.Module.$(Id)
+ <#= _prefix #>.Module.$(Code)
$(RootNamespacePrefix).$(MSBuildProjectName)
$(AssemblyName)
true
true
$(SolutionDir)\_packages
- Oldli
- Oldli
- https://nm.iamoldli.com/docs/
- https://github.com/iamoldli/NetModular.Module.<#= _model.Project.Code #>
+ <#= _company #>
+ <#= _copyright #>
+ <#= _projectUrl #>
+ <#= _repositoryUrl #>
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/Csproj.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/Csproj.Extend.cs
index 5a003da..dfa72ff 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/Csproj.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/Csproj.Extend.cs
@@ -1,4 +1,5 @@
using System.IO;
+using NetModular.Module.CodeGenerator.Infrastructure.NuGet;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.Library.Application
@@ -7,15 +8,20 @@ public partial class Csproj : ITemplateHandler
{
private readonly TemplateBuildModel _model;
private readonly string _prefix;
+ private readonly NuGetPackageVersions _versions;
public Csproj(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
+ _versions = _model.NuGetPackageVersions;
}
+
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Application");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Application");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/Csproj.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/Csproj.cs
index 1034412..e5b8771 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/Csproj.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/Csproj.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
//
// 此代码由工具生成。
-// 运行时版本: 16.0.0.0
+// 运行时版本: 17.0.0.0
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,这些更改将会丢失。
@@ -15,8 +15,8 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\Csproj.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ #line 1 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\Csproj.tt"
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class Csproj : CsprojBase
{
#line hidden
@@ -25,25 +25,36 @@ public partial class Csproj : CsprojBase
///
public virtual string TransformText()
{
- this.Write("\r\n\r\n \r\n nets" +
- "tandard2.0\r\n \r\n\r\n \r\n \r\n\r\n \r\n\t\r\n \r\n \r\n \r\n\r\n \r\n " +
- "\r\n \r\n\r\n\r\n");
+ this.Write(".Lib.Mapper.AutoMapper\" Version=\"");
+
+ #line 6 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\Csproj.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_versions.Lib_Mapper_AutoMapper));
+
+ #line default
+ #line hidden
+ this.Write("\" />\r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n");
return this.GenerationEnvironment.ToString();
}
}
@@ -54,7 +65,7 @@ public virtual string TransformText()
///
/// Base class for this transformation
///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class CsprojBase
{
#region Fields
@@ -69,7 +80,7 @@ public class CsprojBase
///
/// The string builder that generation-time code is using to assemble generated output
///
- protected System.Text.StringBuilder GenerationEnvironment
+ public System.Text.StringBuilder GenerationEnvironment
{
get
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/Csproj.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/Csproj.tt
index d994246..0194f0a 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/Csproj.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/Csproj.tt
@@ -1,17 +1,13 @@
<#@ template language="C#" #>
-
- netstandard2.0
-
-
-
-
+
+
-
+
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/MapperConfig.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/MapperConfig.Extend.cs
index 84142d3..ccf798b 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/MapperConfig.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/MapperConfig.Extend.cs
@@ -13,18 +13,20 @@ public partial class MapperConfig : ITemplateHandler
public MapperConfig(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => false;
+
public void Save()
{
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Application", _class.Name + "Service");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Application", _class.Name + "Service");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/MapperConfig.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/MapperConfig.cs
index 0b62d83..fc087d0 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/MapperConfig.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/MapperConfig.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class MapperConfig : MapperConfigBase
{
@@ -27,70 +27,70 @@ public virtual string TransformText()
{
this.Write("using AutoMapper;\r\nusing ");
- #line 3 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ #line 3 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Mapper.AutoMapper;\r\nusing ");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Application.");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Service.ViewModels;\r\nusing ");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write(";\r\n\r\nnamespace ");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Application.");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
@@ -99,42 +99,42 @@ public virtual string TransformText()
"void Bind(IMapperConfigurationExpression cfg)\r\n {\r\n cfg.Create" +
"Map<");
- #line 13 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ #line 13 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("AddModel, ");
- #line 13 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ #line 13 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Entity>();\r\n cfg.CreateMap<");
- #line 14 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ #line 14 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Entity, ");
- #line 14 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ #line 14 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("UpdateModel>();\r\n cfg.CreateMap<");
- #line 15 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ #line 15 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("UpdateModel, ");
- #line 15 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
+ #line 15 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\MapperConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/MapperConfig.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/MapperConfig.tt
index 29a8828..2799d64 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/MapperConfig.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/MapperConfig.tt
@@ -1,10 +1,10 @@
<#@ template language="C#" #>
using AutoMapper;
using <#= _prefix #>.Lib.Mapper.AutoMapper;
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Application.<#= _class.Name #>Service.ViewModels;
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Application.<#= _class.Name #>Service.ViewModels;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Application.<#= _class.Name #>Service
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Application.<#= _class.Name #>Service
{
public class MapperConfig : IMapperConfig
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceImpl.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceImpl.Extend.cs
index 9a7e211..5185798 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceImpl.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceImpl.Extend.cs
@@ -13,18 +13,20 @@ public partial class ServiceImpl : ITemplateHandler
public ServiceImpl(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => false;
+
public void Save()
{
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Application", _class.Name + "Service");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Application", _class.Name + "Service");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceImpl.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceImpl.cs
index 53e2b4e..97a6c36 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceImpl.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceImpl.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class ServiceImpl : ServiceImplBase
{
@@ -28,105 +28,105 @@ public virtual string TransformText()
this.Write("using System;\r\nusing System.Linq;\r\nusing System.Threading.Tasks;\r\nusing AutoMappe" +
"r;\r\nusing ");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Utils.Core.Result;\r\nusing ");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Application.");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Service.ViewModels;\r\nusing ");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write(";\r\nusing ");
- #line 9 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 9 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 9 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 9 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 9 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 9 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write(".Models;\r\n\r\nnamespace ");
- #line 11 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 11 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 11 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 11 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Application.");
- #line 11 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 11 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Service\r\n{\r\n public class ");
- #line 13 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 13 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Service : I");
- #line 13 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 13 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
@@ -134,21 +134,21 @@ public virtual string TransformText()
this.Write("Service\r\n {\r\n private readonly IMapper _mapper;\r\n private readon" +
"ly I");
- #line 16 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 16 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Repository _repository;\r\n public ");
- #line 17 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 17 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Service(IMapper mapper, I");
- #line 17 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 17 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
@@ -156,21 +156,21 @@ public virtual string TransformText()
this.Write("Repository repository)\r\n {\r\n _mapper = mapper;\r\n _re" +
"pository = repository;\r\n }\r\n\r\n");
- #line 23 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 23 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
if(_class.Method.Query) {
#line default
#line hidden
this.Write(" public async Task Query(");
- #line 24 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 24 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("QueryModel model)\r\n {\r\n var result = new QueryResultModel<");
- #line 26 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 26 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
@@ -179,27 +179,27 @@ public virtual string TransformText()
" Total = model.TotalCount\r\n };\r\n return Resu" +
"ltModel.Success(result);\r\n }\r\n\r\n");
- #line 34 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 34 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
}
#line default
#line hidden
- #line 35 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 35 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
if(_class.Method.Add) {
#line default
#line hidden
this.Write(" public async Task Add(");
- #line 36 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 36 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("AddModel model)\r\n {\r\n var entity = _mapper.Map<");
- #line 38 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 38 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
@@ -216,20 +216,20 @@ public virtual string TransformText()
");
- #line 48 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 48 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
}
#line default
#line hidden
- #line 49 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 49 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
if(_class.Method.Delete) {
#line default
#line hidden
this.Write(" public async Task Delete(");
- #line 50 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 50 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.PrimaryKeyTypeName));
#line default
@@ -237,20 +237,20 @@ public virtual string TransformText()
this.Write(" id)\r\n {\r\n var result = await _repository.DeleteAsync(id);\r\n " +
" return ResultModel.Result(result);\r\n }\r\n\r\n");
- #line 56 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 56 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
}
#line default
#line hidden
- #line 57 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 57 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
if(_class.Method.Edit) {
#line default
#line hidden
this.Write(" public async Task Edit(");
- #line 58 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 58 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.PrimaryKeyTypeName));
#line default
@@ -259,7 +259,7 @@ public virtual string TransformText()
" if (entity == null)\r\n return ResultModel.NotExists;\r\n\r\n " +
" var model = _mapper.Map<");
- #line 64 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 64 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
@@ -267,7 +267,7 @@ public virtual string TransformText()
this.Write("UpdateModel>(entity);\r\n return ResultModel.Success(model);\r\n }\r" +
"\n\r\n public async Task Update(");
- #line 68 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 68 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
@@ -291,7 +291,7 @@ public virtual string TransformText()
}
");
- #line 85 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
+ #line 85 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceImpl.tt"
}
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceImpl.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceImpl.tt
index 3f0d2d3..2ff97bc 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceImpl.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceImpl.tt
@@ -4,11 +4,11 @@ using System.Linq;
using System.Threading.Tasks;
using AutoMapper;
using <#= _prefix #>.Lib.Utils.Core.Result;
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Application.<#= _class.Name #>Service.ViewModels;
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>;
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>.Models;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Application.<#= _class.Name #>Service.ViewModels;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>.Models;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Application.<#= _class.Name #>Service
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Application.<#= _class.Name #>Service
{
public class <#= _class.Name #>Service : I<#= _class.Name #>Service
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceInterface.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceInterface.Extend.cs
index e04477d..faedf2a 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceInterface.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceInterface.Extend.cs
@@ -13,18 +13,20 @@ public partial class ServiceInterface : ITemplateHandler
public ServiceInterface(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => false;
+
public void Save()
{
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Application", _class.Name + "Service");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Application", _class.Name + "Service");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceInterface.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceInterface.cs
index 2f10d01..5d0ffcd 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceInterface.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceInterface.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class ServiceInterface : ServiceInterfaceBase
{
@@ -27,91 +27,91 @@ public virtual string TransformText()
{
this.Write("using System;\r\nusing System.Threading.Tasks;\r\nusing ");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Utils.Core.Result;\r\nusing ");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Application.");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Service.ViewModels;\r\nusing ");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write(".Models;\r\n\r\nnamespace ");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Application.");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Service\r\n{\r\n /// \r\n /// ");
- #line 11 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 11 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Remarks));
#line default
#line hidden
this.Write("服务\r\n /// \r\n public interface I");
- #line 13 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 13 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Service\r\n {\r\n");
- #line 15 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 15 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
if(_class.Method.Query) {
#line default
@@ -120,20 +120,20 @@ public virtual string TransformText()
" name=\"model\">\r\n /// \r\n Task Query(");
- #line 21 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 21 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("QueryModel model);\r\n\r\n");
- #line 23 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 23 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
}
#line default
#line hidden
- #line 24 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 24 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
if(_class.Method.Add) {
#line default
@@ -142,20 +142,20 @@ public virtual string TransformText()
" name=\"model\">\r\n /// \r\n Task Add(");
- #line 30 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 30 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("AddModel model);\r\n\r\n");
- #line 32 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 32 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
}
#line default
#line hidden
- #line 33 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 33 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
if(_class.Method.Delete) {
#line default
@@ -164,20 +164,20 @@ public virtual string TransformText()
" name=\"id\">编号\r\n /// \r\n Task Delete(");
- #line 39 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 39 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.PrimaryKeyTypeName));
#line default
#line hidden
this.Write(" id);\r\n\r\n");
- #line 41 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 41 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
}
#line default
#line hidden
- #line 42 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 42 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
if(_class.Method.Edit) {
#line default
@@ -186,7 +186,7 @@ public virtual string TransformText()
" name=\"id\">\r\n /// \r\n Task" +
" Edit(");
- #line 48 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 48 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.PrimaryKeyTypeName));
#line default
@@ -195,14 +195,14 @@ public virtual string TransformText()
"// \r\n /// \r\n Task Update(");
- #line 55 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 55 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("UpdateModel model);\r\n\r\n");
- #line 57 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
+ #line 57 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ServiceInterface.tt"
}
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceInterface.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceInterface.tt
index de9e098..a0962c4 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceInterface.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ServiceInterface.tt
@@ -2,10 +2,10 @@
using System;
using System.Threading.Tasks;
using <#= _prefix #>.Lib.Utils.Core.Result;
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Application.<#= _class.Name #>Service.ViewModels;
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>.Models;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Application.<#= _class.Name #>Service.ViewModels;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>.Models;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Application.<#= _class.Name #>Service
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Application.<#= _class.Name #>Service
{
///
/// <#= _class.Remarks #>服务
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/AddModel.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/AddModel.Extend.cs
index 6d701dc..3cda177 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/AddModel.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/AddModel.Extend.cs
@@ -13,18 +13,20 @@ public partial class AddModel : ITemplateHandler
public AddModel(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => false;
+
public void Save()
{
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Application/", _class.Name + "Service", "ViewModels");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Application/", _class.Name + "Service", "ViewModels");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/AddModel.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/AddModel.cs
index 0bcc78e..049f813 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/AddModel.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/AddModel.cs
@@ -17,7 +17,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class AddModel : AddModelBase
{
@@ -29,91 +29,91 @@ public virtual string TransformText()
{
this.Write("using System;\r\nusing System.ComponentModel.DataAnnotations;\r\nusing ");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write(";\r\n\r\nnamespace ");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Application.");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Service.ViewModels\r\n{\r\n /// \r\n /// ");
- #line 11 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
+ #line 11 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Remarks));
#line default
#line hidden
this.Write("添加模型\r\n /// \r\n public class ");
- #line 13 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
+ #line 13 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("AddModel\r\n {\r\n");
- #line 15 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
+ #line 15 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
foreach(var p in _class.AddModelPropertyList){
#line default
#line hidden
this.Write(" /// \r\n /// ");
- #line 17 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
+ #line 17 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Remarks));
#line default
#line hidden
this.Write("\r\n /// \r\n public ");
- #line 19 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
+ #line 19 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Type == PropertyType.Enum ? p.Enum.Name : p.Type.ToDescription()));
#line default
#line hidden
this.Write(" ");
- #line 19 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
+ #line 19 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Name));
#line default
#line hidden
this.Write(" { get; set; }\r\n\r\n");
- #line 21 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
+ #line 21 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\AddModel.tt"
}
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/AddModel.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/AddModel.tt
index f88ad8d..de3e1df 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/AddModel.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/AddModel.tt
@@ -3,9 +3,9 @@
<#@ import namespace="NetModular.Module.CodeGenerator.Domain.Property" #>
using System;
using System.ComponentModel.DataAnnotations;
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Application.<#= _class.Name #>Service.ViewModels
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Application.<#= _class.Name #>Service.ViewModels
{
///
/// <#= _class.Remarks #>添加模型
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/UpdateModel.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/UpdateModel.Extend.cs
index 477ebed..cde9f85 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/UpdateModel.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/UpdateModel.Extend.cs
@@ -13,18 +13,21 @@ public partial class UpdateModel : ITemplateHandler
public UpdateModel(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => false;
+
+
public void Save()
{
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Application/", _class.Name + "Service", "ViewModels");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Application/", _class.Name + "Service", "ViewModels");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/UpdateModel.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/UpdateModel.cs
index 092b949..e592166 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/UpdateModel.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/UpdateModel.cs
@@ -17,7 +17,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class UpdateModel : UpdateModelBase
{
@@ -29,110 +29,82 @@ public virtual string TransformText()
{
this.Write("using System;\r\nusing System.ComponentModel.DataAnnotations;\r\nusing ");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write(";\r\n\r\nnamespace ");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Application.");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Service.ViewModels\r\n{\r\n /// \r\n /// ");
- #line 11 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
+ #line 11 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Remarks));
#line default
#line hidden
this.Write("添加模型\r\n /// \r\n public class ");
- #line 13 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
+ #line 13 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
- this.Write("UpdateModel\r\n {\r\n [Required(ErrorMessage = \"请选择要修改的");
+ this.Write("UpdateModel : ");
- #line 15 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_class.Remarks));
-
- #line default
- #line hidden
- this.Write("\")]\r\n public ");
-
- #line 16 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_class.PrimaryKeyTypeName));
-
- #line default
- #line hidden
- this.Write(" Id { get; set; }\r\n\r\n ");
-
- #line 18 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
- foreach(var p in _class.AddModelPropertyList){
-
- #line default
- #line hidden
- this.Write(" /// \r\n /// ");
-
- #line 20 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(p.Remarks));
-
- #line default
- #line hidden
- this.Write("\r\n /// \r\n public ");
-
- #line 22 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(p.Type == PropertyType.Enum ? p.Enum.Name : p.Type.ToDescription()));
+ #line 13 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
- this.Write(" ");
+ this.Write("AddModel\r\n {\r\n [Required(ErrorMessage = \"请选择要修改的");
- #line 22 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(p.Name));
+ #line 15 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_class.Remarks));
#line default
#line hidden
- this.Write(" { get; set; }\r\n\r\n ");
+ this.Write("\")]\r\n public ");
- #line 24 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
- }
+ #line 16 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Application\ViewModels\UpdateModel.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_class.PrimaryKeyTypeName));
#line default
#line hidden
- this.Write("\r\n }\r\n}\r\n");
+ this.Write(" Id { get; set; }\r\n }\r\n}\r\n");
return this.GenerationEnvironment.ToString();
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/UpdateModel.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/UpdateModel.tt
index cec67d6..b12d24f 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/UpdateModel.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Application/ViewModels/UpdateModel.tt
@@ -3,25 +3,16 @@
<#@ import namespace="NetModular.Module.CodeGenerator.Domain.Property" #>
using System;
using System.ComponentModel.DataAnnotations;
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Application.<#= _class.Name #>Service.ViewModels
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Application.<#= _class.Name #>Service.ViewModels
{
///
/// <#= _class.Remarks #>添加模型
///
- public class <#= _class.Name #>UpdateModel
+ public class <#= _class.Name #>UpdateModel : <#= _class.Name #>AddModel
{
[Required(ErrorMessage = "请选择要修改的<#= _class.Remarks #>")]
public <#= _class.PrimaryKeyTypeName #> Id { get; set; }
-
- <# foreach(var p in _class.AddModelPropertyList){ #>
- ///
- /// <#= p.Remarks #>
- ///
- public <#= p.Type == PropertyType.Enum ? p.Enum.Name : p.Type.ToDescription() #> <#= p.Name #> { get; set; }
-
- <# } #>
-
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Csproj.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Csproj.Extend.cs
index 976bb2f..33f09bd 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Csproj.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Csproj.Extend.cs
@@ -1,4 +1,5 @@
using System.IO;
+using NetModular.Module.CodeGenerator.Infrastructure.NuGet;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.Library.Domain
@@ -7,16 +8,20 @@ public partial class Csproj : ITemplateHandler
{
private readonly TemplateBuildModel _model;
private readonly string _prefix;
+ private readonly NuGetPackageVersions _versions;
public Csproj(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
+ _versions = _model.NuGetPackageVersions;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Domain");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Domain");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Csproj.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Csproj.cs
index cf782d9..c5ecf4c 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Csproj.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Csproj.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
//
// 此代码由工具生成。
-// 运行时版本: 16.0.0.0
+// 运行时版本: 17.0.0.0
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,这些更改将会丢失。
@@ -15,8 +15,8 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Csproj.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ #line 1 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Csproj.tt"
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class Csproj : CsprojBase
{
#line hidden
@@ -25,30 +25,50 @@ public partial class Csproj : CsprojBase
///
public virtual string TransformText()
{
- this.Write("\r\n\r\n \r\n nets" +
- "tandard2.0\r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n");
+ this.Write(".Lib.Utils.Core\" Version=\"");
+
+ #line 7 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Csproj.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_versions.Lib_Utils_Core));
+
+ #line default
+ #line hidden
+ this.Write("\" />\r\n \r\n\r\n\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
}
@@ -59,7 +79,7 @@ public virtual string TransformText()
///
/// Base class for this transformation
///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class CsprojBase
{
#region Fields
@@ -74,7 +94,7 @@ public class CsprojBase
///
/// The string builder that generation-time code is using to assemble generated output
///
- protected System.Text.StringBuilder GenerationEnvironment
+ public System.Text.StringBuilder GenerationEnvironment
{
get
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Csproj.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Csproj.tt
index b9b4e2f..54dfceb 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Csproj.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Csproj.tt
@@ -1,14 +1,10 @@
<#@ template language="C#" #>
-
- netstandard2.0
-
-
-
-
-
+
+
+
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Entity.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Entity.Extend.cs
index 793298e..34ea155 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Entity.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Entity.Extend.cs
@@ -24,18 +24,20 @@ public partial class Entity : ITemplateHandler
public Entity(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => false;
+
public void Save()
{
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Domain", _class.Name);
+ var dir = Path.Combine(_model.RootPath, "src/Library/Domain", _class.Name);
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Entity.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Entity.cs
index 2b730a5..f5ff122 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Entity.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Entity.cs
@@ -17,7 +17,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Entity : EntityBase
{
@@ -29,199 +29,205 @@ public virtual string TransformText()
{
this.Write("using System;\r\nusing ");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Data.Abstractions.Attributes;\r\n");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
if(_baseEntityName=="IEntity" || _baseEntityName=="Entity" || _baseEntityName.StartsWith("Entity<")){
#line default
#line hidden
this.Write("using ");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Data.Core.Entities;\r\n");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
}else{
#line default
#line hidden
this.Write("using ");
- #line 9 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 9 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Data.Core.Entities.Extend;\r\n");
- #line 10 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 10 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
}
#line default
#line hidden
this.Write("\r\nnamespace ");
- #line 12 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 12 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 12 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 12 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 12 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 12 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("\r\n{\r\n /// \r\n /// ");
- #line 15 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 15 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Remarks));
#line default
#line hidden
this.Write("\r\n /// \r\n [Table(\"");
- #line 17 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 17 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.TableName));
#line default
#line hidden
this.Write("\")]\r\n public partial class ");
- #line 18 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 18 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Entity : ");
- #line 18 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 18 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_baseEntityName));
#line default
#line hidden
this.Write("\r\n {\r\n");
- #line 20 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 20 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
foreach(var p in _propertyList){ if(p.IsInherit) continue;
#line default
#line hidden
this.Write(" /// \r\n /// ");
- #line 22 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 22 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Remarks));
#line default
#line hidden
this.Write("\r\n /// \r\n");
- #line 24 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
- if(p.Nullable){
+ #line 24 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ if(p.Nullable && p.Type == PropertyType.String){
#line default
#line hidden
this.Write("\t\t[Nullable]\r\n");
- #line 26 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 26 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
}
#line default
#line hidden
- #line 27 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 27 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
if(p.Type == PropertyType.String){
#line default
#line hidden
- #line 28 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 28 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
if(p.Length == 0){
#line default
#line hidden
this.Write("\t\t[Max]\r\n");
- #line 30 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
- } else {
+ #line 30 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ } else if(p.Length !=50) {
#line default
#line hidden
this.Write(" [Length(");
- #line 31 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 31 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Length));
#line default
#line hidden
this.Write(")]\r\n");
- #line 32 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 32 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
}
#line default
#line hidden
- #line 33 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 33 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
}
#line default
#line hidden
- #line 34 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 34 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
if(p.Type == PropertyType.Decimal||p.Type == PropertyType.Double){
#line default
#line hidden
this.Write("\t\t[Precision]\r\n");
- #line 36 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 36 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
}
#line default
#line hidden
this.Write(" public ");
- #line 37 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 37 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Type == PropertyType.Enum ? p.Enum.Name : p.Type.ToDescription()));
+ #line default
+ #line hidden
+
+ #line 37 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(p.Nullable && p.Type != PropertyType.String ? "?" : ""));
+
#line default
#line hidden
this.Write(" ");
- #line 37 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 37 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(p.Name));
#line default
#line hidden
this.Write(" { get; set; }");
- #line 37 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 37 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(GetDefaultValue(p)));
#line default
#line hidden
this.Write("\r\n\r\n");
- #line 39 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
+ #line 39 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Entity.tt"
}
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Entity.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Entity.tt
index d47954e..d8310c2 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Entity.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Entity.tt
@@ -9,7 +9,7 @@ using <#= _prefix #>.Lib.Data.Core.Entities;
using <#= _prefix #>.Lib.Data.Core.Entities.Extend;
<#} #>
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>
{
///
/// <#= _class.Remarks #>
@@ -21,20 +21,20 @@ namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Nam
///
/// <#= p.Remarks #>
///
-<# if(p.Nullable){ #>
+<# if(p.Nullable && p.Type == PropertyType.String){ #>
[Nullable]
<# } #>
<# if(p.Type == PropertyType.String){ #>
<# if(p.Length == 0){ #>
[Max]
-<# } else { #>
+<# } else if(p.Length !=50) { #>
[Length(<#= p.Length #>)]
<# } #>
<# } #>
<# if(p.Type == PropertyType.Decimal||p.Type == PropertyType.Double){ #>
[Precision]
<# } #>
- public <#= p.Type == PropertyType.Enum ? p.Enum.Name : p.Type.ToDescription() #> <#= p.Name #> { get; set; }<#= GetDefaultValue(p) #>
+ public <#= p.Type == PropertyType.Enum ? p.Enum.Name : p.Type.ToDescription() #><#= p.Nullable && p.Type != PropertyType.String ? "?" : "" #> <#= p.Name #> { get; set; }<#= GetDefaultValue(p) #>
<# } #>
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityEnum.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityEnum.Extend.cs
index dcdac3f..63aae8a 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityEnum.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityEnum.Extend.cs
@@ -13,7 +13,7 @@ public EntityEnum(TemplateBuildModel model, ClassBuildModel @class,EnumBuildMode
{
_model = model;
_class = @class;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
_enum = @enum;
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityEnum.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityEnum.cs
index 41c1114..b5eb369 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityEnum.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityEnum.cs
@@ -16,7 +16,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class EntityEnum : EntityEnumBase
{
@@ -28,82 +28,82 @@ public virtual string TransformText()
{
this.Write("using System.ComponentModel;\r\n\r\nnamespace ");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("\r\n{\r\n /// \r\n /// ");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_enum.Remarks));
#line default
#line hidden
this.Write("\r\n /// \r\n public enum ");
- #line 10 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
+ #line 10 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_enum.Name));
#line default
#line hidden
this.Write("\r\n {\r\n");
- #line 12 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
+ #line 12 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
for(var i=0;i<_enum.ItemList.Count;i++){
#line default
#line hidden
- #line 13 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
+ #line 13 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
var item = _enum.ItemList[i];
#line default
#line hidden
this.Write(" [Description(\"");
- #line 14 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
+ #line 14 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(item.Remarks));
#line default
#line hidden
this.Write("\")]\r\n ");
- #line 15 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
+ #line 15 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(item.Name));
#line default
#line hidden
this.Write(" = ");
- #line 15 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
+ #line 15 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(item.Value));
#line default
#line hidden
- #line 15 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
+ #line 15 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(i == _enum.ItemList.Count - 1 ? "" : ","));
#line default
#line hidden
this.Write("\r\n");
- #line 16 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
+ #line 16 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityEnum.tt"
}
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityEnum.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityEnum.tt
index fbcc2e2..4f62f2d 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityEnum.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityEnum.tt
@@ -2,7 +2,7 @@
<#@ import namespace="System.Linq" #>
using System.ComponentModel;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>
{
///
/// <#= _enum.Remarks #>
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityExtend.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityExtend.Extend.cs
index 051a004..a77abcd 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityExtend.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityExtend.Extend.cs
@@ -13,18 +13,20 @@ public partial class EntityExtend : ITemplateHandler
public EntityExtend(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => false;
+
public void Save()
{
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Domain", _class.Name);
+ var dir = Path.Combine(_model.RootPath, "src/Library/Domain", _class.Name);
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityExtend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityExtend.cs
index a3f6178..1c06b21 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityExtend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityExtend.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityExtend.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityExtend.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class EntityExtend : EntityExtendBase
{
@@ -27,28 +27,28 @@ public virtual string TransformText()
{
this.Write("namespace ");
- #line 2 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityExtend.tt"
+ #line 2 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityExtend.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 2 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityExtend.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 2 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityExtend.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 2 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityExtend.tt"
+ #line 2 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityExtend.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("\r\n{\r\n public partial class ");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityExtend.tt"
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\EntityExtend.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityExtend.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityExtend.tt
index 5c960b9..5c79274 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityExtend.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/EntityExtend.tt
@@ -1,5 +1,5 @@
<#@ template language="C#" #>
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>
{
public partial class <#= _class.Name #>Entity
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Models/QueryModel.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Models/QueryModel.Extend.cs
index 7e279ea..15a2caa 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Models/QueryModel.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Models/QueryModel.Extend.cs
@@ -16,18 +16,20 @@ public partial class QueryModel : ITemplateHandler
public QueryModel(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => false;
+
public void Save()
{
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Domain", _class.Name, "Models");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Domain", _class.Name, "Models");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Models/QueryModel.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Models/QueryModel.cs
index f42fa6d..7764d76 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Models/QueryModel.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Models/QueryModel.cs
@@ -17,7 +17,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class QueryModel : QueryModelBase
{
@@ -29,76 +29,76 @@ public virtual string TransformText()
{
this.Write("using System;\r\nusing ");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
- this.Write(".Lib.Data.Query;\r\n\r\nnamespace ");
+ this.Write(".Lib.Data.Query;\r\n\r\nnamespace ");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write(".Models\r\n{\r\n public class ");
- #line 9 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
+ #line 9 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("QueryModel : QueryModel\r\n {\r\n");
- #line 11 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
+ #line 11 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
foreach(var property in _propertyList){
#line default
#line hidden
this.Write(" /// \r\n /// ");
- #line 13 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
+ #line 13 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(property.Remarks));
#line default
#line hidden
this.Write("\r\n /// \r\n public ");
- #line 15 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
+ #line 15 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(property.Type == PropertyType.Enum ? property.Enum.Name : property.Type.ToDescription()));
#line default
#line hidden
- #line 15 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
+ #line 15 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(property.Nullable && property.Type != PropertyType.String ? "?" : ""));
#line default
#line hidden
this.Write(" ");
- #line 15 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
+ #line 15 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(property.Name));
#line default
#line hidden
this.Write(" { get; set; }\r\n\r\n");
- #line 17 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
+ #line 17 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Models\QueryModel.tt"
}
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Models/QueryModel.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Models/QueryModel.tt
index 36ba88c..e991991 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Models/QueryModel.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Models/QueryModel.tt
@@ -4,7 +4,7 @@
using System;
using <#= _prefix #>.Lib.Data.Query;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>.Models
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>.Models
{
public class <#= _class.Name #>QueryModel : QueryModel
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Repository.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Repository.Extend.cs
index 5f9a806..2f85718 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Repository.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Repository.Extend.cs
@@ -13,18 +13,20 @@ public partial class Repository : ITemplateHandler
public Repository(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => false;
+
public void Save()
{
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Domain", _class.Name);
+ var dir = Path.Combine(_model.RootPath, "src/Library/Domain", _class.Name);
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Repository.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Repository.cs
index 55fd92a..c8fa8e3 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Repository.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Repository.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Repository : RepositoryBase
{
@@ -27,77 +27,70 @@ public virtual string TransformText()
{
this.Write("using System.Collections.Generic;\r\nusing System.Threading.Tasks;\r\nusing ");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Data.Abstractions;\r\nusing ");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
-
- #line default
- #line hidden
- this.Write(".Lib.Data.Abstractions.Pagination;\r\nusing ");
-
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write(".Models;\r\n\r\nnamespace ");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("\r\n{\r\n /// \r\n /// ");
- #line 11 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
+ #line 10 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Remarks));
#line default
#line hidden
this.Write("仓储\r\n /// \r\n public interface I");
- #line 13 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
+ #line 12 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Repository : IRepository<");
- #line 13 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
+ #line 12 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
@@ -106,14 +99,14 @@ public virtual string TransformText()
" /// \r\n /// \r\n " +
" Task> Query(");
- #line 20 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
+ #line 19 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Domain\Repository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Repository.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Repository.tt
index 56a6b89..159038c 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Repository.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Domain/Repository.tt
@@ -2,10 +2,9 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using <#= _prefix #>.Lib.Data.Abstractions;
-using <#= _prefix #>.Lib.Data.Abstractions.Pagination;
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>.Models;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>.Models;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>
{
///
/// <#= _class.Remarks #>仓储
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/db.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Config.Extend.cs
similarity index 58%
rename from src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/db.Extend.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Config.Extend.cs
index 6127903..0838e6a 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/db.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Config.Extend.cs
@@ -1,27 +1,29 @@
using System.IO;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.Library.Infrastructure
{
- public partial class db : ITemplateHandler
+ public partial class Config : ITemplateHandler
{
private readonly TemplateBuildModel _model;
private readonly string _prefix;
- public db(TemplateBuildModel model)
+ public Config(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost/config");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Infrastructure");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
var content = TransformText();
- var filePath = Path.Combine(dir, "db.json");
+ var filePath = Path.Combine(dir, $"{_model.Module.Code}Config.cs");
File.WriteAllText(filePath, content);
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/Options.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Config.cs
similarity index 89%
rename from src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/Options.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Config.cs
index 834c526..df826c6 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/Options.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Config.cs
@@ -7,7 +7,7 @@
// 重新生成代码,这些更改将会丢失。
//
// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.Library.Infrastructure.Options
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.Library.Infrastructure
{
using System;
@@ -15,9 +15,9 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Options\Options.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Config.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class Options : OptionsBase
+ public partial class Config : ConfigBase
{
#line hidden
///
@@ -27,40 +27,40 @@ public virtual string TransformText()
{
this.Write("using ");
- #line 2 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Options\Options.tt"
+ #line 2 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Config.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
- this.Write(".Lib.Utils.Core.Options;\r\n\r\nnamespace ");
+ this.Write(".Lib.Config.Abstractions;\r\n\r\nnamespace ");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Options\Options.tt"
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Config.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Options\Options.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Config.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
- this.Write(".Infrastructure.Options\r\n{\r\n /// \r\n /// ");
+ this.Write(".Infrastructure\r\n{\r\n /// \r\n /// ");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Options\Options.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Name));
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Config.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Name));
#line default
#line hidden
this.Write("配置项\r\n /// \r\n public class ");
- #line 9 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Options\Options.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 9 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Config.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
- this.Write("Options : IModuleOptions\r\n {\r\n\r\n }\r\n}\r\n");
+ this.Write("Config : IConfig\r\n {\r\n \r\n }\r\n}\r\n");
return this.GenerationEnvironment.ToString();
}
}
@@ -72,7 +72,7 @@ public virtual string TransformText()
/// Base class for this transformation
///
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class OptionsBase
+ public class ConfigBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Config.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Config.tt
new file mode 100644
index 0000000..0c8f726
--- /dev/null
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Config.tt
@@ -0,0 +1,13 @@
+<#@ template language="C#" #>
+using <#= _prefix #>.Lib.Config.Abstractions;
+
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Infrastructure
+{
+ ///
+ /// <#= _model.Module.Name #>配置项
+ ///
+ public class <#= _model.Module.Code #>Config : IConfig
+ {
+
+ }
+}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Csproj.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Csproj.Extend.cs
index a30051b..6520cbf 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Csproj.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Csproj.Extend.cs
@@ -1,4 +1,5 @@
using System.IO;
+using NetModular.Module.CodeGenerator.Infrastructure.NuGet;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.Library.Infrastructure
@@ -7,16 +8,20 @@ public partial class Csproj : ITemplateHandler
{
private readonly TemplateBuildModel _model;
private readonly string _prefix;
+ private readonly NuGetPackageVersions _versions;
public Csproj(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
+ _versions = _model.NuGetPackageVersions;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Infrastructure");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Infrastructure");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Csproj.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Csproj.cs
index 3f1c519..6092eca 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Csproj.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Csproj.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
//
// ˴ɹɡ
-// ʱ汾: 16.0.0.0
+// ʱ汾: 17.0.0.0
//
// ԴļĸĿܵ²ȷΪ
// ɴ룬ЩĽᶪʧ
@@ -15,8 +15,8 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Csproj.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ #line 1 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Csproj.tt"
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class Csproj : CsprojBase
{
#line hidden
@@ -25,19 +25,51 @@ public partial class Csproj : CsprojBase
///
public virtual string TransformText()
{
- this.Write("\r\n\r\n \r\n nets" +
- "tandard2.0\r\n \r\n\r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n <" +
- "ProjectReference Include=\"..\\Domain\\Domain.csproj\" />\r\n \r\n\r\n\r\n");
+ this.Write(".Lib.Config.Abstractions\" Version=\"");
+
+ #line 5 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Csproj.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_versions.Lib_Config_Abstractions));
+
+ #line default
+ #line hidden
+ this.Write("\" />\r\n\t \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
}
@@ -48,7 +80,7 @@ public virtual string TransformText()
///
/// Base class for this transformation
///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class CsprojBase
{
#region Fields
@@ -63,7 +95,7 @@ public class CsprojBase
///
/// The string builder that generation-time code is using to assemble generated output
///
- protected System.Text.StringBuilder GenerationEnvironment
+ public System.Text.StringBuilder GenerationEnvironment
{
get
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Csproj.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Csproj.tt
index 789c98f..6d636c7 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Csproj.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Csproj.tt
@@ -1,14 +1,10 @@
<#@ template language="C#" #>
-
- netstandard2.0
-
-
-
-
-
+
+
+
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/Options.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/ModuleServicesConfigurator.Extend.cs
similarity index 56%
rename from src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/Options.Extend.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/ModuleServicesConfigurator.Extend.cs
index 3220d6c..8c1ec63 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/Options.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/ModuleServicesConfigurator.Extend.cs
@@ -1,28 +1,29 @@
using System.IO;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.Library.Infrastructure.Options
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.Library.Infrastructure
{
- public partial class Options : ITemplateHandler
+ public partial class ModuleServicesConfigurator : ITemplateHandler
{
private readonly TemplateBuildModel _model;
private readonly string _prefix;
- public Options(TemplateBuildModel model)
+ public ModuleServicesConfigurator(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => true;
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Infrastructure/Options");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Infrastructure");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
var content = TransformText();
- var filePath = Path.Combine(dir, $"{_model.Project.Code}Options.cs");
+ var filePath = Path.Combine(dir, "ModuleServicesConfigurator.cs");
File.WriteAllText(filePath, content);
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Startup.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/ModuleServicesConfigurator.cs
similarity index 88%
rename from src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Startup.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/ModuleServicesConfigurator.cs
index 2d54cbc..d467adf 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Startup.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/ModuleServicesConfigurator.cs
@@ -7,7 +7,7 @@
// 重新生成代码,这些更改将会丢失。
//
// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.Library.Infrastructure
{
using System;
@@ -15,9 +15,9 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Startup.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\ModuleServicesConfigurator.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class Startup : StartupBase
+ public partial class ModuleServicesConfigurator : ModuleServicesConfiguratorBase
{
#line hidden
///
@@ -25,29 +25,38 @@ public partial class Startup : StartupBase
///
public virtual string TransformText()
{
- this.Write("using Microsoft.Extensions.Hosting;\r\nusing ");
+ this.Write("using Microsoft.Extensions.Configuration;\r\nusing Microsoft.Extensions.DependencyI" +
+ "njection;\r\nusing Microsoft.Extensions.Hosting;\r\nusing ");
- #line 3 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Startup.tt"
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\ModuleServicesConfigurator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
- this.Write(".Lib.Host.Web;\r\n\r\nnamespace ");
+ this.Write(".Lib.Module.Abstractions;\r\n\r\nnamespace ");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Startup.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\ModuleServicesConfigurator.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Startup.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\ModuleServicesConfigurator.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
- this.Write(".WebHost\r\n{\r\n public class Startup : StartupAbstract\r\n {\r\n public St" +
- "artup(IHostEnvironment env) : base(env)\r\n {\r\n }\r\n }\r\n}\r\n");
+ this.Write(@".Infrastructure
+{
+ public class ModuleServicesConfigurator : IModuleServicesConfigurator
+ {
+ public void Configure(IServiceCollection services, IModuleCollection modules, IHostEnvironment env, IConfiguration cfg)
+ {
+ }
+ }
+}
+");
return this.GenerationEnvironment.ToString();
}
}
@@ -59,7 +68,7 @@ public virtual string TransformText()
/// Base class for this transformation
///
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class StartupBase
+ public class ModuleServicesConfiguratorBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/ModuleServicesConfigurator.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/ModuleServicesConfigurator.tt
new file mode 100644
index 0000000..16f6a20
--- /dev/null
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/ModuleServicesConfigurator.tt
@@ -0,0 +1,14 @@
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+using <#= _prefix #>.Lib.Module.Abstractions;
+
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Infrastructure
+{
+ public class ModuleServicesConfigurator : IModuleServicesConfigurator
+ {
+ public void Configure(IServiceCollection services, IModuleCollection modules, IHostEnvironment env, IConfiguration cfg)
+ {
+ }
+ }
+}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/ModuleOptionsConfigure.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/ModuleOptionsConfigure.Extend.cs
deleted file mode 100644
index 12ae60e..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/ModuleOptionsConfigure.Extend.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System.IO;
-using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.Library.Infrastructure.Options
-{
- public partial class ModuleOptionsConfigure : ITemplateHandler
- {
- private readonly TemplateBuildModel _model;
- private readonly string _prefix;
-
- public ModuleOptionsConfigure(TemplateBuildModel model)
- {
- _model = model;
- _prefix = model.Project.Prefix;
- }
-
-
- public void Save()
- {
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Infrastructure/Options");
- if (!Directory.Exists(dir))
- Directory.CreateDirectory(dir);
-
- var content = TransformText();
- var filePath = Path.Combine(dir, "ModuleOptionsConfigure.cs");
- File.WriteAllText(filePath, content);
- }
- }
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/ModuleOptionsConfigure.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/ModuleOptionsConfigure.tt
deleted file mode 100644
index 09c078e..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/ModuleOptionsConfigure.tt
+++ /dev/null
@@ -1,15 +0,0 @@
-<#@ template language="C#" #>
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using <#= _prefix #>.Lib.Utils.Core.Options;
-
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Infrastructure.Options
-{
- public class ModuleOptionsConfigure : IModuleOptionsConfigure
- {
- public void ConfigOptions(IServiceCollection services, IConfiguration configuration)
- {
- services.Configure<<#= _model.Project.Code #>Options>(configuration);
- }
- }
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/Options.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/Options.tt
deleted file mode 100644
index ca12973..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/Options.tt
+++ /dev/null
@@ -1,13 +0,0 @@
-<#@ template language="C#" #>
-using <#= _prefix #>.Lib.Utils.Core.Options;
-
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Infrastructure.Options
-{
- ///
- /// <#= _model.Project.Name #>配置项
- ///
- public class <#= _model.Project.Code #>Options : IModuleOptions
- {
-
- }
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/DbContext.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/DbContext.Extend.cs
index 35776f7..7c4b963 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/DbContext.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/DbContext.Extend.cs
@@ -11,18 +11,19 @@ public partial class DbContext : ITemplateHandler
public DbContext(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
-
+
+ public bool IsGlobal => true;
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Infrastructure/Repositories");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Infrastructure/Repositories");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
var content = TransformText();
- var filePath = Path.Combine(dir, $"{_model.Project.Code}DbContext.cs");
+ var filePath = Path.Combine(dir, $"{_model.Module.Code}DbContext.cs");
File.WriteAllText(filePath, content);
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/DbContext.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/DbContext.cs
index 846bc7f..e2e4f8c 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/DbContext.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/DbContext.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\DbContext.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\DbContext.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class DbContext : DbContextBase
{
@@ -25,50 +25,50 @@ public partial class DbContext : DbContextBase
///
public virtual string TransformText()
{
- this.Write("using System;\r\nusing ");
+ this.Write("using ");
- #line 3 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\DbContext.tt"
+ #line 2 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\DbContext.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Data.Abstractions;\r\nusing ");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\DbContext.tt"
+ #line 3 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\DbContext.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Data.Core;\r\n\r\nnamespace ");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\DbContext.tt"
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\DbContext.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\DbContext.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\DbContext.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Infrastructure.Repositories\r\n{\r\n public class ");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\DbContext.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\DbContext.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write("DbContext : DbContext\r\n {\r\n public ");
- #line 10 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\DbContext.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 9 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\DbContext.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
- this.Write("DbContext(IDbContextOptions options, IServiceProvider serviceProvider) : base(opt" +
- "ions, serviceProvider)\r\n {\r\n }\r\n }\r\n}\r\n");
+ this.Write("DbContext(IDbContextOptions options) : base(options)\r\n {\r\n }\r\n }" +
+ "\r\n}\r\n");
return this.GenerationEnvironment.ToString();
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/DbContext.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/DbContext.tt
index 81874de..576cd50 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/DbContext.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/DbContext.tt
@@ -1,13 +1,12 @@
<#@ template language="C#" #>
-using System;
using <#= _prefix #>.Lib.Data.Abstractions;
using <#= _prefix #>.Lib.Data.Core;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Infrastructure.Repositories
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Infrastructure.Repositories
{
- public class <#= _model.Project.Code #>DbContext : DbContext
+ public class <#= _model.Module.Code #>DbContext : DbContext
{
- public <#= _model.Project.Code #>DbContext(IDbContextOptions options, IServiceProvider serviceProvider) : base(options, serviceProvider)
+ public <#= _model.Module.Code #>DbContext(IDbContextOptions options) : base(options)
{
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/MySqlRepository.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/MySqlRepository.Extend.cs
index 03176c9..0043fb5 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/MySqlRepository.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/MySqlRepository.Extend.cs
@@ -13,19 +13,20 @@ public partial class MySqlRepository : ITemplateHandler
public MySqlRepository(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => false;
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Infrastructure/Repositories/MySql");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Infrastructure/Repositories/MySql");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/MySqlRepository.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/MySqlRepository.cs
index ab8f40e..b52bab0 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/MySqlRepository.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/MySqlRepository.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\MySqlRepository.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\MySqlRepository.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class MySqlRepository : MySqlRepositoryBase
{
@@ -27,42 +27,42 @@ public virtual string TransformText()
{
this.Write("using ");
- #line 2 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\MySqlRepository.tt"
+ #line 2 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\MySqlRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Data.Abstractions;\r\n\r\nnamespace ");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\MySqlRepository.tt"
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\MySqlRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\MySqlRepository.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\MySqlRepository.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Infrastructure.Repositories.MySql\r\n{\r\n public class ");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\MySqlRepository.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\MySqlRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Repository : SqlServer.");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\MySqlRepository.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\MySqlRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Repository\r\n {\r\n public ");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\MySqlRepository.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\MySqlRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/MySqlRepository.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/MySqlRepository.tt
index a1b8274..dd843ac 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/MySqlRepository.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/MySqlRepository.tt
@@ -1,7 +1,7 @@
<#@ template language="C#" #>
using <#= _prefix #>.Lib.Data.Abstractions;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Infrastructure.Repositories.MySql
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Infrastructure.Repositories.MySql
{
public class <#= _class.Name #>Repository : SqlServer.<#= _class.Name #>Repository
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/PostgreSQLRepository.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/PostgreSQLRepository.Extend.cs
new file mode 100644
index 0000000..c273fa5
--- /dev/null
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/PostgreSQLRepository.Extend.cs
@@ -0,0 +1,44 @@
+using System.IO;
+using System.Linq;
+using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.Library.Infrastructure.Repositories
+{
+ public partial class PostgreSQLRepository : ITemplateHandler
+ {
+ private readonly TemplateBuildModel _model;
+ private readonly string _prefix;
+ private ClassBuildModel _class;
+
+ public PostgreSQLRepository(TemplateBuildModel model)
+ {
+ _model = model;
+ _prefix = model.Module.Prefix;
+ }
+
+ public bool IsGlobal => false;
+
+ public void Save()
+ {
+ var dir = Path.Combine(_model.RootPath, "src/Library/Infrastructure/Repositories/PostgreSQL");
+ if (!Directory.Exists(dir))
+ Directory.CreateDirectory(dir);
+
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
+ {
+ foreach (var classModel in _model.Module.ClassList)
+ {
+ _class = classModel;
+
+ //清空
+ GenerationEnvironment.Clear();
+
+ var content = TransformText();
+
+ var filePath = Path.Combine(dir, $"{_class.Name}Repository.cs");
+ File.WriteAllText(filePath, content);
+ }
+ }
+ }
+ }
+}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/ModuleOptionsConfigure.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/PostgreSQLRepository.cs
similarity index 83%
rename from src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/ModuleOptionsConfigure.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/PostgreSQLRepository.cs
index 05787ae..0422680 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Options/ModuleOptionsConfigure.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/PostgreSQLRepository.cs
@@ -7,7 +7,7 @@
// 重新生成代码,这些更改将会丢失。
//
// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.Library.Infrastructure.Options
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.Library.Infrastructure.Repositories
{
using System;
@@ -15,9 +15,9 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Options\ModuleOptionsConfigure.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\PostgreSQLRepository.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class ModuleOptionsConfigure : ModuleOptionsConfigureBase
+ public partial class PostgreSQLRepository : PostgreSQLRepositoryBase
{
#line hidden
///
@@ -25,38 +25,50 @@ public partial class ModuleOptionsConfigure : ModuleOptionsConfigureBase
///
public virtual string TransformText()
{
- this.Write("using Microsoft.Extensions.Configuration;\r\nusing Microsoft.Extensions.DependencyI" +
- "njection;\r\nusing ");
+ this.Write(" using ");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Options\ModuleOptionsConfigure.tt"
+ #line 2 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\PostgreSQLRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
- this.Write(".Lib.Utils.Core.Options;\r\n\r\nnamespace ");
+ this.Write(".Lib.Data.Abstractions;\r\n\r\nnamespace ");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Options\ModuleOptionsConfigure.tt"
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\PostgreSQLRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Options\ModuleOptionsConfigure.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\PostgreSQLRepository.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
- this.Write(".Infrastructure.Options\r\n{\r\n public class ModuleOptionsConfigure : IModuleOpti" +
- "onsConfigure\r\n {\r\n public void ConfigOptions(IServiceCollection servic" +
- "es, IConfiguration configuration)\r\n {\r\n services.Configure<");
+ this.Write(".Infrastructure.Repositories.PostgreSQL\r\n{\r\n public class ");
- #line 12 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Options\ModuleOptionsConfigure.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\PostgreSQLRepository.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
- this.Write("Options>(configuration);\r\n }\r\n }\r\n}\r\n");
+ this.Write("Repository : SqlServer.");
+
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\PostgreSQLRepository.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
+
+ #line default
+ #line hidden
+ this.Write("Repository\r\n {\r\n public ");
+
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\PostgreSQLRepository.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
+
+ #line default
+ #line hidden
+ this.Write("Repository(IDbContext dbContext) : base(dbContext)\r\n {\r\n }\r\n }\r\n" +
+ "}");
return this.GenerationEnvironment.ToString();
}
}
@@ -68,7 +80,7 @@ public virtual string TransformText()
/// Base class for this transformation
///
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class ModuleOptionsConfigureBase
+ public class PostgreSQLRepositoryBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/PostgreSQLRepository.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/PostgreSQLRepository.tt
new file mode 100644
index 0000000..2fbd07e
--- /dev/null
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/PostgreSQLRepository.tt
@@ -0,0 +1,12 @@
+<#@ template language="C#" #>
+ using <#= _prefix #>.Lib.Data.Abstractions;
+
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Infrastructure.Repositories.PostgreSQL
+{
+ public class <#= _class.Name #>Repository : SqlServer.<#= _class.Name #>Repository
+ {
+ public <#= _class.Name #>Repository(IDbContext dbContext) : base(dbContext)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SQLiteRepository.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SQLiteRepository.Extend.cs
index 8ace011..26556fe 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SQLiteRepository.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SQLiteRepository.Extend.cs
@@ -13,19 +13,20 @@ public partial class SQLiteRepository : ITemplateHandler
public SQLiteRepository(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => false;
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Infrastructure/Repositories/SQLite");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Infrastructure/Repositories/SQLite");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SQLiteRepository.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SQLiteRepository.cs
index 02f65cd..2f8fb99 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SQLiteRepository.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SQLiteRepository.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SQLiteRepository.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SQLiteRepository.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class SQLiteRepository : SQLiteRepositoryBase
{
@@ -27,42 +27,42 @@ public virtual string TransformText()
{
this.Write("using ");
- #line 2 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SQLiteRepository.tt"
+ #line 2 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SQLiteRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Data.Abstractions;\r\n\r\nnamespace ");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SQLiteRepository.tt"
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SQLiteRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SQLiteRepository.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SQLiteRepository.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Infrastructure.Repositories.SQLite\r\n{\r\n public class ");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SQLiteRepository.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SQLiteRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Repository : SqlServer.");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SQLiteRepository.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SQLiteRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Repository\r\n {\r\n public ");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SQLiteRepository.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SQLiteRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SQLiteRepository.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SQLiteRepository.tt
index 0a18027..aa81377 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SQLiteRepository.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SQLiteRepository.tt
@@ -1,7 +1,7 @@
<#@ template language="C#" #>
using <#= _prefix #>.Lib.Data.Abstractions;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Infrastructure.Repositories.SQLite
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Infrastructure.Repositories.SQLite
{
public class <#= _class.Name #>Repository : SqlServer.<#= _class.Name #>Repository
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SqlServerRepository.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SqlServerRepository.Extend.cs
index 31f3fc5..a28bf24 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SqlServerRepository.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SqlServerRepository.Extend.cs
@@ -13,18 +13,20 @@ public partial class SqlServerRepository : ITemplateHandler
public SqlServerRepository(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => false;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Library/Infrastructure/Repositories/SqlServer");
+ var dir = Path.Combine(_model.RootPath, "src/Library/Infrastructure/Repositories/SqlServer");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SqlServerRepository.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SqlServerRepository.cs
index 905bfce..463b9a2 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SqlServerRepository.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SqlServerRepository.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class SqlServerRepository : SqlServerRepositoryBase
{
@@ -28,126 +28,126 @@ public virtual string TransformText()
this.Write("using System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Threading.Tas" +
"ks;\r\nusing ");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Data.Abstractions;\r\nusing ");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Data.Core;\r\nusing ");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Data.Query;\r\n");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
if(_class.IsEntityBase){
#line default
#line hidden
this.Write("using ");
- #line 9 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 9 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.Admin.Domain.Account;\r\n");
- #line 10 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 10 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
}
#line default
#line hidden
this.Write("using ");
- #line 11 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 11 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 11 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 11 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 11 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 11 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write(";\r\nusing ");
- #line 12 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 12 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 12 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 12 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 12 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 12 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write(".Models;\r\n\r\nnamespace ");
- #line 14 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 14 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 14 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 14 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Infrastructure.Repositories.SqlServer\r\n{\r\n public class ");
- #line 16 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 16 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Repository : RepositoryAbstract<");
- #line 16 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 16 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Entity>, I");
- #line 16 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 16 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Repository\r\n {\r\n public ");
- #line 18 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 18 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
@@ -155,14 +155,14 @@ public virtual string TransformText()
this.Write("Repository(IDbContext context) : base(context)\r\n {\r\n }\r\n\r\n p" +
"ublic async Task> Query(");
- #line 22 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 22 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
@@ -170,7 +170,7 @@ public virtual string TransformText()
this.Write("QueryModel model)\r\n {\r\n var paging = model.Paging();\r\n\r\n " +
" var query = Db.Find();\r\n\r\n");
- #line 28 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 28 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
if(_class.IsEntityBase){
#line default
@@ -185,7 +185,7 @@ public virtual string TransformText()
var result = await joinQuery.PaginationAsync(paging);
");
- #line 37 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 37 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
} else {
#line default
@@ -194,7 +194,7 @@ public virtual string TransformText()
"rByDescending(m => m.Id);\r\n }\r\n\r\n var result = await query" +
".PaginationAsync(paging);\r\n");
- #line 44 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
+ #line 44 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Library\Infrastructure\Repositories\SqlServerRepository.tt"
}
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SqlServerRepository.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SqlServerRepository.tt
index 4e5b718..a0bcaf4 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SqlServerRepository.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Library/Infrastructure/Repositories/SqlServerRepository.tt
@@ -8,10 +8,10 @@ using <#= _prefix #>.Lib.Data.Query;
<# if(_class.IsEntityBase){ #>
using <#= _prefix #>.Module.Admin.Domain.Account;
<# } #>
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>;
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>.Models;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>.Models;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Infrastructure.Repositories.SqlServer
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Infrastructure.Repositories.SqlServer
{
public class <#= _class.Name #>Repository : RepositoryAbstract<<#= _class.Name #>Entity>, I<#= _class.Name #>Repository
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/BabelConfig.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/BabelConfig.Extend.cs
index 9c7d495..b8b3064 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/BabelConfig.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/BabelConfig.Extend.cs
@@ -12,9 +12,11 @@ public BabelConfig(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/BabelConfig.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/BabelConfig.cs
index a560cf5..4661de3 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/BabelConfig.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/BabelConfig.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\BabelConfig.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\BabelConfig.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class BabelConfig : BabelConfigBase
{
@@ -25,8 +25,8 @@ public partial class BabelConfig : BabelConfigBase
///
public virtual string TransformText()
{
- this.Write("module.exports = {\r\n presets: [\r\n [\r\n \'@vue/app\',\r\n {\r\n useB" +
- "uiltIns: \'entry\'\r\n }\r\n ]\r\n ]\r\n}\r\n");
+ this.Write("module.exports = {\r\n presets: [\r\n [\r\n \'@vue/cli-plugin-babel/preset\',\r\n " +
+ " {\r\n useBuiltIns: \'entry\'\r\n }\r\n ]\r\n ]\r\n}\r\n");
return this.GenerationEnvironment.ToString();
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/BabelConfig.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/BabelConfig.tt
index f1d4510..00892ae 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/BabelConfig.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/BabelConfig.tt
@@ -1,8 +1,7 @@
-<#@ template language="C#" #>
module.exports = {
presets: [
[
- '@vue/app',
+ '@vue/cli-plugin-babel/preset',
{
useBuiltIns: 'entry'
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Browserslistrc.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Browserslistrc.Extend.cs
index 4fa1ae3..86451d0 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Browserslistrc.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Browserslistrc.Extend.cs
@@ -12,9 +12,11 @@ public Browserslistrc(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Browserslistrc.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Browserslistrc.cs
index 56495fb..ae273ab 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Browserslistrc.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Browserslistrc.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Browserslistrc.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Browserslistrc.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Browserslistrc : BrowserslistrcBase
{
@@ -25,7 +25,7 @@ public partial class Browserslistrc : BrowserslistrcBase
///
public virtual string TransformText()
{
- this.Write("> 1%\r\nlast 2 versions\r\nnot ie <= 8\r\n");
+ this.Write("> 1%\r\nlast 2 versions");
return this.GenerationEnvironment.ToString();
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Browserslistrc.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Browserslistrc.tt
index 3136930..2061d50 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Browserslistrc.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Browserslistrc.tt
@@ -1,4 +1,3 @@
<#@ template language="C#" #>
> 1%
-last 2 versions
-not ie <= 8
+last 2 versions
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/EditorConfig.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/EditorConfig.cs
deleted file mode 100644
index d466c18..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/EditorConfig.cs
+++ /dev/null
@@ -1,308 +0,0 @@
-// ------------------------------------------------------------------------------
-//
-// ˴ɹɡ
-// ʱ汾: 16.0.0.0
-//
-// ԴļĸĿܵ²ȷΪ
-// ɴ룬ЩĽᶪʧ
-//
-// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.UI.App
-{
- using System;
-
- ///
- /// Class to produce the template output
- ///
-
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\EditorConfig.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class EditorConfig : EditorConfigBase
- {
-#line hidden
- ///
- /// Create the template output
- ///
- public virtual string TransformText()
- {
- this.Write("[*.{js,jsx,ts,tsx,vue}]\r\nindent_style = space\r\nindent_size = 2\r\ntrim_trailing_whi" +
- "tespace = true\r\ninsert_final_newline = true\r\n");
- return this.GenerationEnvironment.ToString();
- }
- }
-
- #line default
- #line hidden
- #region Base class
- ///
- /// Base class for this transformation
- ///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class EditorConfigBase
- {
- #region Fields
- private global::System.Text.StringBuilder generationEnvironmentField;
- private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
- private global::System.Collections.Generic.List indentLengthsField;
- private string currentIndentField = "";
- private bool endsWithNewline;
- private global::System.Collections.Generic.IDictionary sessionField;
- #endregion
- #region Properties
- ///
- /// The string builder that generation-time code is using to assemble generated output
- ///
- protected System.Text.StringBuilder GenerationEnvironment
- {
- get
- {
- if ((this.generationEnvironmentField == null))
- {
- this.generationEnvironmentField = new global::System.Text.StringBuilder();
- }
- return this.generationEnvironmentField;
- }
- set
- {
- this.generationEnvironmentField = value;
- }
- }
- ///
- /// The error collection for the generation process
- ///
- public System.CodeDom.Compiler.CompilerErrorCollection Errors
- {
- get
- {
- if ((this.errorsField == null))
- {
- this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
- }
- return this.errorsField;
- }
- }
- ///
- /// A list of the lengths of each indent that was added with PushIndent
- ///
- private System.Collections.Generic.List indentLengths
- {
- get
- {
- if ((this.indentLengthsField == null))
- {
- this.indentLengthsField = new global::System.Collections.Generic.List();
- }
- return this.indentLengthsField;
- }
- }
- ///
- /// Gets the current indent we use when adding lines to the output
- ///
- public string CurrentIndent
- {
- get
- {
- return this.currentIndentField;
- }
- }
- ///
- /// Current transformation session
- ///
- public virtual global::System.Collections.Generic.IDictionary Session
- {
- get
- {
- return this.sessionField;
- }
- set
- {
- this.sessionField = value;
- }
- }
- #endregion
- #region Transform-time helpers
- ///
- /// Write text directly into the generated output
- ///
- public void Write(string textToAppend)
- {
- if (string.IsNullOrEmpty(textToAppend))
- {
- return;
- }
- // If we're starting off, or if the previous text ended with a newline,
- // we have to append the current indent first.
- if (((this.GenerationEnvironment.Length == 0)
- || this.endsWithNewline))
- {
- this.GenerationEnvironment.Append(this.currentIndentField);
- this.endsWithNewline = false;
- }
- // Check if the current text ends with a newline
- if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
- {
- this.endsWithNewline = true;
- }
- // This is an optimization. If the current indent is "", then we don't have to do any
- // of the more complex stuff further down.
- if ((this.currentIndentField.Length == 0))
- {
- this.GenerationEnvironment.Append(textToAppend);
- return;
- }
- // Everywhere there is a newline in the text, add an indent after it
- textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
- // If the text ends with a newline, then we should strip off the indent added at the very end
- // because the appropriate indent will be added when the next time Write() is called
- if (this.endsWithNewline)
- {
- this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
- }
- else
- {
- this.GenerationEnvironment.Append(textToAppend);
- }
- }
- ///
- /// Write text directly into the generated output
- ///
- public void WriteLine(string textToAppend)
- {
- this.Write(textToAppend);
- this.GenerationEnvironment.AppendLine();
- this.endsWithNewline = true;
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void Write(string format, params object[] args)
- {
- this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void WriteLine(string format, params object[] args)
- {
- this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Raise an error
- ///
- public void Error(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- this.Errors.Add(error);
- }
- ///
- /// Raise a warning
- ///
- public void Warning(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- error.IsWarning = true;
- this.Errors.Add(error);
- }
- ///
- /// Increase the indent
- ///
- public void PushIndent(string indent)
- {
- if ((indent == null))
- {
- throw new global::System.ArgumentNullException("indent");
- }
- this.currentIndentField = (this.currentIndentField + indent);
- this.indentLengths.Add(indent.Length);
- }
- ///
- /// Remove the last indent that was added with PushIndent
- ///
- public string PopIndent()
- {
- string returnValue = "";
- if ((this.indentLengths.Count > 0))
- {
- int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
- this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
- if ((indentLength > 0))
- {
- returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
- this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
- }
- }
- return returnValue;
- }
- ///
- /// Remove any indentation
- ///
- public void ClearIndent()
- {
- this.indentLengths.Clear();
- this.currentIndentField = "";
- }
- #endregion
- #region ToString Helpers
- ///
- /// Utility class to produce culture-oriented representation of an object as a string.
- ///
- public class ToStringInstanceHelper
- {
- private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
- ///
- /// Gets or sets format provider to be used by ToStringWithCulture method.
- ///
- public System.IFormatProvider FormatProvider
- {
- get
- {
- return this.formatProviderField ;
- }
- set
- {
- if ((value != null))
- {
- this.formatProviderField = value;
- }
- }
- }
- ///
- /// This is called from the compile/run appdomain to convert objects within an expression block to a string
- ///
- public string ToStringWithCulture(object objectToConvert)
- {
- if ((objectToConvert == null))
- {
- throw new global::System.ArgumentNullException("objectToConvert");
- }
- System.Type t = objectToConvert.GetType();
- System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
- typeof(System.IFormatProvider)});
- if ((method == null))
- {
- return objectToConvert.ToString();
- }
- else
- {
- return ((string)(method.Invoke(objectToConvert, new object[] {
- this.formatProviderField })));
- }
- }
- }
- private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
- ///
- /// Helper to produce culture-oriented representation of an object as a string
- ///
- public ToStringInstanceHelper ToStringHelper
- {
- get
- {
- return this.toStringHelperField;
- }
- }
- #endregion
- }
- #endregion
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/EditorConfig.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/EditorConfig.tt
deleted file mode 100644
index 53d8afb..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/EditorConfig.tt
+++ /dev/null
@@ -1,6 +0,0 @@
-<#@ template language="C#" #>
-[*.{js,jsx,ts,tsx,vue}]
-indent_style = space
-indent_size = 2
-trim_trailing_whitespace = true
-insert_final_newline = true
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Eslintrc.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Eslintrc.Extend.cs
index b8b898b..7867c83 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Eslintrc.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Eslintrc.Extend.cs
@@ -12,9 +12,11 @@ public Eslintrc(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Eslintrc.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Eslintrc.cs
index c240df7..f4a1e76 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Eslintrc.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Eslintrc.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Eslintrc.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Eslintrc.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Eslintrc : EslintrcBase
{
@@ -26,22 +26,22 @@ public partial class Eslintrc : EslintrcBase
public virtual string TransformText()
{
this.Write(@"module.exports = {
- root: true,
+ root: true,
env: {
node: true
},
- extends: ['plugin:vue/essential', '@vue/standard'],
+ extends: ['plugin:vue/essential', '@vue/prettier'],
rules: {
- 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
- 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
- 'space-before-function-paren': 'off'
+ 'no-console': 'off',
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
- },
+ },
globals: {
- $http: 'readonly',
- $api: 'readonly'
+ $http: 'readonly',
+ $api: 'readonly',
+ $const: 'readonly'
}
}
");
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Eslintrc.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Eslintrc.tt
index 135fbd7..4ab8d9c 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Eslintrc.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Eslintrc.tt
@@ -1,20 +1,19 @@
-<#@ template language="C#" #>
module.exports = {
- root: true,
+ root: true,
env: {
node: true
},
- extends: ['plugin:vue/essential', '@vue/standard'],
+ extends: ['plugin:vue/essential', '@vue/prettier'],
rules: {
- 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
- 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
- 'space-before-function-paren': 'off'
+ 'no-console': 'off',
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
- },
+ },
globals: {
- $http: 'readonly',
- $api: 'readonly'
+ $http: 'readonly',
+ $api: 'readonly',
+ $const: 'readonly'
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Package.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Package.Extend.cs
index fcdb581..25bd489 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Package.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Package.Extend.cs
@@ -11,12 +11,14 @@ public partial class Package : ITemplateHandler
public Package(TemplateBuildModel model)
{
_model = model;
- _prefix = _model.Project.Prefix.ToLower();
+ _prefix = _model.Module.Prefix.ToLower();
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Package.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Package.cs
index e065e08..f9919a8 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Package.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Package.cs
@@ -16,7 +16,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Package.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Package.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Package : PackageBase
{
@@ -26,79 +26,82 @@ public partial class Package : PackageBase
///
public virtual string TransformText()
{
- this.Write("{\r\n \"name\": \"");
+ this.Write("{\r\n \"id\": ");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Package.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code.ToLower()));
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Package.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.No));
#line default
#line hidden
- this.Write("-");
+ this.Write(",\r\n \"name\": \"");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Package.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.WebUIDicName));
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Package.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
- this.Write("\",\r\n \"version\": \"1.0.0\",\r\n \"code\": \"");
+ this.Write("-module-");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Package.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code.FirstCharToLower()));
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Package.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code.ToLower()));
#line default
#line hidden
- this.Write("\",\r\n \"title\": \"");
+ this.Write("\",\r\n \"version\": \"1.0.0\",\r\n \"code\": \"");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Package.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Name));
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Package.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code.FirstCharToLower()));
#line default
#line hidden
- this.Write("\",\r\n \"description\": \"");
+ this.Write("\",\r\n \"title\": \"");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Package.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Name));
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Package.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Name));
#line default
#line hidden
- this.Write(@""",
- ""main"": ""src/index.js"",
- ""scripts"": {
- ""serve"": ""vue-cli-service serve"",
- ""build"": ""vue-cli-service build"",
- ""lint"": ""vue-cli-service lint"",
- ""dev"": ""cd ../../WebHost && dotnet watch run"",
- ""cm"": ""rimraf node_modules"",
- ""cc"": ""rimraf node_modules/.cache""
- },
- ""dependencies"": {
- """);
+ this.Write("\",\r\n \"description\": \"");
- #line 19 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Package.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
+ #line 9 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Package.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Name));
#line default
#line hidden
- this.Write(@"-module-admin"": ""^1.0.0""
- },
- ""devDependencies"": {
- ""@vue/cli-plugin-babel"": ""^3.11.0"",
- ""@vue/cli-plugin-eslint"": ""^3.11.0"",
- ""@vue/cli-service"": ""^3.11.0"",
- ""@vue/eslint-config-standard"": ""^4.0.0"",
- ""babel-eslint"": ""^10.0.3"",
- ""eslint"": ""^6.2.2"",
- ""eslint-config-elemefe"": ""^0.3.0"",
- ""eslint-plugin-html"": ""^6.0.0"",
- ""eslint-plugin-json"": ""^1.4.0"",
- ""eslint-plugin-vue"": ""^5.2.3"",
- ""fibers"": ""^4.0.1"",
- ""rimraf"": ""^3.0.0"",
- ""sass"": ""^1.22.10"",
- ""sass-loader"": ""^7.3.1"",
- ""uglifyjs-webpack-plugin"": ""^2.2.0"",
- ""vue-template-compiler"": ""^2.6.10""
- }
+ this.Write(@""",
+ ""main"": ""src/index.js"",
+ ""scripts"": {
+ ""serve"": ""vue-cli-service serve"",
+ ""build"": ""vue-cli-service build"",
+ ""lint"": ""vue-cli-service lint"",
+ ""dev"": ""cd ../../WebHost && dotnet watch run"",
+ ""cm"": ""rimraf node_modules"",
+ ""cc"": ""rimraf node_modules/.cache"",
+ ""i"": ""cd ../../../script && npm_install.ps1"",
+ ""up"": ""cd ../../../script && npm_update.ps1"",
+ ""pub"": ""cd ../../../script && npm_publish.ps1""
+ },
+ ""dependencies"": {
+ ""netmodular-module-admin"": ""^1.3.4"",
+ ""netmodular-ui"": ""^2.0.0""
+ },
+ ""devDependencies"": {
+ ""@vue/cli-plugin-babel"": ""^4.3.1"",
+ ""@vue/cli-plugin-eslint"": ""^4.3.1"",
+ ""@vue/cli-plugin-router"": ""^4.3.1"",
+ ""@vue/cli-plugin-vuex"": ""^4.3.1"",
+ ""@vue/cli-service"": ""^4.3.1"",
+ ""@vue/eslint-config-prettier"": ""^5.0.0"",
+ ""babel-eslint"": ""^10.1.0"",
+ ""eslint"": ""^5.16.0"",
+ ""eslint-plugin-prettier"": ""^3.1.3"",
+ ""eslint-plugin-vue"": ""^5.0.0"",
+ ""prettier"": ""^1.18.2"",
+ ""rimraf"": ""^3.0.2"",
+ ""sass"": ""^1.26.3"",
+ ""sass-loader"": ""^8.0.2"",
+ ""vue-template-compiler"": ""^2.6.11""
+ }
}
");
return this.GenerationEnvironment.ToString();
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Package.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Package.tt
index 33c0a19..a0f8e61 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Package.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Package.tt
@@ -1,39 +1,43 @@
<#@ template language="C#" #>
<#@ import namespace="NetModular.Lib.Utils.Core.Extensions" #>
{
- "name": "<#= _model.Project.Code.ToLower() #>-<#= _model.Project.WebUIDicName #>",
- "version": "1.0.0",
- "code": "<#= _model.Project.Code.FirstCharToLower() #>",
- "title": "<#= _model.Project.Name #>",
- "description": "<#= _model.Project.Name #>",
- "main": "src/index.js",
- "scripts": {
- "serve": "vue-cli-service serve",
- "build": "vue-cli-service build",
- "lint": "vue-cli-service lint",
- "dev": "cd ../../WebHost && dotnet watch run",
- "cm": "rimraf node_modules",
- "cc": "rimraf node_modules/.cache"
- },
- "dependencies": {
- "<#= _prefix #>-module-admin": "^1.0.0"
- },
- "devDependencies": {
- "@vue/cli-plugin-babel": "^3.11.0",
- "@vue/cli-plugin-eslint": "^3.11.0",
- "@vue/cli-service": "^3.11.0",
- "@vue/eslint-config-standard": "^4.0.0",
- "babel-eslint": "^10.0.3",
- "eslint": "^6.2.2",
- "eslint-config-elemefe": "^0.3.0",
- "eslint-plugin-html": "^6.0.0",
- "eslint-plugin-json": "^1.4.0",
- "eslint-plugin-vue": "^5.2.3",
- "fibers": "^4.0.1",
- "rimraf": "^3.0.0",
- "sass": "^1.22.10",
- "sass-loader": "^7.3.1",
- "uglifyjs-webpack-plugin": "^2.2.0",
- "vue-template-compiler": "^2.6.10"
- }
+ "id": <#= _model.Module.No #>,
+ "name": "<#= _prefix #>-module-<#= _model.Module.Code.ToLower() #>",
+ "version": "1.0.0",
+ "code": "<#= _model.Module.Code.FirstCharToLower() #>",
+ "title": "<#= _model.Module.Name #>",
+ "description": "<#= _model.Module.Name #>",
+ "main": "src/index.js",
+ "scripts": {
+ "serve": "vue-cli-service serve",
+ "build": "vue-cli-service build",
+ "lint": "vue-cli-service lint",
+ "dev": "cd ../../WebHost && dotnet watch run",
+ "cm": "rimraf node_modules",
+ "cc": "rimraf node_modules/.cache",
+ "i": "cd ../../../script && npm_install.ps1",
+ "up": "cd ../../../script && npm_update.ps1",
+ "pub": "cd ../../../script && npm_publish.ps1"
+ },
+ "dependencies": {
+ "netmodular-module-admin": "^1.3.4",
+ "netmodular-ui": "^2.0.0"
+ },
+ "devDependencies": {
+ "@vue/cli-plugin-babel": "^4.3.1",
+ "@vue/cli-plugin-eslint": "^4.3.1",
+ "@vue/cli-plugin-router": "^4.3.1",
+ "@vue/cli-plugin-vuex": "^4.3.1",
+ "@vue/cli-service": "^4.3.1",
+ "@vue/eslint-config-prettier": "^5.0.0",
+ "babel-eslint": "^10.1.0",
+ "eslint": "^5.16.0",
+ "eslint-plugin-prettier": "^3.1.3",
+ "eslint-plugin-vue": "^5.0.0",
+ "prettier": "^1.18.2",
+ "rimraf": "^3.0.2",
+ "sass": "^1.26.3",
+ "sass-loader": "^8.0.2",
+ "vue-template-compiler": "^2.6.11"
+ }
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/PostcssConfig.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/PostcssConfig.Extend.cs
index 536076d..f1e0bf1 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/PostcssConfig.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/PostcssConfig.Extend.cs
@@ -6,17 +6,17 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
public partial class PostcssConfig : ITemplateHandler
{
private readonly TemplateBuildModel _model;
- private readonly string _prefix;
public PostcssConfig(TemplateBuildModel model)
{
_model = model;
- _prefix = _model.Project.Prefix;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/PostcssConfig.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/PostcssConfig.cs
index 8d19796..884c0fd 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/PostcssConfig.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/PostcssConfig.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\PostcssConfig.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\PostcssConfig.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class PostcssConfig : PostcssConfigBase
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/EditorConfig.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Prettierrc.Extend.cs
similarity index 63%
rename from src/Library/Infrastructure/Templates/Default/T4/src/UI/App/EditorConfig.Extend.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Prettierrc.Extend.cs
index 0ee55a3..db2f691 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/EditorConfig.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Prettierrc.Extend.cs
@@ -3,23 +3,25 @@
namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.UI.App
{
- public partial class EditorConfig : ITemplateHandler
+ public partial class Prettierrc : ITemplateHandler
{
private readonly TemplateBuildModel _model;
- public EditorConfig(TemplateBuildModel model)
+ public Prettierrc(TemplateBuildModel model)
{
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
var content = TransformText();
- var filePath = Path.Combine(dir, ".editorconfig");
+ var filePath = Path.Combine(dir, ".prettierrc");
File.WriteAllText(filePath, content);
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cacheDevelopment.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Prettierrc.cs
similarity index 96%
rename from src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cacheDevelopment.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Prettierrc.cs
index cbb3652..bb11bca 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cacheDevelopment.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Prettierrc.cs
@@ -7,7 +7,7 @@
// 重新生成代码,这些更改将会丢失。
//
// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.UI.App
{
using System;
@@ -15,9 +15,9 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\cacheDevelopment.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\Prettierrc.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class cacheDevelopment : cacheDevelopmentBase
+ public partial class Prettierrc : PrettierrcBase
{
#line hidden
///
@@ -25,7 +25,8 @@ public partial class cacheDevelopment : cacheDevelopmentBase
///
public virtual string TransformText()
{
- this.Write("{}");
+ this.Write("{\r\n \"tabWidth\": 2,\r\n \"semi\": false,\r\n \"singleQuote\": true,\r\n \"printWidth\": 20" +
+ "0\r\n}\r\n");
return this.GenerationEnvironment.ToString();
}
}
@@ -37,7 +38,7 @@ public virtual string TransformText()
/// Base class for this transformation
///
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class cacheDevelopmentBase
+ public class PrettierrcBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Prettierrc.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Prettierrc.tt
new file mode 100644
index 0000000..9e6fef5
--- /dev/null
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/Prettierrc.tt
@@ -0,0 +1,7 @@
+<#@ template language="C#" #>
+{
+ "tabWidth": 2,
+ "semi": false,
+ "singleQuote": true,
+ "printWidth": 200
+}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/VueConfig.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/VueConfig.Extend.cs
index 890f160..1a24794 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/VueConfig.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/VueConfig.Extend.cs
@@ -11,12 +11,14 @@ public partial class VueConfig : ITemplateHandler
public VueConfig(TemplateBuildModel model)
{
_model = model;
- _prefix = _model.Project.Prefix.ToLower();
+ _prefix = _model.Module.Prefix.ToLower();
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/VueConfig.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/VueConfig.cs
index 587ba0c..17d0024 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/VueConfig.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/VueConfig.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class VueConfig : VueConfigBase
{
@@ -25,54 +25,87 @@ public partial class VueConfig : VueConfigBase
///
public virtual string TransformText()
{
- this.Write("const path = require(\'path\')\r\nconst CopyWebpackPlugin = require(\'copy-webpack-plu" +
- "gin\')\r\nconst UglifyJsPlugin = require(\'uglifyjs-webpack-plugin\')\r\nconst isDev = " +
- "process.env.NODE_ENV === \'development\' // \r\n\r\n// ӻ\r\nprocess.env.VUE_APP" +
- "_COPYRIGHT = \'");
+ this.Write("const CopyWebpackPlugin = require(\'copy-webpack-plugin\')\r\nconst TerserPlugin = re" +
+ "quire(\'terser-webpack-plugin\')\r\n\r\n// ӻ\r\nprocess.env.VUE_APP_COPYRIGHT = \'");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Copyright));
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Copyright));
#line default
#line hidden
- this.Write("\'\r\nprocess.env.VUE_APP_BUILD_TIME = require(\'dayjs\')().format(\'YYYYMDHHmmss\')\r\n//" +
- " ·\r\nconst outputDir = \'../../WebHost/wwwroot/app\'\r\n\r\nmodule.exports = {\r\n " +
- "outputDir: outputDir,\r\n publicPath: \'/app\',\r\n devServer: {\r\n port: ");
+ this.Write(@"'
+process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYYMDHHmmss')
+/**дʾ */
+process.env.VUE_APP_CUSTOM_SCRIPTS = ''
+
+const path = require('path')
+//
+const isDev = process.env.NODE_ENV === 'development'
+// ·
+const outputDir = '../../WebHost/wwwroot/app'
+
+module.exports = {
+ outputDir: outputDir,
+ publicPath: './',
+ devServer: {
+ port: ");
- #line 17 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.No + 5220));
+ #line 21 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.No + 5220));
#line default
#line hidden
this.Write("\r\n },\r\n transpileDependencies: [\'");
- #line 19 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
+ #line 23 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
- this.Write("-.*\', \'element-ui\'],\r\n configureWebpack: {\r\n plugins: [\r\n /**\r\n * " +
- "");
+ this.Write("-*\', \'element-ui\'],\r\n configureWebpack() {\r\n let config = {\r\n plugins: [" +
+ "\r\n /**\r\n * ");
- #line 23 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
+ #line 28 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
- this.Write("-ui/publicĿ¼µļĿ¼\r\n */\r\n new CopyWebpackPlugin([\r\n {\r\n " +
- " from: path.join(__dirname, \'node_modules/");
+ this.Write("-ui/publicĿ¼µļĿ¼\r\n */\r\n new CopyWebpackPlugin([\r\n {\r" +
+ "\n from: path.join(__dirname, \'node_modules/");
- #line 27 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
+ #line 32 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(@"-ui/public'),
- to: path.join(__dirname, outputDir),
- ignore: ['index.html']
- }
- ])
- ]
+ to: path.join(__dirname, outputDir),
+ ignore: ['index.html']
+ }
+ ])
+ ]
+ }
+
+ if (!isDev) {
+ //Զѹ
+ config.optimization = {
+ minimize: true,
+ minimizer: [
+ new TerserPlugin({
+ cache: true,
+ parallel: true,
+ sourceMap: false,
+ terserOptions: {
+ compress: {
+ drop_console: true,
+ drop_debugger: true
+ }
+ }
+ })
+ ]
+ }
+ }
+ return config
},
chainWebpack: config => {
/**
@@ -86,7 +119,7 @@ public virtual string TransformText()
/**
* index.htmlģ·ʹ");
- #line 44 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
+ #line 71 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
@@ -94,7 +127,7 @@ public virtual string TransformText()
this.Write("-ui/publicеģ\r\n */\r\n config.plugin(\'html\').tap(args => {\r\n args[0].t" +
"emplate = \'./node_modules/");
- #line 47 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
+ #line 74 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
@@ -112,21 +145,6 @@ public virtual string TransformText()
)
// ǿ
.when(!isDev, config => {
- config.optimization.minimizer([
- new UglifyJsPlugin({
- uglifyOptions: {
- // Ƴ console
- // Żѡ https://segmentfault.com/a/1190000010874406
- warnings: false,
- compress: {
- drop_console: true,
- drop_debugger: true,
- pure_funcs: ['console.log']
- }
- }
- })
- ])
-
//
config.optimization.splitChunks({
chunks: 'all',
@@ -137,16 +155,11 @@ public virtual string TransformText()
test: /[\\/]node_modules[\\/]element-ui(.*)/
},
skins: {
- name: 'chunk-");
-
- #line 85 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
-
- #line default
- #line hidden
- this.Write("-ui\',\r\n priority: 10,\r\n test: /[\\\\/]node_modules[\\\\/]");
+ name: 'chunk-netmodular-ui',
+ priority: 10,
+ test: /[\\/]node_modules[\\/]");
- #line 87 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
+ #line 99 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\VueConfig.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/VueConfig.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/VueConfig.tt
index 9249233..85f54a7 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/VueConfig.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/VueConfig.tt
@@ -1,35 +1,62 @@
<#@ template language="C#" #>
-const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
-const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
-const isDev = process.env.NODE_ENV === 'development' // 开发环境
+const TerserPlugin = require('terser-webpack-plugin')
// 增加环境变量
-process.env.VUE_APP_COPYRIGHT = '<#= _model.Project.Copyright #>'
+process.env.VUE_APP_COPYRIGHT = '<#= _model.Module.Copyright #>'
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYYMDHHmmss')
+/**第三方依赖组件,写法示例: */
+process.env.VUE_APP_CUSTOM_SCRIPTS = ''
+
+const path = require('path')
+// 开发环境
+const isDev = process.env.NODE_ENV === 'development'
// 打包输出路径
const outputDir = '../../WebHost/wwwroot/app'
module.exports = {
outputDir: outputDir,
- publicPath: '/app',
+ publicPath: './',
devServer: {
- port: <#= _model.Project.No + 5220 #>
+ port: <#= _model.Module.No + 5220 #>
},
- transpileDependencies: ['<#= _prefix #>-.*', 'element-ui'],
- configureWebpack: {
- plugins: [
- /**
- * 复制<#= _prefix #>-ui/public目录下的文件到输出目录
- */
- new CopyWebpackPlugin([
- {
- from: path.join(__dirname, 'node_modules/<#= _prefix #>-ui/public'),
- to: path.join(__dirname, outputDir),
- ignore: ['index.html']
- }
- ])
- ]
+ transpileDependencies: ['<#= _prefix #>-*', 'element-ui'],
+ configureWebpack() {
+ let config = {
+ plugins: [
+ /**
+ * 复制<#= _prefix #>-ui/public目录下的文件到输出目录
+ */
+ new CopyWebpackPlugin([
+ {
+ from: path.join(__dirname, 'node_modules/<#= _prefix #>-ui/public'),
+ to: path.join(__dirname, outputDir),
+ ignore: ['index.html']
+ }
+ ])
+ ]
+ }
+
+ if (!isDev) {
+ //自定义代码压缩
+ config.optimization = {
+ minimize: true,
+ minimizer: [
+ new TerserPlugin({
+ cache: true,
+ parallel: true,
+ sourceMap: false,
+ terserOptions: {
+ compress: {
+ drop_console: true,
+ drop_debugger: true
+ }
+ }
+ })
+ ]
+ }
+ }
+ return config
},
chainWebpack: config => {
/**
@@ -57,21 +84,6 @@ module.exports = {
)
// 非开发环境
.when(!isDev, config => {
- config.optimization.minimizer([
- new UglifyJsPlugin({
- uglifyOptions: {
- // 移除 console
- // 其它优化选项 https://segmentfault.com/a/1190000010874406
- warnings: false,
- compress: {
- drop_console: true,
- drop_debugger: true,
- pure_funcs: ['console.log']
- }
- }
- })
- ])
-
// 拆分
config.optimization.splitChunks({
chunks: 'all',
@@ -82,7 +94,7 @@ module.exports = {
test: /[\\/]node_modules[\\/]element-ui(.*)/
},
skins: {
- name: 'chunk-<#= _prefix #>-ui',
+ name: 'chunk-netmodular-ui',
priority: 10,
test: /[\\/]node_modules[\\/]<#= _prefix #>-ui(.*)/
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Index.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Index.Extend.cs
index b9ee4a8..347c128 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Index.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Index.Extend.cs
@@ -12,9 +12,11 @@ public Index(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}/src");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}/src");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Index.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Index.cs
index 199f447..6b23df5 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Index.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Index.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\Index.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\Index.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Index : IndexBase
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Main.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Main.Extend.cs
index 6577828..0ca0fd9 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Main.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Main.Extend.cs
@@ -11,12 +11,14 @@ public partial class Main : ITemplateHandler
public Main(TemplateBuildModel model)
{
_model = model;
- _prefix = _model.Project.Prefix.ToLower();
+ _prefix = _model.Module.Prefix.ToLower();
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}/src");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}/src");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Main.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Main.cs
index f7aac86..2da2a2d 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Main.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Main.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\Main.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\Main.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Main : MainBase
{
@@ -27,22 +27,22 @@ public virtual string TransformText()
{
this.Write("import WebHost from \'");
- #line 2 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\Main.tt"
+ #line 2 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\Main.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write("-module-admin\'\r\nimport config from \'./config\'\r\nimport ");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\Main.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\Main.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(" from \'./index\'\r\n\r\n// עģ\r\nWebHost.registerModule(");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\Main.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\Main.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Main.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Main.tt
index b3a9b9d..9a7f8df 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Main.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Main.tt
@@ -1,10 +1,10 @@
<#@ template language="C#" #>
import WebHost from '<#= _prefix #>-module-admin'
import config from './config'
-import <#= _model.Project.Code #> from './index'
+import <#= _model.Module.Code #> from './index'
// 注入模块
-WebHost.registerModule(<#= _model.Project.Code #>)
+WebHost.registerModule(<#= _model.Module.Code #>)
// 启动
WebHost.start(config)
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Module.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Module.Extend.cs
index b7bf6a5..2e52fa4 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Module.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Module.Extend.cs
@@ -12,9 +12,11 @@ public Module(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}/src");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}/src");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Module.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Module.cs
index 0af7c67..2a99eea 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Module.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Module.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\Module.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\Module.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Module : ModuleBase
{
@@ -25,9 +25,9 @@ public partial class Module : ModuleBase
///
public virtual string TransformText()
{
- this.Write("/** ģϢ */\r\nconst pack = require(\'../package.json\')\r\n\r\nexport default {\r\n name:" +
- " pack.title,\r\n code: pack.code,\r\n version: pack.version,\r\n description: pack." +
- "description\r\n}\r\n");
+ this.Write("/** ģϢ */\r\nconst pack = require(\'../package.json\')\r\n\r\nexport default {\r\n id: p" +
+ "ack.id,\r\n name: pack.title,\r\n code: pack.code,\r\n version: pack.version,\r\n de" +
+ "scription: pack.description\r\n}\r\n");
return this.GenerationEnvironment.ToString();
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Module.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Module.tt
index dcfce9a..5df51ff 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Module.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/Module.tt
@@ -3,6 +3,7 @@
const pack = require('../package.json')
export default {
+ id: pack.id,
name: pack.title,
code: pack.code,
version: pack.version,
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/Index.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/Index.Extend.cs
index bc8bab2..e83ad64 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/Index.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/Index.Extend.cs
@@ -12,9 +12,11 @@ public Index(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}/src/api");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}/src/api");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/Index.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/Index.cs
index ee0647b..09c6309 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/Index.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/Index.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\api\Index.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\api\Index.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Index : IndexBase
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/components/Entity.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/components/Entity.Extend.cs
index 8f7d06e..806c372 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/components/Entity.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/components/Entity.Extend.cs
@@ -1,9 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
+using System.IO;
using System.Linq;
-using System.Text;
-using NetModular.Lib.Utils.Core.Extensions;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.UI.App.src.api.components
@@ -18,17 +14,19 @@ public Entity(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => false;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code,
- $"src/UI/{_model.Project.WebUIDicName}/src/api/components");
+ var dir = Path.Combine(_model.RootPath,
+ $"src/UI/{_model.Module.WebUIDicName}/src/api/components");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/components/Entity.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/components/Entity.cs
index 57045c8..7d9bfcc 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/components/Entity.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/api/components/Entity.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\api\components\Entity.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\api\components\Entity.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Entity : EntityBase
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/Components.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/Components.Extend.cs
index 43b150c..11b9651 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/Components.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/Components.Extend.cs
@@ -11,12 +11,14 @@ public partial class Components : ITemplateHandler
public Components(TemplateBuildModel model)
{
_model = model;
- _prefix = _model.Project.Prefix.ToLower();
+ _prefix = _model.Module.Prefix.ToLower();
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}/src/components");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}/src/components");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/Components.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/Components.cs
index 06fc889..83ab64c 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/Components.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/Components.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\components\Components.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\components\Components.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Components : ComponentsBase
{
@@ -25,15 +25,24 @@ public partial class Components : ComponentsBase
///
public virtual string TransformText()
{
- this.Write("export default []\r\n\r\n/** ȫעʾ */\r\n// import DictionarySelect from \'../views" +
- "/dictionary/select\'\r\n//\r\n// export default [{\r\n// //\r\n// name: \'");
+ this.Write("import library from \'");
- #line 9 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\components\Components.tt"
+ #line 2 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\components\Components.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
- this.Write("-dictionary-select\',\r\n// //\r\n// component: DictionarySelect\r\n// }\r\n// ]\r\n");
+ this.Write(@"-ui/packages/library'
+let components = []
+const requireComponent = require.context('./', true, /index\.vue$/)
+requireComponent.keys().map(fileName => {
+ components.push({
+ name: `${library.prefix.toLowerCase()}-${fileName.split('/')[1]}`,
+ component: requireComponent(fileName).default
+ })
+})
+export default components
+");
return this.GenerationEnvironment.ToString();
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/Components.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/Components.tt
index 2a3484a..5e257e0 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/Components.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/Components.tt
@@ -1,13 +1,11 @@
<#@ template language="C#" #>
-export default []
-
-/** ȫעʾ */
-// import DictionarySelect from '../views/dictionary/select'
-//
-// export default [{
-// //
-// name: '<#= _prefix #>-dictionary-select',
-// //
-// component: DictionarySelect
-// }
-// ]
+import library from '<#= _prefix #>-ui/packages/library'
+let components = []
+const requireComponent = require.context('./', true, /index\.vue$/)
+requireComponent.keys().map(fileName => {
+ components.push({
+ name: `${library.prefix.toLowerCase()}-${fileName.split('/')[1]}`,
+ component: requireComponent(fileName).default
+ })
+})
+export default components
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/ConfigPage.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/ConfigPage.Extend.cs
new file mode 100644
index 0000000..5475133
--- /dev/null
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/ConfigPage.Extend.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.UI.App.src.components
+{
+ public partial class ConfigPage : ITemplateHandler
+ {
+ private readonly TemplateBuildModel _model;
+ private readonly string _prefix;
+ private readonly string _uiPrefix;
+
+ public ConfigPage(TemplateBuildModel model)
+ {
+ _model = model;
+ _prefix = _model.Module.Prefix.ToLower();
+ _uiPrefix = _model.Module.UiPrefix.ToLower();
+ }
+
+ public bool IsGlobal => true;
+
+ public void Save()
+ {
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}/src/components/config-{_model.Module.Code.ToLower()}");
+ if (!Directory.Exists(dir))
+ Directory.CreateDirectory(dir);
+
+ var content = TransformText();
+ var filePath = Path.Combine(dir, "index.vue");
+ File.WriteAllText(filePath, content);
+ }
+ }
+}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwt.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/ConfigPage.cs
similarity index 92%
rename from src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwt.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/ConfigPage.cs
index fe0163e..5571843 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwt.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/ConfigPage.cs
@@ -7,7 +7,7 @@
// ɴ룬ЩĽᶪʧ
//
// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.UI.App.src.components
{
using System;
@@ -15,9 +15,9 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\jwt.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\components\ConfigPage.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class jwt : jwtBase
+ public partial class ConfigPage : ConfigPageBase
{
#line hidden
///
@@ -25,9 +25,39 @@ public partial class jwt : jwtBase
///
public virtual string TransformText()
{
- this.Write("{\r\n //Կ\r\n \"Key\": \"twAJ$j5##pVc5*y&\",\r\n //\r\n \"Issuer\": \"http://www.iamoldl" +
- "i.com\",\r\n //\r\n \"Audience\": \"http://www.iamoldli.com\",\r\n //Ч()\r\n \"Expi" +
- "res\": 120\r\n}");
+ this.Write(@"
+
+
+
+
+
+");
return this.GenerationEnvironment.ToString();
}
}
@@ -39,7 +69,7 @@ public virtual string TransformText()
/// Base class for this transformation
///
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class jwtBase
+ public class ConfigPageBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/ConfigPage.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/ConfigPage.tt
new file mode 100644
index 0000000..031f27d
--- /dev/null
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/components/ConfigPage.tt
@@ -0,0 +1,33 @@
+<#@ template language="C#" #>
+
+
+
+
+
+
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/config/Config.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/config/Config.Extend.cs
index 6f782af..d3d13a4 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/config/Config.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/config/Config.Extend.cs
@@ -12,9 +12,11 @@ public Config(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}/src/config");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}/src/config");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/config/Config.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/config/Config.cs
index b90a98e..d73e534 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/config/Config.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/config/Config.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\config\Config.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\config\Config.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Config : ConfigBase
{
@@ -26,10 +26,10 @@ public partial class Config : ConfigBase
public virtual string TransformText()
{
this.Write("const isDev = process.env.NODE_ENV !== \'production\'\r\n\r\nconst config = {\r\n baseUr" +
- "l: \'/api/\'\r\n}\r\n\r\n// ģʽ\r\nif (isDev) {\r\n config.baseUrl = \'http://localhost:");
+ "l: \'../api/\'\r\n}\r\n\r\n// ģʽ\r\nif (isDev) {\r\n config.baseUrl = \'http://localhost:");
- #line 10 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\config\Config.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(6220 + _model.Project.No));
+ #line 10 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\config\Config.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(6220 + _model.Module.No));
#line default
#line hidden
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/config/Config.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/config/Config.tt
index cf2ca72..b0fd16c 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/config/Config.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/config/Config.tt
@@ -2,11 +2,11 @@
const isDev = process.env.NODE_ENV !== 'production'
const config = {
- baseUrl: '/api/'
+ baseUrl: '../api/'
}
// 开发模式
if (isDev) {
- config.baseUrl = 'http://localhost:<#= 6220 + _model.Project.No #>/api/'
+ config.baseUrl = 'http://localhost:<#= 6220 + _model.Module.No #>/api/'
}
export default config
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/routes/Routes.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/routes/Routes.Extend.cs
index bc7a1c0..f2ee5f8 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/routes/Routes.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/routes/Routes.Extend.cs
@@ -11,12 +11,14 @@ public partial class Routes : ITemplateHandler
public Routes(TemplateBuildModel model)
{
_model = model;
- _prefix = _model.Project.Prefix.ToLower();
+ _prefix = _model.Module.Prefix.ToLower();
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}/src/routes");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}/src/routes");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/routes/Routes.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/routes/Routes.cs
index 660d7a4..8ccc0af 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/routes/Routes.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/routes/Routes.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\routes\Routes.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\routes\Routes.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Routes : RoutesBase
{
@@ -27,14 +27,14 @@ public virtual string TransformText()
{
this.Write("import loadRoutes from \'");
- #line 2 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\routes\Routes.tt"
+ #line 2 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\routes\Routes.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write("-ui/packages/utils/load-routes\'\r\nconst requireComponent = require.context(\'../vie" +
- "ws\', true, /\\page.js$/)\r\nexport default loadRoutes(\r\n requireComponent.keys().m" +
- "ap(fileName => requireComponent(fileName).route)\r\n)\r\n");
+ "ws\', true, /\\page.js$/)\r\nexport default loadRoutes(requireComponent.keys().map(f" +
+ "ileName => requireComponent(fileName).route))\r\n");
return this.GenerationEnvironment.ToString();
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/routes/Routes.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/routes/Routes.tt
index 8c02b6c..b6b61ec 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/routes/Routes.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/routes/Routes.tt
@@ -1,6 +1,4 @@
<#@ template language="C#" #>
import loadRoutes from '<#= _prefix #>-ui/packages/utils/load-routes'
const requireComponent = require.context('../views', true, /\page.js$/)
-export default loadRoutes(
- requireComponent.keys().map(fileName => requireComponent(fileName).route)
-)
+export default loadRoutes(requireComponent.keys().map(fileName => requireComponent(fileName).route))
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/store/Store.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/store/Store.Extend.cs
index 279dec2..abb29e4 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/store/Store.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/store/Store.Extend.cs
@@ -12,9 +12,11 @@ public Store(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}/src/store");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}/src/store");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/store/Store.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/store/Store.cs
index f496b4e..828d158 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/store/Store.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/store/Store.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\store\Store.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\store\Store.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Store : StoreBase
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Add.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Add.Extend.cs
deleted file mode 100644
index ffbf424..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Add.Extend.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System.IO;
-using System.Linq;
-using NetModular.Lib.Utils.Core.Extensions;
-using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.UI.App.src.views.components
-{
- public partial class Add : ITemplateHandler
- {
- private readonly TemplateBuildModel _model;
- private ClassBuildModel _class;
- private readonly string _prefix;
-
- public Add(TemplateBuildModel model)
- {
- _model = model;
- _prefix = _model.Project.Prefix.ToLower();
- }
-
- public void Save()
- {
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
- {
- foreach (var classModel in _model.Project.ClassList)
- {
- _class = classModel;
-
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}/src/views", _class.Name.FirstCharToLower(), "components/add");
- if (!Directory.Exists(dir))
- Directory.CreateDirectory(dir);
-
- //清空
- GenerationEnvironment.Clear();
-
- var content = TransformText();
-
- var filePath = Path.Combine(dir, $"index.vue");
- File.WriteAllText(filePath, content);
- }
- }
- }
- }
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Add.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Add.cs
deleted file mode 100644
index ac218c4..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Add.cs
+++ /dev/null
@@ -1,444 +0,0 @@
-// ------------------------------------------------------------------------------
-//
-// ˴ɹɡ
-// ʱ汾: 16.0.0.0
-//
-// ԴļĸĿܵ²ȷΪ
-// ɴ룬ЩĽᶪʧ
-//
-// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.UI.App.src.views.components
-{
- using NetModular.Lib.Utils.Core.Extensions;
- using System;
-
- ///
- /// Class to produce the template output
- ///
-
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\Add.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class Add : AddBase
- {
-#line hidden
- ///
- /// Create the template output
- ///
- public virtual string TransformText()
- {
- this.Write("\r\n<");
-
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\Add.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
-
- #line default
- #line hidden
- this.Write("-form-dialog ref=\"form\" v-bind=\"form\" v-on=\"on\" :visible.sync=\"visible_\">\r\n \r\n \r\n");
-
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\Add.tt"
- foreach(var p in _class.AddModelPropertyList){
-
- #line default
- #line hidden
- this.Write(" \r\n \r\n \r\n");
-
- #line 11 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\Add.tt"
- }
-
- #line default
- #line hidden
- this.Write(" \r\n \r\n ");
-
- #line 14 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\Add.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
-
- #line default
- #line hidden
- this.Write("-form-dialog>\r\n\r\n
-");
- return this.GenerationEnvironment.ToString();
- }
- }
-
- #line default
- #line hidden
- #region Base class
- ///
- /// Base class for this transformation
- ///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class AddBase
- {
- #region Fields
- private global::System.Text.StringBuilder generationEnvironmentField;
- private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
- private global::System.Collections.Generic.List indentLengthsField;
- private string currentIndentField = "";
- private bool endsWithNewline;
- private global::System.Collections.Generic.IDictionary sessionField;
- #endregion
- #region Properties
- ///
- /// The string builder that generation-time code is using to assemble generated output
- ///
- protected System.Text.StringBuilder GenerationEnvironment
- {
- get
- {
- if ((this.generationEnvironmentField == null))
- {
- this.generationEnvironmentField = new global::System.Text.StringBuilder();
- }
- return this.generationEnvironmentField;
- }
- set
- {
- this.generationEnvironmentField = value;
- }
- }
- ///
- /// The error collection for the generation process
- ///
- public System.CodeDom.Compiler.CompilerErrorCollection Errors
- {
- get
- {
- if ((this.errorsField == null))
- {
- this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
- }
- return this.errorsField;
- }
- }
- ///
- /// A list of the lengths of each indent that was added with PushIndent
- ///
- private System.Collections.Generic.List indentLengths
- {
- get
- {
- if ((this.indentLengthsField == null))
- {
- this.indentLengthsField = new global::System.Collections.Generic.List();
- }
- return this.indentLengthsField;
- }
- }
- ///
- /// Gets the current indent we use when adding lines to the output
- ///
- public string CurrentIndent
- {
- get
- {
- return this.currentIndentField;
- }
- }
- ///
- /// Current transformation session
- ///
- public virtual global::System.Collections.Generic.IDictionary Session
- {
- get
- {
- return this.sessionField;
- }
- set
- {
- this.sessionField = value;
- }
- }
- #endregion
- #region Transform-time helpers
- ///
- /// Write text directly into the generated output
- ///
- public void Write(string textToAppend)
- {
- if (string.IsNullOrEmpty(textToAppend))
- {
- return;
- }
- // If we're starting off, or if the previous text ended with a newline,
- // we have to append the current indent first.
- if (((this.GenerationEnvironment.Length == 0)
- || this.endsWithNewline))
- {
- this.GenerationEnvironment.Append(this.currentIndentField);
- this.endsWithNewline = false;
- }
- // Check if the current text ends with a newline
- if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
- {
- this.endsWithNewline = true;
- }
- // This is an optimization. If the current indent is "", then we don't have to do any
- // of the more complex stuff further down.
- if ((this.currentIndentField.Length == 0))
- {
- this.GenerationEnvironment.Append(textToAppend);
- return;
- }
- // Everywhere there is a newline in the text, add an indent after it
- textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
- // If the text ends with a newline, then we should strip off the indent added at the very end
- // because the appropriate indent will be added when the next time Write() is called
- if (this.endsWithNewline)
- {
- this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
- }
- else
- {
- this.GenerationEnvironment.Append(textToAppend);
- }
- }
- ///
- /// Write text directly into the generated output
- ///
- public void WriteLine(string textToAppend)
- {
- this.Write(textToAppend);
- this.GenerationEnvironment.AppendLine();
- this.endsWithNewline = true;
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void Write(string format, params object[] args)
- {
- this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void WriteLine(string format, params object[] args)
- {
- this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Raise an error
- ///
- public void Error(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- this.Errors.Add(error);
- }
- ///
- /// Raise a warning
- ///
- public void Warning(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- error.IsWarning = true;
- this.Errors.Add(error);
- }
- ///
- /// Increase the indent
- ///
- public void PushIndent(string indent)
- {
- if ((indent == null))
- {
- throw new global::System.ArgumentNullException("indent");
- }
- this.currentIndentField = (this.currentIndentField + indent);
- this.indentLengths.Add(indent.Length);
- }
- ///
- /// Remove the last indent that was added with PushIndent
- ///
- public string PopIndent()
- {
- string returnValue = "";
- if ((this.indentLengths.Count > 0))
- {
- int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
- this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
- if ((indentLength > 0))
- {
- returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
- this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
- }
- }
- return returnValue;
- }
- ///
- /// Remove any indentation
- ///
- public void ClearIndent()
- {
- this.indentLengths.Clear();
- this.currentIndentField = "";
- }
- #endregion
- #region ToString Helpers
- ///
- /// Utility class to produce culture-oriented representation of an object as a string.
- ///
- public class ToStringInstanceHelper
- {
- private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
- ///
- /// Gets or sets format provider to be used by ToStringWithCulture method.
- ///
- public System.IFormatProvider FormatProvider
- {
- get
- {
- return this.formatProviderField ;
- }
- set
- {
- if ((value != null))
- {
- this.formatProviderField = value;
- }
- }
- }
- ///
- /// This is called from the compile/run appdomain to convert objects within an expression block to a string
- ///
- public string ToStringWithCulture(object objectToConvert)
- {
- if ((objectToConvert == null))
- {
- throw new global::System.ArgumentNullException("objectToConvert");
- }
- System.Type t = objectToConvert.GetType();
- System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
- typeof(System.IFormatProvider)});
- if ((method == null))
- {
- return objectToConvert.ToString();
- }
- else
- {
- return ((string)(method.Invoke(objectToConvert, new object[] {
- this.formatProviderField })));
- }
- }
- }
- private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
- ///
- /// Helper to produce culture-oriented representation of an object as a string
- ///
- public ToStringInstanceHelper ToStringHelper
- {
- get
- {
- return this.toStringHelperField;
- }
- }
- #endregion
- }
- #endregion
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Add.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Add.tt
deleted file mode 100644
index 9791a1c..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Add.tt
+++ /dev/null
@@ -1,55 +0,0 @@
-<#@ template language="C#" #>
-<#@ import namespace="NetModular.Lib.Utils.Core.Extensions" #>
-
-<<#= _prefix #>-form-dialog ref="form" v-bind="form" v-on="on" :visible.sync="visible_">
-
-
-<# foreach(var p in _class.AddModelPropertyList){ #>
-
-
-
-<# } #>
-
-
- <#= _prefix #>-form-dialog>
-
-
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Edit.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/SavePage.Extend.cs
similarity index 60%
rename from src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Edit.Extend.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/SavePage.Extend.cs
index dd84ef9..1bddd37 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Edit.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/SavePage.Extend.cs
@@ -1,31 +1,34 @@
using System.IO;
using System.Linq;
-using NetModular.Lib.Utils.Core.Extensions;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.UI.App.src.views.components
{
- public partial class Edit : ITemplateHandler
+ public partial class SavePage : ITemplateHandler
{
private readonly TemplateBuildModel _model;
private ClassBuildModel _class;
private readonly string _prefix;
+ private readonly string _uiPrefix;
- public Edit(TemplateBuildModel model)
+ public SavePage(TemplateBuildModel model)
{
_model = model;
- _prefix = _model.Project.Prefix.ToLower();
+ _prefix = _model.Module.Prefix.ToLower();
+ _uiPrefix = _model.Module.UiPrefix.ToLower();
}
+ public bool IsGlobal => false;
+
public void Save()
{
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}/src/views", _class.Name.FirstCharToLower(), "components/edit");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}/src/views", _class.Name.FirstCharToLower(), "components/save");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Edit.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/SavePage.cs
similarity index 80%
rename from src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Edit.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/SavePage.cs
index 4e8e292..f4c0db0 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Edit.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/SavePage.cs
@@ -16,9 +16,9 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\Edit.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\SavePage.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class Edit : EditBase
+ public partial class SavePage : SavePageBase
{
#line hidden
///
@@ -26,121 +26,121 @@ public partial class Edit : EditBase
///
public virtual string TransformText()
{
- this.Write("\r\n<");
+ this.Write("\r\n <");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\Edit.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\SavePage.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_uiPrefix));
#line default
#line hidden
this.Write("-form-dialog ref=\"form\" v-bind=\"form\" v-on=\"on\" :visible.sync=\"visible_\">\r\n \r\n \r\n");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\Edit.tt"
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\SavePage.tt"
foreach(var p in _class.EditModelPropertyList){
#line default
#line hidden
this.Write(" \r\n \r\n \r\n");
+ this.Write("\" clearable />\r\n \r\n");
- #line 11 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\Edit.tt"
+ #line 11 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\SavePage.tt"
}
#line default
#line hidden
this.Write(" \r\n \r\n ");
- #line 14 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\Edit.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
+ #line 14 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\components\SavePage.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_uiPrefix));
#line default
#line hidden
this.Write("-form-dialog>\r\n\r\n\r\n");
+ this.Write(" },\r\n rules: {}\r\n }\r\n }\r\n }\r\n}\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
}
@@ -152,7 +152,7 @@ public virtual string TransformText()
/// Base class for this transformation
///
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class EditBase
+ public class SavePageBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Edit.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/SavePage.tt
similarity index 68%
rename from src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Edit.tt
rename to src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/SavePage.tt
index 6b48787..2283af9 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/Edit.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/components/SavePage.tt
@@ -1,39 +1,37 @@
<#@ template language="C#" #>
<#@ import namespace="NetModular.Lib.Utils.Core.Extensions" #>
-<<#= _prefix #>-form-dialog ref="form" v-bind="form" v-on="on" :visible.sync="visible_">
+ <<#= _uiPrefix #>-form-dialog ref="form" v-bind="form" v-on="on" :visible.sync="visible_">
<# foreach(var p in _class.EditModelPropertyList){ #>
-
+
<# } #>
- <#= _prefix #>-form-dialog>
+ <#= _uiPrefix #>-form-dialog>
-");
+ this.Write(" }\r\n },\r\n removeAction: api.remove,\r\n buttons: page.buttons" +
+ "\r\n }\r\n }\r\n}\r\n\r\n");
return this.GenerationEnvironment.ToString();
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Index.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Index.tt
index adf664f..67647f8 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Index.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Index.tt
@@ -1,54 +1,51 @@
<#@ template language="C#" #>
<#@ import namespace="NetModular.Lib.Utils.Core.Extensions" #>
- <<#= _prefix #>-container>
- <<#= _prefix #>-list ref="list" v-bind="list">
+ <<#= _uiPrefix #>-container>
+ <<#= _uiPrefix #>-list ref="list" v-bind="list">
-<# foreach(var p in _class.QueryModelPropertyList){ #>
+<# foreach(var p in _class.QueryModelPropertyList){ #>
-
+
<# } #>
- <<#= _prefix #>-button-has :options="buttons.add" @click="add" />
+ <<#= _uiPrefix #>-button v-bind="buttons.add" @click="add" />
-
- <<#= _prefix #>-button-has :options="buttons.edit" @click="edit(row)" />
- <<#= _prefix #>-button-delete :options="buttons.del" :id="row.id" :action="removeAction" @success="refresh"/>
+
+ <<#= _uiPrefix #>-button v-bind="buttons.edit" @click="edit(row)" />
+ <<#= _uiPrefix #>-button-delete v-bind="buttons.del" :id="row.id" :action="removeAction" @success="refresh" />
- <#= _prefix #>-list>
+ <#= _uiPrefix #>-list>
-
-
-
-
- <#= _prefix #>-container>
+
+ <#= _uiPrefix #>-container>
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Page.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Page.Extend.cs
index a2599a2..c01917a 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Page.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Page.Extend.cs
@@ -1,6 +1,5 @@
using System.IO;
using System.Linq;
-using NetModular.Lib.Utils.Core.Extensions;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.UI.App.src.views.index
@@ -15,15 +14,17 @@ public Page(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => false;
+
public void Save()
{
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}/src/views", _class.Name.FirstCharToLower(), "index");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}/src/views", _class.Name.FirstCharToLower(), "index");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Page.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Page.cs
index 1b8b0ec..46f4b25 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Page.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Page.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Page : PageBase
{
@@ -25,37 +25,44 @@ public partial class Page : PageBase
///
public virtual string TransformText()
{
- this.Write("/** ҳϢ */\r\nconst page = new function() {\r\n this.title = \'");
+ this.Write("/** ҳϢ */\r\nconst page = new (function() {\r\n this.title = \'");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
+ #line 4 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Remarks));
#line default
#line hidden
- this.Write("б\'\r\n this.name = \'");
+ this.Write("б\'\r\n this.icon = \'");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code.ToLower()));
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_class.MenuIcon));
+
+ #line default
+ #line hidden
+ this.Write("\'\r\n this.name = \'");
+
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code.ToLower()));
#line default
#line hidden
this.Write("_");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
+ #line 6 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name.ToLower()));
#line default
#line hidden
this.Write("\'\r\n this.path = \'/");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code.ToLower()));
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code.ToLower()));
#line default
#line hidden
this.Write("/");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name.ToLower()));
#line default
@@ -89,21 +96,21 @@ public virtual string TransformText()
permissions: [`${this.name}_delete_delete`]
}
}
-}()
+})()
/** ·Ϣ */
export const route = {
page,
component: () => import(/* webpackChunkName: """);
- #line 40 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 41 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".");
- #line 40 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
+ #line 41 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\src\views\index\Page.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Page.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Page.tt
index 76f8ba3..f544764 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Page.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/src/views/index/Page.tt
@@ -1,9 +1,10 @@
<#@ template language="C#" #>
/** 页面信息 */
-const page = new function() {
+const page = new (function() {
this.title = '<#= _class.Remarks #>列表'
- this.name = '<#= _model.Project.Code.ToLower() #>_<#= _class.Name.ToLower() #>'
- this.path = '/<#= _model.Project.Code.ToLower() #>/<#= _class.Name.ToLower() #>'
+ this.icon = '<#= _class.MenuIcon #>'
+ this.name = '<#= _model.Module.Code.ToLower() #>_<#= _class.Name.ToLower() #>'
+ this.path = '/<#= _model.Module.Code.ToLower() #>/<#= _class.Name.ToLower() #>'
// 关联权限
this.permissions = [`${this.name}_query_get`]
@@ -32,12 +33,12 @@ const page = new function() {
permissions: [`${this.name}_delete_delete`]
}
}
-}()
+})()
/** 路由信息 */
export const route = {
page,
- component: () => import(/* webpackChunkName: "<#= _model.Project.Code #>.<#= _class.Name #>" */ './index')
+ component: () => import(/* webpackChunkName: "<#= _model.Module.Code #>.<#= _class.Name #>" */ './index')
}
export default page
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/vscode/settings.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/vscode/settings.Extend.cs
index 7f1aedf..7292b3d 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/vscode/settings.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/vscode/settings.Extend.cs
@@ -12,10 +12,12 @@ public settings(TemplateBuildModel model)
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
var content = TransformText();
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, $"src/UI/{_model.Project.WebUIDicName}/.vscode");
+ var dir = Path.Combine(_model.RootPath, $"src/UI/{_model.Module.WebUIDicName}/.vscode");
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/vscode/settings.cs b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/vscode/settings.cs
index 296c758..a22f533 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/vscode/settings.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/vscode/settings.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\vscode\settings.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\UI\App\vscode\settings.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class settings : settingsBase
{
@@ -26,33 +26,14 @@ public partial class settings : settingsBase
public virtual string TransformText()
{
this.Write(@"{
- ""editor.formatOnPaste"": true,
- ""editor.formatOnSave"": true,
- ""editor.formatOnType"": true,
- ""prettier.singleQuote"": true,
- ""prettier.semi"": false,
- ""eslint.autoFixOnSave"": true,
- ""vetur.format.defaultFormatter.html"": ""prettyhtml"",
- ""vetur.format.defaultFormatter.js"": ""vscode-typescript"",
- ""vetur.format.defaultFormatterOptions"": {
- ""prettyhtml"": {
- ""printWidth"": 180,
- ""singleQuote"": false,
- ""wrapAttributes"": false,
- ""sortAttributes"": false
- }
- },
- ""eslint.validate"": [
- ""javascript"",
- ""javascriptreact"",
- {
- ""language"": ""vue"",
- ""autoFix"": true
- }
- ],
- ""beautify.config"": {
- ""brace_style"": ""collapse,preserve-inline""
- }
+ ""editor.defaultFormatter"": ""esbenp.prettier-vscode"",
+ ""editor.formatOnPaste"": true,
+ ""editor.formatOnSave"": true,
+ ""editor.formatOnType"": true,
+ ""editor.codeActionsOnSave"": {
+ ""source.fixAll.tslint"": true,
+ ""source.fixAll.eslint"": true
+ }
}");
return this.GenerationEnvironment.ToString();
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/vscode/settings.tt b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/vscode/settings.tt
index b7d9fd0..642a30f 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/vscode/settings.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/UI/App/vscode/settings.tt
@@ -1,30 +1,10 @@
-<#@ template language="C#" #>
{
- "editor.formatOnPaste": true,
- "editor.formatOnSave": true,
- "editor.formatOnType": true,
- "prettier.singleQuote": true,
- "prettier.semi": false,
- "eslint.autoFixOnSave": true,
- "vetur.format.defaultFormatter.html": "prettyhtml",
- "vetur.format.defaultFormatter.js": "vscode-typescript",
- "vetur.format.defaultFormatterOptions": {
- "prettyhtml": {
- "printWidth": 180,
- "singleQuote": false,
- "wrapAttributes": false,
- "sortAttributes": false
- }
- },
- "eslint.validate": [
- "javascript",
- "javascriptreact",
- {
- "language": "vue",
- "autoFix": true
- }
- ],
- "beautify.config": {
- "brace_style": "collapse,preserve-inline"
- }
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
+ "editor.formatOnPaste": true,
+ "editor.formatOnSave": true,
+ "editor.formatOnType": true,
+ "editor.codeActionsOnSave": {
+ "source.fixAll.tslint": true,
+ "source.fixAll.eslint": true
+ }
}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Web/Controllers/Controller.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Web/Controllers/Controller.Extend.cs
index 5aa74c7..97d705e 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Web/Controllers/Controller.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Web/Controllers/Controller.Extend.cs
@@ -13,18 +13,20 @@ public partial class Controller : ITemplateHandler
public Controller(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => false;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Web/Controllers");
+ var dir = Path.Combine(_model.RootPath, "src/Web/Controllers");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
- if (_model.Project.ClassList != null && _model.Project.ClassList.Any())
+ if (_model.Module.ClassList != null && _model.Module.ClassList.Any())
{
- foreach (var classModel in _model.Project.ClassList)
+ foreach (var classModel in _model.Module.ClassList)
{
_class = classModel;
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Web/Controllers/Controller.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Web/Controllers/Controller.cs
index e5492c9..b4cff80 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Web/Controllers/Controller.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Web/Controllers/Controller.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class Controller : ControllerBase
{
@@ -29,126 +29,126 @@ public virtual string TransformText()
" Microsoft.AspNetCore.Mvc;\r\nusing Microsoft.AspNetCore.Mvc.ModelBinding;\r\nusing " +
"");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Utils.Core.Result;\r\nusing ");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Application.");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Service;\r\nusing ");
- #line 9 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 9 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 9 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 9 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Application.");
- #line 9 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 9 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Service.ViewModels;\r\nusing ");
- #line 10 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 10 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 10 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 10 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Domain.");
- #line 10 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 10 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write(".Models;\r\n\r\nnamespace ");
- #line 12 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 12 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 12 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 12 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Web.Controllers\r\n{\r\n [Description(\"");
- #line 14 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 14 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Remarks));
#line default
#line hidden
this.Write("管理\")]\r\n public class ");
- #line 15 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 15 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Controller : ModuleController\r\n {\r\n private readonly I");
- #line 17 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 17 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Service _service;\r\n\r\n public ");
- #line 19 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 19 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Controller(I");
- #line 19 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 19 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
#line hidden
this.Write("Service service)\r\n {\r\n _service = service;\r\n }\r\n\r\n");
- #line 24 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 24 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
if(_class.Method.Query) {
#line default
@@ -156,7 +156,7 @@ public virtual string TransformText()
this.Write(" [HttpGet]\r\n [Description(\"查询\")]\r\n public Task" +
" Query([FromQuery]");
- #line 27 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 27 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
@@ -164,13 +164,13 @@ public virtual string TransformText()
this.Write("QueryModel model)\r\n {\r\n return _service.Query(model);\r\n " +
"}\r\n\r\n");
- #line 32 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 32 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
}
#line default
#line hidden
- #line 33 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 33 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
if(_class.Method.Add) {
#line default
@@ -178,7 +178,7 @@ public virtual string TransformText()
this.Write(" [HttpPost]\r\n [Description(\"添加\")]\r\n public Task Add(");
- #line 36 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 36 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
@@ -186,13 +186,13 @@ public virtual string TransformText()
this.Write("AddModel model)\r\n {\r\n return _service.Add(model);\r\n }\r\n\r" +
"\n");
- #line 41 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 41 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
}
#line default
#line hidden
- #line 42 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 42 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
if(_class.Method.Delete) {
#line default
@@ -200,20 +200,20 @@ public virtual string TransformText()
this.Write(" [HttpDelete]\r\n [Description(\"删除\")]\r\n public Task Delete([BindRequired]");
- #line 45 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 45 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.PrimaryKeyTypeName));
#line default
#line hidden
this.Write(" id)\r\n {\r\n return _service.Delete(id);\r\n }\r\n\r\n");
- #line 50 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 50 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
}
#line default
#line hidden
- #line 51 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 51 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
if(_class.Method.Edit) {
#line default
@@ -221,7 +221,7 @@ public virtual string TransformText()
this.Write(" [HttpGet]\r\n [Description(\"编辑\")]\r\n public Task" +
" Edit([BindRequired]");
- #line 54 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 54 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.PrimaryKeyTypeName));
#line default
@@ -229,7 +229,7 @@ public virtual string TransformText()
this.Write(" id)\r\n {\r\n return _service.Edit(id);\r\n }\r\n\r\n [Htt" +
"pPost]\r\n [Description(\"修改\")]\r\n public Task Update(");
- #line 61 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 61 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_class.Name));
#line default
@@ -237,7 +237,7 @@ public virtual string TransformText()
this.Write("UpdateModel model)\r\n {\r\n return _service.Update(model);\r\n " +
" }\r\n");
- #line 65 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
+ #line 65 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Controllers\Controller.tt"
}
#line default
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Web/Controllers/Controller.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Web/Controllers/Controller.tt
index e964f39..6d7eab4 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Web/Controllers/Controller.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Web/Controllers/Controller.tt
@@ -5,11 +5,11 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using <#= _prefix #>.Lib.Utils.Core.Result;
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Application.<#= _class.Name #>Service;
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Application.<#= _class.Name #>Service.ViewModels;
-using <#= _prefix #>.Module.<#= _model.Project.Code #>.Domain.<#= _class.Name #>.Models;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Application.<#= _class.Name #>Service;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Application.<#= _class.Name #>Service.ViewModels;
+using <#= _prefix #>.Module.<#= _model.Module.Code #>.Domain.<#= _class.Name #>.Models;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Web.Controllers
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Web.Controllers
{
[Description("<#= _class.Remarks #>管理")]
public class <#= _class.Name #>Controller : ModuleController
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Web/Csproj.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Web/Csproj.Extend.cs
index 5af2cc7..956ccdf 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Web/Csproj.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Web/Csproj.Extend.cs
@@ -1,4 +1,5 @@
using System.IO;
+using NetModular.Module.CodeGenerator.Infrastructure.NuGet;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.Web
@@ -7,16 +8,20 @@ public partial class Csproj : ITemplateHandler
{
private readonly TemplateBuildModel _model;
private readonly string _prefix;
+ private readonly NuGetPackageVersions _versions;
public Csproj(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
+ _versions = _model.NuGetPackageVersions;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Web");
+ var dir = Path.Combine(_model.RootPath, "src/Web");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Web/Csproj.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Web/Csproj.cs
index c85140b..9540863 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Web/Csproj.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Web/Csproj.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
//
// 此代码由工具生成。
-// 运行时版本: 16.0.0.0
+// 运行时版本: 17.0.0.0
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,这些更改将会丢失。
@@ -15,8 +15,8 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Csproj.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ #line 1 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Csproj.tt"
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class Csproj : CsprojBase
{
#line hidden
@@ -25,40 +25,82 @@ public partial class Csproj : CsprojBase
///
public virtual string TransformText()
{
- this.Write("\r\n\r\n \r\n netc" +
- "oreapp3.0\r\n false\r\n \r\n\r\n \r\n \r\n\r\n \r\n false\r\n \r\n\r\n \r\n\t<" +
+ "PackageReference Include=\"");
- #line 10 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Csproj.tt"
+ #line 9 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Csproj.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
- this.Write(".Lib.Auth.Web\" Version=\"1.4.0\" />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n\r\n");
+ this.Write(".Lib.Validation.FluentValidation\" Version=\"");
+
+ #line 12 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\Csproj.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_versions.Lib_Validation_FluentValidation));
+
+ #line default
+ #line hidden
+ this.Write(@""" />
+
+
+
+
+
+
+
+
+
+ true
+ true
+ Always
+
+
+
+
+");
return this.GenerationEnvironment.ToString();
}
}
@@ -69,7 +111,7 @@ public virtual string TransformText()
///
/// Base class for this transformation
///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class CsprojBase
{
#region Fields
@@ -84,7 +126,7 @@ public class CsprojBase
///
/// The string builder that generation-time code is using to assemble generated output
///
- protected System.Text.StringBuilder GenerationEnvironment
+ public System.Text.StringBuilder GenerationEnvironment
{
get
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Web/Csproj.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Web/Csproj.tt
index 54b321b..631acaf 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Web/Csproj.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Web/Csproj.tt
@@ -2,19 +2,27 @@
- netcoreapp3.0
false
-
-
-
-
+
+
+
+
+
+
+
+
+ true
+ true
+ Always
+
+
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleController.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleController.Extend.cs
index 4f95502..0b87953 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleController.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleController.Extend.cs
@@ -11,12 +11,14 @@ public partial class ModuleController : ITemplateHandler
public ModuleController(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Web");
+ var dir = Path.Combine(_model.RootPath, "src/Web");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleController.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleController.cs
index 95d7587..c69a26c 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleController.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleController.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleController.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleController.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class ModuleController : ModuleControllerBase
{
@@ -27,29 +27,29 @@ public virtual string TransformText()
{
this.Write("using Microsoft.AspNetCore.Mvc;\r\nusing ");
- #line 3 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleController.tt"
+ #line 3 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleController.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Auth.Web;\r\n\r\nnamespace ");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleController.tt"
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleController.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleController.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleController.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
this.Write(".Web\r\n{\r\n [Area(\"");
- #line 7 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleController.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleController.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleController.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleController.tt
index 5735ebb..382db2f 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleController.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleController.tt
@@ -2,9 +2,9 @@
using Microsoft.AspNetCore.Mvc;
using <#= _prefix #>.Lib.Auth.Web;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Web
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Web
{
- [Area("<#= _model.Project.Code #>")]
+ [Area("<#= _model.Module.Code #>")]
public abstract class ModuleController : ControllerAbstract
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleInitializer.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleInitializer.Extend.cs
index f1c949d..7bde869 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleInitializer.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleInitializer.Extend.cs
@@ -11,12 +11,14 @@ public partial class ModuleInitializer : ITemplateHandler
public ModuleInitializer(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/Web");
+ var dir = Path.Combine(_model.RootPath, "src/Web");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleInitializer.cs b/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleInitializer.cs
index 2d45afc..c5f11db 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleInitializer.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleInitializer.cs
@@ -15,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleInitializer.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleInitializer.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
public partial class ModuleInitializer : ModuleInitializerBase
{
@@ -26,25 +26,32 @@ public partial class ModuleInitializer : ModuleInitializerBase
public virtual string TransformText()
{
this.Write("using Microsoft.AspNetCore.Builder;\r\nusing Microsoft.AspNetCore.Mvc;\r\nusing Micro" +
- "soft.Extensions.DependencyInjection;\r\nusing Microsoft.Extensions.Hosting;\r\nusing" +
- " ");
+ "soft.Extensions.Configuration;\r\nusing Microsoft.Extensions.DependencyInjection;\r" +
+ "\nusing Microsoft.Extensions.Hosting;\r\nusing ");
- #line 6 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleInitializer.tt"
+ #line 7 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleInitializer.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
+
+ #line default
+ #line hidden
+ this.Write(".Lib.Module.Abstractions;\r\nusing ");
+
+ #line 8 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleInitializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Module.AspNetCore;\r\n\r\nnamespace ");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleInitializer.tt"
+ #line 10 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleInitializer.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 8 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleInitializer.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 10 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\Web\ModuleInitializer.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
@@ -55,16 +62,13 @@ public class ModuleInitializer : IModuleInitializer
///
/// 注入服务
///
- ///
- public void ConfigureServices(IServiceCollection services)
+ public void ConfigureServices(IServiceCollection services, IModuleCollection modules, IHostEnvironment env, IConfiguration cfg)
{
}
///
/// 配置中间件
///
- ///
- ///
public void Configure(IApplicationBuilder app, IHostEnvironment env)
{
}
@@ -72,10 +76,8 @@ public void Configure(IApplicationBuilder app, IHostEnvironment env)
///
/// 配置MVC功能
///
- ///
public void ConfigureMvc(MvcOptions mvcOptions)
{
-
}
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleInitializer.tt b/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleInitializer.tt
index eb47914..e31c990 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleInitializer.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/Web/ModuleInitializer.tt
@@ -1,27 +1,26 @@
<#@ template language="C#" #>
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+using <#= _prefix #>.Lib.Module.Abstractions;
using <#= _prefix #>.Lib.Module.AspNetCore;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Web
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.Web
{
public class ModuleInitializer : IModuleInitializer
{
///
/// 注入服务
///
- ///
- public void ConfigureServices(IServiceCollection services)
+ public void ConfigureServices(IServiceCollection services, IModuleCollection modules, IHostEnvironment env, IConfiguration cfg)
{
}
///
/// 配置中间件
///
- ///
- ///
public void Configure(IApplicationBuilder app, IHostEnvironment env)
{
}
@@ -29,10 +28,8 @@ namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.Web
///
/// 配置MVC功能
///
- ///
public void ConfigureMvc(MvcOptions mvcOptions)
{
-
}
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cache.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettings.Extend.cs
similarity index 55%
rename from src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cache.Extend.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettings.Extend.cs
index e439e38..208c21d 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cache.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettings.Extend.cs
@@ -1,27 +1,29 @@
using System.IO;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost
{
- public partial class cache : ITemplateHandler
+ public partial class AppSettings : ITemplateHandler
{
private readonly TemplateBuildModel _model;
- private readonly string _prefix;
+ private readonly string _dbPrefix;
- public cache(TemplateBuildModel model)
+ public AppSettings(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _dbPrefix = model.Module.UiPrefix;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost/config");
+ var dir = Path.Combine(_model.RootPath, "src/WebHost");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
var content = TransformText();
- var filePath = Path.Combine(dir, "cache.json");
+ var filePath = Path.Combine(dir, "appsettings.json");
File.WriteAllText(filePath, content);
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/db.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettings.cs
similarity index 73%
rename from src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/db.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettings.cs
index 24471ed..01f2fc6 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/db.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettings.cs
@@ -1,13 +1,13 @@
-// ------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
//
-// ˴ɹɡ
-// ʱ汾: 16.0.0.0
+// 此代码由工具生成。
+// 运行时版本: 16.0.0.0
//
-// ԴļĸĿܵ²ȷΪ
-// ɴ룬ЩĽᶪʧ
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,这些更改将会丢失。
//
// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost
{
using System;
@@ -15,9 +15,9 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\db.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\AppSettings.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class db : dbBase
+ public partial class AppSettings : AppSettingsBase
{
#line hidden
///
@@ -25,58 +25,142 @@ public partial class db : dbBase
///
public virtual string TransformText()
{
- this.Write(@"{
- //Ƿ־
- ""Logging"": false,
- //ݿ 0SqlServer 1MySql 2SQLite
- ""Dialect"": 2,
- //ݿ汾
- ""Version"": """",
- //ݿַ
- ""Server"": """",
- //˿ں
- ""Port"": 0,
- //û
- ""UserId"": """",
- //
- ""Password"": """",
- //Ƿݿͱ
- ""CreateDatabase"": true,
- //ģб
- ""Modules"": [
- {
- //ģ
- ""Name"": ""Admin"",
- //ݿ
- ""Database"": """);
+ this.Write("{\r\n \"Host\": {\r\n //地址\r\n \"Urls\": \"http://*:");
+
+ #line 5 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\AppSettings.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.No + 6220));
+
+ #line default
+ #line hidden
+ this.Write(@""",
+ //开启Swagger
+ ""Swagger"": false,
+ //代理
+ ""Proxy"": false,
+ //指定跨域访问时预检请求的有效期,单位秒,默认30分钟
+ ""PreflightMaxAge"": 0
+ },
+ ""Serilog"": {
+ ""MinimumLevel"": {
+ ""Default"": ""Error"",
+ ""Override"": {
+ ""Microsoft"": ""Error"",
+ ""System"": ""Error""
+ }
+ },
+ ""WriteTo"": [
+ //输出到文件
+ {
+ ""Name"": ""File"",
+ ""Args"": {
+ //文件路径
+ ""path"": ""log/log.log"",
+ //文件滚动方式
+ ""rollingInterval"": ""Day"",
+ //消息输出格式
+ ""outputTemplate"": ""{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}"",
+ //文件数量
+ ""retainedFileCountLimit"": 60,
+ //使用缓冲,提高写入效率
+ ""buffered"": false
+ }
+ }
+ ]
+ },
+ ""Db"": {
+ //是否开启日志
+ ""Logging"": false,
+ //数据库类型 0、SqlServer 1、MySql 2、SQLite
+ ""Dialect"": 2,
+ //数据库版本
+ ""Version"": """",
+ //数据库地址
+ ""Server"": """",
+ //端口号
+ ""Port"": 0,
+ //用户名
+ ""UserId"": """",
+ //密码
+ ""Password"": """",
+ //是否创建数据库和表
+ ""CreateDatabase"": true,
+ //是否初始化数据
+ ""InitData"": true,
+ //模块列表
+ ""Modules"": [
+ {
+ //模块名称
+ ""Name"": ""Admin"",
+ //数据库名称
+ ""Database"": """);
- #line 25 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\db.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
+ #line 65 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\AppSettings.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_dbPrefix));
#line default
#line hidden
- this.Write("_Admin\"\r\n },\r\n {\r\n \"Name\": \"");
+ this.Write("_Admin\"\r\n },\r\n {\r\n \"Name\": \"");
- #line 28 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\db.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 68 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\AppSettings.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
- this.Write("\",\r\n \"Database\": \"");
+ this.Write("\",\r\n \"Database\": \"");
- #line 29 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\db.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
+ #line 69 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\AppSettings.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_dbPrefix));
#line default
#line hidden
this.Write("_");
- #line 29 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\db.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 69 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\AppSettings.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
- this.Write("\"\r\n }\r\n ]\r\n}");
+ this.Write(@"""
+ }
+ ]
+ },
+ //缓存配置
+ ""Cache"": {
+ //缓存提供器:0、MemoryCache 1、Redis
+ ""Provider"": 0,
+ //Redis配置
+ ""Redis"": {
+ ""Prefix"": """",
+ ""ConnectionString"": ""127.0.0.1""
+ }
+ },
+ //Excel配置
+ ""Excel"": {
+ //Excel类库:0、EPPlus 1、NPOI 2、OpenXml (暂时只实现了EPPlus)
+ ""Provider"": 0,
+ //Excel操作时产生的临时文件存储根路径
+ ""TempPath"": """"
+ },
+ //OSS配置
+ ""OSS"": {
+ //存储提供器:0、本地存储 1、七牛
+ ""Provider"": 0,
+ //七牛存储配置
+ ""Qiniu"": {
+ //Key
+ ""AccessKey"": """",
+ //密钥
+ ""SecretKey"": """",
+ //域名(结尾不包含/)
+ ""Domain"": """",
+ //空间名称
+ ""Bucket"": """",
+ //存储区域:0、华 东 1、华 北 2、华 南 3、北 美 4、东南亚
+ ""Zone"": 0
+ }
+ }
+}
+");
return this.GenerationEnvironment.ToString();
}
}
@@ -88,7 +172,7 @@ public virtual string TransformText()
/// Base class for this transformation
///
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class dbBase
+ public class AppSettingsBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettings.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettings.tt
new file mode 100644
index 0000000..e6de56e
--- /dev/null
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettings.tt
@@ -0,0 +1,108 @@
+<#@ template language="C#" #>
+{
+ "Host": {
+ //地址
+ "Urls": "http://*:<#= _model.Module.No + 6220 #>",
+ //开启Swagger
+ "Swagger": false,
+ //代理
+ "Proxy": false,
+ //指定跨域访问时预检请求的有效期,单位秒,默认30分钟
+ "PreflightMaxAge": 0
+ },
+ "Serilog": {
+ "MinimumLevel": {
+ "Default": "Error",
+ "Override": {
+ "Microsoft": "Error",
+ "System": "Error"
+ }
+ },
+ "WriteTo": [
+ //输出到文件
+ {
+ "Name": "File",
+ "Args": {
+ //文件路径
+ "path": "log/log.log",
+ //文件滚动方式
+ "rollingInterval": "Day",
+ //消息输出格式
+ "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
+ //文件数量
+ "retainedFileCountLimit": 60,
+ //使用缓冲,提高写入效率
+ "buffered": false
+ }
+ }
+ ]
+ },
+ "Db": {
+ //是否开启日志
+ "Logging": false,
+ //数据库类型 0、SqlServer 1、MySql 2、SQLite
+ "Dialect": 2,
+ //数据库版本
+ "Version": "",
+ //数据库地址
+ "Server": "",
+ //端口号
+ "Port": 0,
+ //用户名
+ "UserId": "",
+ //密码
+ "Password": "",
+ //是否创建数据库和表
+ "CreateDatabase": true,
+ //是否初始化数据
+ "InitData": true,
+ //模块列表
+ "Modules": [
+ {
+ //模块名称
+ "Name": "Admin",
+ //数据库名称
+ "Database": "<#= _dbPrefix #>_Admin"
+ },
+ {
+ "Name": "<#= _model.Module.Code #>",
+ "Database": "<#= _dbPrefix #>_<#= _model.Module.Code #>"
+ }
+ ]
+ },
+ //缓存配置
+ "Cache": {
+ //缓存提供器:0、MemoryCache 1、Redis
+ "Provider": 0,
+ //Redis配置
+ "Redis": {
+ "Prefix": "",
+ "ConnectionString": "127.0.0.1"
+ }
+ },
+ //Excel配置
+ "Excel": {
+ //Excel类库:0、EPPlus 1、NPOI 2、OpenXml (暂时只实现了EPPlus)
+ "Provider": 0,
+ //Excel操作时产生的临时文件存储根路径
+ "TempPath": ""
+ },
+ //OSS配置
+ "OSS": {
+ //存储提供器:0、本地存储 1、七牛
+ "Provider": 0,
+ //七牛存储配置
+ "Qiniu": {
+ //Key
+ "AccessKey": "",
+ //密钥
+ "SecretKey": "",
+ //域名(结尾不包含/)
+ "Domain": "",
+ //空间名称
+ "Bucket": "",
+ //存储区域:0、华 东 1、华 北 2、华 南 3、北 美 4、东南亚
+ "Zone": 0
+ }
+ }
+}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Startup.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettingsDevelopment.Extend.cs
similarity index 61%
rename from src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Startup.Extend.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettingsDevelopment.Extend.cs
index 2c39594..55cd0c8 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Startup.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettingsDevelopment.Extend.cs
@@ -3,25 +3,25 @@
namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost
{
- public partial class Startup : ITemplateHandler
+ public partial class AppSettingsDevelopment : ITemplateHandler
{
private readonly TemplateBuildModel _model;
- private readonly string _prefix;
- public Startup(TemplateBuildModel model)
+ public AppSettingsDevelopment(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost");
+ var dir = Path.Combine(_model.RootPath, "src/WebHost");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
var content = TransformText();
- var filePath = Path.Combine(dir, "Startup.cs");
+ var filePath = Path.Combine(dir, "appsettings.Development.json");
File.WriteAllText(filePath, content);
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/logging.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettingsDevelopment.cs
similarity index 92%
rename from src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/logging.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettingsDevelopment.cs
index 98b326f..2fe7300 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/logging.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettingsDevelopment.cs
@@ -1,13 +1,13 @@
-// ------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------
//
-// ˴ɹɡ
-// ʱ汾: 16.0.0.0
+// 此代码由工具生成。
+// 运行时版本: 16.0.0.0
//
-// ԴļĸĿܵ²ȷΪ
-// ɴ룬ЩĽᶪʧ
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,这些更改将会丢失。
//
// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost
{
using System;
@@ -15,9 +15,9 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\logging.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\AppSettingsDevelopment.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class logging : loggingBase
+ public partial class AppSettingsDevelopment : AppSettingsDevelopmentBase
{
#line hidden
///
@@ -25,16 +25,18 @@ public partial class logging : loggingBase
///
public virtual string TransformText()
{
- this.Write(@"{
+ this.Write(@"
+{
""Serilog"": {
""MinimumLevel"": {
- ""Default"": ""Error"",
+ ""Default"": ""Debug"",
""Override"": {
- ""Microsoft"": ""Error"",
- ""System"": ""Error""
+ ""Microsoft"": ""Debug"",
+ ""System"": ""Debug""
}
},
""WriteTo"": [
+ //输入到控制台
{
""Name"": ""Console"",
""Args"": {
@@ -42,24 +44,29 @@ public virtual string TransformText()
""outputTemplate"": ""[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} {NewLine}{Exception}""
}
},
+ //输出到文件
{
""Name"": ""File"",
""Args"": {
- //ļ·
+ //文件路径
""path"": ""log/log.log"",
- //ļʽ
+ //文件滚动方式
""rollingInterval"": ""Day"",
- //Ϣʽ
+ //消息输出格式
""outputTemplate"": ""{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}"",
- //ļ
+ //文件数量
""retainedFileCountLimit"": 60,
- //ʹû壬дЧ
+ //使用缓冲,提高写入效率
""buffered"": false
}
}
]
+ },
+ ""Db"": {
+ ""Logging"": true
}
-}");
+}
+");
return this.GenerationEnvironment.ToString();
}
}
@@ -71,7 +78,7 @@ public virtual string TransformText()
/// Base class for this transformation
///
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class loggingBase
+ public class AppSettingsDevelopmentBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
diff --git a/src/WebHost/config/logging.json b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettingsDevelopment.tt
similarity index 85%
rename from src/WebHost/config/logging.json
rename to src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettingsDevelopment.tt
index 5d01240..3de4a76 100644
--- a/src/WebHost/config/logging.json
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/AppSettingsDevelopment.tt
@@ -1,10 +1,11 @@
+<#@ template language="C#" #>
{
"Serilog": {
"MinimumLevel": {
- "Default": "Error",
+ "Default": "Debug",
"Override": {
- "Microsoft": "Error",
- "System": "Error"
+ "Microsoft": "Debug",
+ "System": "Debug"
}
},
"WriteTo": [
@@ -33,5 +34,8 @@
}
}
]
+ },
+ "Db": {
+ "Logging": true
}
-}
\ No newline at end of file
+}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Csproj.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Csproj.Extend.cs
index acaf96e..f6dc09f 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Csproj.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Csproj.Extend.cs
@@ -1,4 +1,5 @@
using System.IO;
+using NetModular.Module.CodeGenerator.Infrastructure.NuGet;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost
@@ -7,16 +8,20 @@ public partial class Csproj : ITemplateHandler
{
private readonly TemplateBuildModel _model;
private readonly string _prefix;
+ private readonly NuGetPackageVersions _versions;
public Csproj(TemplateBuildModel model)
{
_model = model;
- _prefix = model.Project.Prefix;
+ _prefix = model.Module.Prefix;
+ _versions = _model.NuGetPackageVersions;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost");
+ var dir = Path.Combine(_model.RootPath, "src/WebHost");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Csproj.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Csproj.cs
index 2636d0d..50be158 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Csproj.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Csproj.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
//
// 此代码由工具生成。
-// 运行时版本: 16.0.0.0
+// 运行时版本: 17.0.0.0
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,这些更改将会丢失。
@@ -15,8 +15,8 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Csproj.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ #line 1 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Csproj.tt"
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class Csproj : CsprojBase
{
#line hidden
@@ -25,69 +25,144 @@ public partial class Csproj : CsprojBase
///
public virtual string TransformText()
{
- this.Write("\r\n\r\n \r\n " +
- "netcoreapp3.0\r\n \r\n\r\n \r\n
+
+
+ false
+ false
+
+
+
+ \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
+ this.Write(".Module.Admin.Web\" Version=\"");
+
+ #line 17 "D:\OpenModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Csproj.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_versions.Module_Admin_Web));
+
+ #line default
+ #line hidden
+ this.Write(@""" />
+
+
-
-
+
+
+ PreserveNewest
+
+
+
PreserveNewest
-
+
@@ -102,7 +177,7 @@ public virtual string TransformText()
///
/// Base class for this transformation
///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class CsprojBase
{
#region Fields
@@ -117,7 +192,7 @@ public class CsprojBase
///
/// The string builder that generation-time code is using to assemble generated output
///
- protected System.Text.StringBuilder GenerationEnvironment
+ public System.Text.StringBuilder GenerationEnvironment
{
get
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Csproj.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Csproj.tt
index ae74fa5..d515367 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Csproj.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Csproj.tt
@@ -2,28 +2,36 @@
- netcoreapp3.0
+ false
+ false
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
+
PreserveNewest
-
+
+
+
+ PreserveNewest
+
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Program.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Program.Extend.cs
index e407289..ec51e18 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Program.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Program.Extend.cs
@@ -3,26 +3,28 @@
namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost
{
- public partial class Program : ITemplateHandler
- {
- private readonly TemplateBuildModel _model;
- private readonly string _prefix;
+ public partial class Program : ITemplateHandler
+ {
+ private readonly TemplateBuildModel _model;
+ private readonly string _prefix;
- public Program(TemplateBuildModel model)
- {
- _model = model;
- _prefix = model.Project.Prefix;
- }
+ public Program(TemplateBuildModel model)
+ {
+ _model = model;
+ _prefix = model.Module.Prefix;
+ }
- public void Save()
- {
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost");
- if (!Directory.Exists(dir))
- Directory.CreateDirectory(dir);
+ public bool IsGlobal => true;
- var content = TransformText();
- var filePath = Path.Combine(dir, "Program.cs");
- File.WriteAllText(filePath, content);
- }
- }
+ public void Save()
+ {
+ var dir = Path.Combine(_model.RootPath, "src/WebHost");
+ if (!Directory.Exists(dir))
+ Directory.CreateDirectory(dir);
+
+ var content = TransformText();
+ var filePath = Path.Combine(dir, "Program.cs");
+ File.WriteAllText(filePath, content);
+ }
+ }
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Program.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Program.cs
index a71da79..0f52b6f 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Program.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Program.cs
@@ -1,7 +1,7 @@
// ------------------------------------------------------------------------------
//
// 此代码由工具生成。
-// 运行时版本: 16.0.0.0
+// 运行时版本: 17.0.0.0
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,这些更改将会丢失。
@@ -16,7 +16,7 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
///
#line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Program.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public partial class Program : ProgramBase
{
#line hidden
@@ -25,30 +25,30 @@ public partial class Program : ProgramBase
///
public virtual string TransformText()
{
- this.Write("using ");
+ this.Write("using System.Threading.Tasks;\r\nusing ");
- #line 2 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Program.tt"
+ #line 3 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Program.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Lib.Host.Web;\r\n\r\nnamespace ");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Program.tt"
+ #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Program.tt"
this.Write(this.ToStringHelper.ToStringWithCulture(_prefix));
#line default
#line hidden
this.Write(".Module.");
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Program.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.Code));
+ #line 5 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Program.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.Code));
#line default
#line hidden
- this.Write(".WebHost\r\n{\r\n public class Program\r\n {\r\n public static void Main(str" +
- "ing[] args)\r\n {\r\n new HostBuilder().Run(args);\r\n " +
- " }\r\n }\r\n}\r\n");
+ this.Write(".WebHost\r\n{\r\n public class Program\r\n {\r\n public static async Task Ma" +
+ "in(string[] args)\r\n {\r\n await new HostBuilder().RunAsync(args)" +
+ ";\r\n }\r\n }\r\n}\r\n");
return this.GenerationEnvironment.ToString();
}
}
@@ -59,7 +59,7 @@ public virtual string TransformText()
///
/// Base class for this transformation
///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")]
public class ProgramBase
{
#region Fields
@@ -74,7 +74,7 @@ public class ProgramBase
///
/// The string builder that generation-time code is using to assemble generated output
///
- protected System.Text.StringBuilder GenerationEnvironment
+ public System.Text.StringBuilder GenerationEnvironment
{
get
{
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Program.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Program.tt
index 090ee44..9c01a80 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Program.tt
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Program.tt
@@ -1,13 +1,14 @@
<#@ template language="C#" #>
+using System.Threading.Tasks;
using <#= _prefix #>.Lib.Host.Web;
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.WebHost
+namespace <#= _prefix #>.Module.<#= _model.Module.Code #>.WebHost
{
public class Program
{
- public static void Main(string[] args)
+ public static async Task Main(string[] args)
{
- new HostBuilder().Run(args);
+ await new HostBuilder().RunAsync(args);
}
}
}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/dbDevelopment.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Properties/LaunchSettings.Extend.cs
similarity index 60%
rename from src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/dbDevelopment.Extend.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Properties/LaunchSettings.Extend.cs
index 20ac369..7cebabb 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/dbDevelopment.Extend.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Properties/LaunchSettings.Extend.cs
@@ -1,26 +1,28 @@
using System.IO;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.Properties
{
- public partial class dbDevelopment : ITemplateHandler
+ public partial class LaunchSettings : ITemplateHandler
{
private readonly TemplateBuildModel _model;
- public dbDevelopment(TemplateBuildModel model)
+ public LaunchSettings(TemplateBuildModel model)
{
_model = model;
}
+ public bool IsGlobal => true;
+
public void Save()
{
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost/config");
+ var dir = Path.Combine(_model.RootPath, "src/WebHost/Properties/");
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
var content = TransformText();
- var filePath = Path.Combine(dir, "db.Development.json");
+ var filePath = Path.Combine(dir, "launchSettings.json");
File.WriteAllText(filePath, content);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/loggingDevelopment.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Properties/LaunchSettings.cs
similarity index 91%
rename from src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/loggingDevelopment.cs
rename to src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Properties/LaunchSettings.cs
index 76adfc7..d3e88a3 100644
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/loggingDevelopment.cs
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Properties/LaunchSettings.cs
@@ -7,7 +7,7 @@
// ɴ룬ЩĽᶪʧ
//
// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.Properties
{
using System;
@@ -15,9 +15,9 @@ namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.sr
/// Class to produce the template output
///
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\loggingDevelopment.tt"
+ #line 1 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Properties\LaunchSettings.tt"
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class loggingDevelopment : loggingDevelopmentBase
+ public partial class LaunchSettings : LaunchSettingsBase
{
#line hidden
///
@@ -25,9 +25,24 @@ public partial class loggingDevelopment : loggingDevelopmentBase
///
public virtual string TransformText()
{
- this.Write("{\r\n \"Serilog\": {\r\n \"MinimumLevel\": {\r\n \"Default\": \"Debug\",\r\n \"Overr" +
- "ide\": {\r\n \"Microsoft\": \"Debug\",\r\n \"System\": \"Debug\"\r\n }\r\n " +
- "}\r\n }\r\n}");
+ this.Write(@"{
+""$schema"": ""http://json.schemastore.org/launchsettings.json"",
+ ""profiles"": {
+ ""WebHost"": {
+ ""commandName"": ""Project"",
+ ""launchBrowser"": true,
+ ""launchUrl"": ""swagger"",
+ ""environmentVariables"": {
+ ""ASPNETCORE_ENVIRONMENT"": ""Development""
+ },
+ ""applicationUrl"": ""http://localhost:");
+
+ #line 12 "D:\MyProject\NetModular\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\Properties\LaunchSettings.tt"
+ this.Write(this.ToStringHelper.ToStringWithCulture(_model.Module.No + 6220));
+
+ #line default
+ #line hidden
+ this.Write("\"\r\n }\r\n }\r\n}");
return this.GenerationEnvironment.ToString();
}
}
@@ -39,7 +54,7 @@ public virtual string TransformText()
/// Base class for this transformation
///
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class loggingDevelopmentBase
+ public class LaunchSettingsBase
{
#region Fields
private global::System.Text.StringBuilder generationEnvironmentField;
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Properties/LaunchSettings.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Properties/LaunchSettings.tt
new file mode 100644
index 0000000..cae336a
--- /dev/null
+++ b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Properties/LaunchSettings.tt
@@ -0,0 +1,15 @@
+<#@ template language="C#" #>
+{
+"$schema": "http://json.schemastore.org/launchsettings.json",
+ "profiles": {
+ "WebHost": {
+ "commandName": "Project",
+ "launchBrowser": true,
+ "launchUrl": "swagger",
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ },
+ "applicationUrl": "http://localhost:<#= _model.Module.No + 6220 #>"
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Startup.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Startup.tt
deleted file mode 100644
index 68f4ed0..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/Startup.tt
+++ /dev/null
@@ -1,13 +0,0 @@
-<#@ template language="C#" #>
-using Microsoft.Extensions.Hosting;
-using <#= _prefix #>.Lib.Host.Web;
-
-namespace <#= _prefix #>.Module.<#= _model.Project.Code #>.WebHost
-{
- public class Startup : StartupAbstract
- {
- public Startup(IHostEnvironment env) : base(env)
- {
- }
- }
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cache.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cache.cs
deleted file mode 100644
index 5e5325c..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cache.cs
+++ /dev/null
@@ -1,308 +0,0 @@
-// ------------------------------------------------------------------------------
-//
-// 此代码由工具生成。
-// 运行时版本: 16.0.0.0
-//
-// 对此文件的更改可能导致不正确的行为,如果
-// 重新生成代码,这些更改将会丢失。
-//
-// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- using System;
-
- ///
- /// Class to produce the template output
- ///
-
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\cache.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class cache : cacheBase
- {
-#line hidden
- ///
- /// Create the template output
- ///
- public virtual string TransformText()
- {
- this.Write("{\r\n // 0、MemoryCache 1、Redis\r\n \"Mode\": 0,\r\n \"Redis\": {\r\n \"ConnectionString\"" +
- ": \"127.0.0.1\"\r\n }\r\n}");
- return this.GenerationEnvironment.ToString();
- }
- }
-
- #line default
- #line hidden
- #region Base class
- ///
- /// Base class for this transformation
- ///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class cacheBase
- {
- #region Fields
- private global::System.Text.StringBuilder generationEnvironmentField;
- private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
- private global::System.Collections.Generic.List indentLengthsField;
- private string currentIndentField = "";
- private bool endsWithNewline;
- private global::System.Collections.Generic.IDictionary sessionField;
- #endregion
- #region Properties
- ///
- /// The string builder that generation-time code is using to assemble generated output
- ///
- protected System.Text.StringBuilder GenerationEnvironment
- {
- get
- {
- if ((this.generationEnvironmentField == null))
- {
- this.generationEnvironmentField = new global::System.Text.StringBuilder();
- }
- return this.generationEnvironmentField;
- }
- set
- {
- this.generationEnvironmentField = value;
- }
- }
- ///
- /// The error collection for the generation process
- ///
- public System.CodeDom.Compiler.CompilerErrorCollection Errors
- {
- get
- {
- if ((this.errorsField == null))
- {
- this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
- }
- return this.errorsField;
- }
- }
- ///
- /// A list of the lengths of each indent that was added with PushIndent
- ///
- private System.Collections.Generic.List indentLengths
- {
- get
- {
- if ((this.indentLengthsField == null))
- {
- this.indentLengthsField = new global::System.Collections.Generic.List();
- }
- return this.indentLengthsField;
- }
- }
- ///
- /// Gets the current indent we use when adding lines to the output
- ///
- public string CurrentIndent
- {
- get
- {
- return this.currentIndentField;
- }
- }
- ///
- /// Current transformation session
- ///
- public virtual global::System.Collections.Generic.IDictionary Session
- {
- get
- {
- return this.sessionField;
- }
- set
- {
- this.sessionField = value;
- }
- }
- #endregion
- #region Transform-time helpers
- ///
- /// Write text directly into the generated output
- ///
- public void Write(string textToAppend)
- {
- if (string.IsNullOrEmpty(textToAppend))
- {
- return;
- }
- // If we're starting off, or if the previous text ended with a newline,
- // we have to append the current indent first.
- if (((this.GenerationEnvironment.Length == 0)
- || this.endsWithNewline))
- {
- this.GenerationEnvironment.Append(this.currentIndentField);
- this.endsWithNewline = false;
- }
- // Check if the current text ends with a newline
- if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
- {
- this.endsWithNewline = true;
- }
- // This is an optimization. If the current indent is "", then we don't have to do any
- // of the more complex stuff further down.
- if ((this.currentIndentField.Length == 0))
- {
- this.GenerationEnvironment.Append(textToAppend);
- return;
- }
- // Everywhere there is a newline in the text, add an indent after it
- textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
- // If the text ends with a newline, then we should strip off the indent added at the very end
- // because the appropriate indent will be added when the next time Write() is called
- if (this.endsWithNewline)
- {
- this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
- }
- else
- {
- this.GenerationEnvironment.Append(textToAppend);
- }
- }
- ///
- /// Write text directly into the generated output
- ///
- public void WriteLine(string textToAppend)
- {
- this.Write(textToAppend);
- this.GenerationEnvironment.AppendLine();
- this.endsWithNewline = true;
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void Write(string format, params object[] args)
- {
- this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void WriteLine(string format, params object[] args)
- {
- this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Raise an error
- ///
- public void Error(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- this.Errors.Add(error);
- }
- ///
- /// Raise a warning
- ///
- public void Warning(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- error.IsWarning = true;
- this.Errors.Add(error);
- }
- ///
- /// Increase the indent
- ///
- public void PushIndent(string indent)
- {
- if ((indent == null))
- {
- throw new global::System.ArgumentNullException("indent");
- }
- this.currentIndentField = (this.currentIndentField + indent);
- this.indentLengths.Add(indent.Length);
- }
- ///
- /// Remove the last indent that was added with PushIndent
- ///
- public string PopIndent()
- {
- string returnValue = "";
- if ((this.indentLengths.Count > 0))
- {
- int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
- this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
- if ((indentLength > 0))
- {
- returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
- this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
- }
- }
- return returnValue;
- }
- ///
- /// Remove any indentation
- ///
- public void ClearIndent()
- {
- this.indentLengths.Clear();
- this.currentIndentField = "";
- }
- #endregion
- #region ToString Helpers
- ///
- /// Utility class to produce culture-oriented representation of an object as a string.
- ///
- public class ToStringInstanceHelper
- {
- private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
- ///
- /// Gets or sets format provider to be used by ToStringWithCulture method.
- ///
- public System.IFormatProvider FormatProvider
- {
- get
- {
- return this.formatProviderField ;
- }
- set
- {
- if ((value != null))
- {
- this.formatProviderField = value;
- }
- }
- }
- ///
- /// This is called from the compile/run appdomain to convert objects within an expression block to a string
- ///
- public string ToStringWithCulture(object objectToConvert)
- {
- if ((objectToConvert == null))
- {
- throw new global::System.ArgumentNullException("objectToConvert");
- }
- System.Type t = objectToConvert.GetType();
- System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
- typeof(System.IFormatProvider)});
- if ((method == null))
- {
- return objectToConvert.ToString();
- }
- else
- {
- return ((string)(method.Invoke(objectToConvert, new object[] {
- this.formatProviderField })));
- }
- }
- }
- private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
- ///
- /// Helper to produce culture-oriented representation of an object as a string
- ///
- public ToStringInstanceHelper ToStringHelper
- {
- get
- {
- return this.toStringHelperField;
- }
- }
- #endregion
- }
- #endregion
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cache.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cache.tt
deleted file mode 100644
index ca2dd37..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cache.tt
+++ /dev/null
@@ -1,8 +0,0 @@
-<#@ template language="C#" #>
-{
- // 0、MemoryCache 1、Redis
- "Mode": 0,
- "Redis": {
- "ConnectionString": "127.0.0.1"
- }
-}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cacheDevelopment.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cacheDevelopment.Extend.cs
deleted file mode 100644
index 538c382..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cacheDevelopment.Extend.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System.IO;
-using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- public partial class cacheDevelopment : ITemplateHandler
- {
- private readonly TemplateBuildModel _model;
- private readonly string _prefix;
-
- public cacheDevelopment(TemplateBuildModel model)
- {
- _model = model;
- _prefix = model.Project.Prefix;
- }
-
- public void Save()
- {
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost/config");
- if (!Directory.Exists(dir))
- Directory.CreateDirectory(dir);
-
- var content = TransformText();
- var filePath = Path.Combine(dir, "cache.evelopment.json");
- File.WriteAllText(filePath, content);
- }
- }
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cacheDevelopment.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cacheDevelopment.tt
deleted file mode 100644
index 22fdca1..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/cacheDevelopment.tt
+++ /dev/null
@@ -1 +0,0 @@
-{}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/db.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/db.tt
deleted file mode 100644
index 3e7229f..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/db.tt
+++ /dev/null
@@ -1,32 +0,0 @@
-<#@ template language="C#" #>
-{
- //Ƿ־
- "Logging": false,
- //ݿ 0SqlServer 1MySql 2SQLite
- "Dialect": 2,
- //ݿ汾
- "Version": "",
- //ݿַ
- "Server": "",
- //˿ں
- "Port": 0,
- //û
- "UserId": "",
- //
- "Password": "",
- //Ƿݿͱ
- "CreateDatabase": true,
- //ģб
- "Modules": [
- {
- //ģ
- "Name": "Admin",
- //ݿ
- "Database": "<#= _prefix #>_Admin"
- },
- {
- "Name": "<#= _model.Project.Code #>",
- "Database": "<#= _prefix #>_<#= _model.Project.Code #>"
- }
- ]
-}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/dbDevelopment.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/dbDevelopment.cs
deleted file mode 100644
index 7b30312..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/dbDevelopment.cs
+++ /dev/null
@@ -1,307 +0,0 @@
-// ------------------------------------------------------------------------------
-//
-// ˴ɹɡ
-// ʱ汾: 16.0.0.0
-//
-// ԴļĸĿܵ²ȷΪ
-// ɴ룬ЩĽᶪʧ
-//
-// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- using System;
-
- ///
- /// Class to produce the template output
- ///
-
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\dbDevelopment.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class dbDevelopment : dbDevelopmentBase
- {
-#line hidden
- ///
- /// Create the template output
- ///
- public virtual string TransformText()
- {
- this.Write("{\r\n \"Logging\": true\r\n}");
- return this.GenerationEnvironment.ToString();
- }
- }
-
- #line default
- #line hidden
- #region Base class
- ///
- /// Base class for this transformation
- ///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class dbDevelopmentBase
- {
- #region Fields
- private global::System.Text.StringBuilder generationEnvironmentField;
- private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
- private global::System.Collections.Generic.List indentLengthsField;
- private string currentIndentField = "";
- private bool endsWithNewline;
- private global::System.Collections.Generic.IDictionary sessionField;
- #endregion
- #region Properties
- ///
- /// The string builder that generation-time code is using to assemble generated output
- ///
- protected System.Text.StringBuilder GenerationEnvironment
- {
- get
- {
- if ((this.generationEnvironmentField == null))
- {
- this.generationEnvironmentField = new global::System.Text.StringBuilder();
- }
- return this.generationEnvironmentField;
- }
- set
- {
- this.generationEnvironmentField = value;
- }
- }
- ///
- /// The error collection for the generation process
- ///
- public System.CodeDom.Compiler.CompilerErrorCollection Errors
- {
- get
- {
- if ((this.errorsField == null))
- {
- this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
- }
- return this.errorsField;
- }
- }
- ///
- /// A list of the lengths of each indent that was added with PushIndent
- ///
- private System.Collections.Generic.List indentLengths
- {
- get
- {
- if ((this.indentLengthsField == null))
- {
- this.indentLengthsField = new global::System.Collections.Generic.List();
- }
- return this.indentLengthsField;
- }
- }
- ///
- /// Gets the current indent we use when adding lines to the output
- ///
- public string CurrentIndent
- {
- get
- {
- return this.currentIndentField;
- }
- }
- ///
- /// Current transformation session
- ///
- public virtual global::System.Collections.Generic.IDictionary Session
- {
- get
- {
- return this.sessionField;
- }
- set
- {
- this.sessionField = value;
- }
- }
- #endregion
- #region Transform-time helpers
- ///
- /// Write text directly into the generated output
- ///
- public void Write(string textToAppend)
- {
- if (string.IsNullOrEmpty(textToAppend))
- {
- return;
- }
- // If we're starting off, or if the previous text ended with a newline,
- // we have to append the current indent first.
- if (((this.GenerationEnvironment.Length == 0)
- || this.endsWithNewline))
- {
- this.GenerationEnvironment.Append(this.currentIndentField);
- this.endsWithNewline = false;
- }
- // Check if the current text ends with a newline
- if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
- {
- this.endsWithNewline = true;
- }
- // This is an optimization. If the current indent is "", then we don't have to do any
- // of the more complex stuff further down.
- if ((this.currentIndentField.Length == 0))
- {
- this.GenerationEnvironment.Append(textToAppend);
- return;
- }
- // Everywhere there is a newline in the text, add an indent after it
- textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
- // If the text ends with a newline, then we should strip off the indent added at the very end
- // because the appropriate indent will be added when the next time Write() is called
- if (this.endsWithNewline)
- {
- this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
- }
- else
- {
- this.GenerationEnvironment.Append(textToAppend);
- }
- }
- ///
- /// Write text directly into the generated output
- ///
- public void WriteLine(string textToAppend)
- {
- this.Write(textToAppend);
- this.GenerationEnvironment.AppendLine();
- this.endsWithNewline = true;
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void Write(string format, params object[] args)
- {
- this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void WriteLine(string format, params object[] args)
- {
- this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Raise an error
- ///
- public void Error(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- this.Errors.Add(error);
- }
- ///
- /// Raise a warning
- ///
- public void Warning(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- error.IsWarning = true;
- this.Errors.Add(error);
- }
- ///
- /// Increase the indent
- ///
- public void PushIndent(string indent)
- {
- if ((indent == null))
- {
- throw new global::System.ArgumentNullException("indent");
- }
- this.currentIndentField = (this.currentIndentField + indent);
- this.indentLengths.Add(indent.Length);
- }
- ///
- /// Remove the last indent that was added with PushIndent
- ///
- public string PopIndent()
- {
- string returnValue = "";
- if ((this.indentLengths.Count > 0))
- {
- int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
- this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
- if ((indentLength > 0))
- {
- returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
- this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
- }
- }
- return returnValue;
- }
- ///
- /// Remove any indentation
- ///
- public void ClearIndent()
- {
- this.indentLengths.Clear();
- this.currentIndentField = "";
- }
- #endregion
- #region ToString Helpers
- ///
- /// Utility class to produce culture-oriented representation of an object as a string.
- ///
- public class ToStringInstanceHelper
- {
- private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
- ///
- /// Gets or sets format provider to be used by ToStringWithCulture method.
- ///
- public System.IFormatProvider FormatProvider
- {
- get
- {
- return this.formatProviderField ;
- }
- set
- {
- if ((value != null))
- {
- this.formatProviderField = value;
- }
- }
- }
- ///
- /// This is called from the compile/run appdomain to convert objects within an expression block to a string
- ///
- public string ToStringWithCulture(object objectToConvert)
- {
- if ((objectToConvert == null))
- {
- throw new global::System.ArgumentNullException("objectToConvert");
- }
- System.Type t = objectToConvert.GetType();
- System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
- typeof(System.IFormatProvider)});
- if ((method == null))
- {
- return objectToConvert.ToString();
- }
- else
- {
- return ((string)(method.Invoke(objectToConvert, new object[] {
- this.formatProviderField })));
- }
- }
- }
- private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
- ///
- /// Helper to produce culture-oriented representation of an object as a string
- ///
- public ToStringInstanceHelper ToStringHelper
- {
- get
- {
- return this.toStringHelperField;
- }
- }
- #endregion
- }
- #endregion
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/dbDevelopment.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/dbDevelopment.tt
deleted file mode 100644
index 0a6d28c..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/dbDevelopment.tt
+++ /dev/null
@@ -1,4 +0,0 @@
-<#@ template language="C#" #>
-{
- "Logging": true
-}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/host.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/host.Extend.cs
deleted file mode 100644
index 501c8c4..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/host.Extend.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.IO;
-using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- public partial class host : ITemplateHandler
- {
- private readonly TemplateBuildModel _model;
-
- public host(TemplateBuildModel model)
- {
- _model = model;
- }
-
- public void Save()
- {
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost/config");
- if (!Directory.Exists(dir))
- Directory.CreateDirectory(dir);
-
- var content = TransformText();
- var filePath = Path.Combine(dir, "host.json");
- File.WriteAllText(filePath, content);
- }
- }
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/host.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/host.cs
deleted file mode 100644
index b2e8f26..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/host.cs
+++ /dev/null
@@ -1,314 +0,0 @@
-// ------------------------------------------------------------------------------
-//
-// 此代码由工具生成。
-// 运行时版本: 16.0.0.0
-//
-// 对此文件的更改可能导致不正确的行为,如果
-// 重新生成代码,这些更改将会丢失。
-//
-// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- using System;
-
- ///
- /// Class to produce the template output
- ///
-
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\host.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class host : hostBase
- {
-#line hidden
- ///
- /// Create the template output
- ///
- public virtual string TransformText()
- {
- this.Write("{\r\n //地址\r\n \"Urls\": \"http://*:");
-
- #line 4 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\host.tt"
- this.Write(this.ToStringHelper.ToStringWithCulture(_model.Project.No + 6220));
-
- #line default
- #line hidden
- this.Write("\",\r\n //开启Swagger\r\n \"Swagger\": false\r\n}");
- return this.GenerationEnvironment.ToString();
- }
- }
-
- #line default
- #line hidden
- #region Base class
- ///
- /// Base class for this transformation
- ///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class hostBase
- {
- #region Fields
- private global::System.Text.StringBuilder generationEnvironmentField;
- private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
- private global::System.Collections.Generic.List indentLengthsField;
- private string currentIndentField = "";
- private bool endsWithNewline;
- private global::System.Collections.Generic.IDictionary sessionField;
- #endregion
- #region Properties
- ///
- /// The string builder that generation-time code is using to assemble generated output
- ///
- protected System.Text.StringBuilder GenerationEnvironment
- {
- get
- {
- if ((this.generationEnvironmentField == null))
- {
- this.generationEnvironmentField = new global::System.Text.StringBuilder();
- }
- return this.generationEnvironmentField;
- }
- set
- {
- this.generationEnvironmentField = value;
- }
- }
- ///
- /// The error collection for the generation process
- ///
- public System.CodeDom.Compiler.CompilerErrorCollection Errors
- {
- get
- {
- if ((this.errorsField == null))
- {
- this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
- }
- return this.errorsField;
- }
- }
- ///
- /// A list of the lengths of each indent that was added with PushIndent
- ///
- private System.Collections.Generic.List indentLengths
- {
- get
- {
- if ((this.indentLengthsField == null))
- {
- this.indentLengthsField = new global::System.Collections.Generic.List();
- }
- return this.indentLengthsField;
- }
- }
- ///
- /// Gets the current indent we use when adding lines to the output
- ///
- public string CurrentIndent
- {
- get
- {
- return this.currentIndentField;
- }
- }
- ///
- /// Current transformation session
- ///
- public virtual global::System.Collections.Generic.IDictionary Session
- {
- get
- {
- return this.sessionField;
- }
- set
- {
- this.sessionField = value;
- }
- }
- #endregion
- #region Transform-time helpers
- ///
- /// Write text directly into the generated output
- ///
- public void Write(string textToAppend)
- {
- if (string.IsNullOrEmpty(textToAppend))
- {
- return;
- }
- // If we're starting off, or if the previous text ended with a newline,
- // we have to append the current indent first.
- if (((this.GenerationEnvironment.Length == 0)
- || this.endsWithNewline))
- {
- this.GenerationEnvironment.Append(this.currentIndentField);
- this.endsWithNewline = false;
- }
- // Check if the current text ends with a newline
- if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
- {
- this.endsWithNewline = true;
- }
- // This is an optimization. If the current indent is "", then we don't have to do any
- // of the more complex stuff further down.
- if ((this.currentIndentField.Length == 0))
- {
- this.GenerationEnvironment.Append(textToAppend);
- return;
- }
- // Everywhere there is a newline in the text, add an indent after it
- textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
- // If the text ends with a newline, then we should strip off the indent added at the very end
- // because the appropriate indent will be added when the next time Write() is called
- if (this.endsWithNewline)
- {
- this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
- }
- else
- {
- this.GenerationEnvironment.Append(textToAppend);
- }
- }
- ///
- /// Write text directly into the generated output
- ///
- public void WriteLine(string textToAppend)
- {
- this.Write(textToAppend);
- this.GenerationEnvironment.AppendLine();
- this.endsWithNewline = true;
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void Write(string format, params object[] args)
- {
- this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void WriteLine(string format, params object[] args)
- {
- this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Raise an error
- ///
- public void Error(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- this.Errors.Add(error);
- }
- ///
- /// Raise a warning
- ///
- public void Warning(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- error.IsWarning = true;
- this.Errors.Add(error);
- }
- ///
- /// Increase the indent
- ///
- public void PushIndent(string indent)
- {
- if ((indent == null))
- {
- throw new global::System.ArgumentNullException("indent");
- }
- this.currentIndentField = (this.currentIndentField + indent);
- this.indentLengths.Add(indent.Length);
- }
- ///
- /// Remove the last indent that was added with PushIndent
- ///
- public string PopIndent()
- {
- string returnValue = "";
- if ((this.indentLengths.Count > 0))
- {
- int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
- this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
- if ((indentLength > 0))
- {
- returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
- this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
- }
- }
- return returnValue;
- }
- ///
- /// Remove any indentation
- ///
- public void ClearIndent()
- {
- this.indentLengths.Clear();
- this.currentIndentField = "";
- }
- #endregion
- #region ToString Helpers
- ///
- /// Utility class to produce culture-oriented representation of an object as a string.
- ///
- public class ToStringInstanceHelper
- {
- private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
- ///
- /// Gets or sets format provider to be used by ToStringWithCulture method.
- ///
- public System.IFormatProvider FormatProvider
- {
- get
- {
- return this.formatProviderField ;
- }
- set
- {
- if ((value != null))
- {
- this.formatProviderField = value;
- }
- }
- }
- ///
- /// This is called from the compile/run appdomain to convert objects within an expression block to a string
- ///
- public string ToStringWithCulture(object objectToConvert)
- {
- if ((objectToConvert == null))
- {
- throw new global::System.ArgumentNullException("objectToConvert");
- }
- System.Type t = objectToConvert.GetType();
- System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
- typeof(System.IFormatProvider)});
- if ((method == null))
- {
- return objectToConvert.ToString();
- }
- else
- {
- return ((string)(method.Invoke(objectToConvert, new object[] {
- this.formatProviderField })));
- }
- }
- }
- private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
- ///
- /// Helper to produce culture-oriented representation of an object as a string
- ///
- public ToStringInstanceHelper ToStringHelper
- {
- get
- {
- return this.toStringHelperField;
- }
- }
- #endregion
- }
- #endregion
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/host.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/host.tt
deleted file mode 100644
index 6eda3cd..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/host.tt
+++ /dev/null
@@ -1,7 +0,0 @@
-<#@ template language="C#" #>
-{
- //地址
- "Urls": "http://*:<#= _model.Project.No + 6220 #>",
- //开启Swagger
- "Swagger": false
-}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/hostDevelopment.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/hostDevelopment.Extend.cs
deleted file mode 100644
index 0a0324d..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/hostDevelopment.Extend.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.IO;
-using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- public partial class hostDevelopment : ITemplateHandler
- {
- private readonly TemplateBuildModel _model;
-
- public hostDevelopment(TemplateBuildModel model)
- {
- _model = model;
- }
-
- public void Save()
- {
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost/config");
- if (!Directory.Exists(dir))
- Directory.CreateDirectory(dir);
-
- var content = TransformText();
- var filePath = Path.Combine(dir, "host.Development.json");
- File.WriteAllText(filePath, content);
- }
- }
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/hostDevelopment.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/hostDevelopment.cs
deleted file mode 100644
index 01d9707..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/hostDevelopment.cs
+++ /dev/null
@@ -1,305 +0,0 @@
-// ------------------------------------------------------------------------------
-//
-// 此代码由工具生成。
-// 运行时版本: 16.0.0.0
-//
-// 对此文件的更改可能导致不正确的行为,如果
-// 重新生成代码,这些更改将会丢失。
-//
-// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- ///
- /// Class to produce the template output
- ///
-
- #line 1 "D:\MyProject\NetModular\src\Module\CodeGenerator\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\hostDevelopment.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class hostDevelopment : hostDevelopmentBase
- {
-#line hidden
- ///
- /// Create the template output
- ///
- public virtual string TransformText()
- {
- this.Write("{\r\n //开启Swagger\r\n \"Swagger\": true\r\n}");
- return this.GenerationEnvironment.ToString();
- }
- }
-
- #line default
- #line hidden
- #region Base class
- ///
- /// Base class for this transformation
- ///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class hostDevelopmentBase
- {
- #region Fields
- private global::System.Text.StringBuilder generationEnvironmentField;
- private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
- private global::System.Collections.Generic.List indentLengthsField;
- private string currentIndentField = "";
- private bool endsWithNewline;
- private global::System.Collections.Generic.IDictionary sessionField;
- #endregion
- #region Properties
- ///
- /// The string builder that generation-time code is using to assemble generated output
- ///
- protected System.Text.StringBuilder GenerationEnvironment
- {
- get
- {
- if ((this.generationEnvironmentField == null))
- {
- this.generationEnvironmentField = new global::System.Text.StringBuilder();
- }
- return this.generationEnvironmentField;
- }
- set
- {
- this.generationEnvironmentField = value;
- }
- }
- ///
- /// The error collection for the generation process
- ///
- public System.CodeDom.Compiler.CompilerErrorCollection Errors
- {
- get
- {
- if ((this.errorsField == null))
- {
- this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
- }
- return this.errorsField;
- }
- }
- ///
- /// A list of the lengths of each indent that was added with PushIndent
- ///
- private System.Collections.Generic.List indentLengths
- {
- get
- {
- if ((this.indentLengthsField == null))
- {
- this.indentLengthsField = new global::System.Collections.Generic.List();
- }
- return this.indentLengthsField;
- }
- }
- ///
- /// Gets the current indent we use when adding lines to the output
- ///
- public string CurrentIndent
- {
- get
- {
- return this.currentIndentField;
- }
- }
- ///
- /// Current transformation session
- ///
- public virtual global::System.Collections.Generic.IDictionary Session
- {
- get
- {
- return this.sessionField;
- }
- set
- {
- this.sessionField = value;
- }
- }
- #endregion
- #region Transform-time helpers
- ///
- /// Write text directly into the generated output
- ///
- public void Write(string textToAppend)
- {
- if (string.IsNullOrEmpty(textToAppend))
- {
- return;
- }
- // If we're starting off, or if the previous text ended with a newline,
- // we have to append the current indent first.
- if (((this.GenerationEnvironment.Length == 0)
- || this.endsWithNewline))
- {
- this.GenerationEnvironment.Append(this.currentIndentField);
- this.endsWithNewline = false;
- }
- // Check if the current text ends with a newline
- if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
- {
- this.endsWithNewline = true;
- }
- // This is an optimization. If the current indent is "", then we don't have to do any
- // of the more complex stuff further down.
- if ((this.currentIndentField.Length == 0))
- {
- this.GenerationEnvironment.Append(textToAppend);
- return;
- }
- // Everywhere there is a newline in the text, add an indent after it
- textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
- // If the text ends with a newline, then we should strip off the indent added at the very end
- // because the appropriate indent will be added when the next time Write() is called
- if (this.endsWithNewline)
- {
- this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
- }
- else
- {
- this.GenerationEnvironment.Append(textToAppend);
- }
- }
- ///
- /// Write text directly into the generated output
- ///
- public void WriteLine(string textToAppend)
- {
- this.Write(textToAppend);
- this.GenerationEnvironment.AppendLine();
- this.endsWithNewline = true;
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void Write(string format, params object[] args)
- {
- this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void WriteLine(string format, params object[] args)
- {
- this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Raise an error
- ///
- public void Error(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- this.Errors.Add(error);
- }
- ///
- /// Raise a warning
- ///
- public void Warning(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- error.IsWarning = true;
- this.Errors.Add(error);
- }
- ///
- /// Increase the indent
- ///
- public void PushIndent(string indent)
- {
- if ((indent == null))
- {
- throw new global::System.ArgumentNullException("indent");
- }
- this.currentIndentField = (this.currentIndentField + indent);
- this.indentLengths.Add(indent.Length);
- }
- ///
- /// Remove the last indent that was added with PushIndent
- ///
- public string PopIndent()
- {
- string returnValue = "";
- if ((this.indentLengths.Count > 0))
- {
- int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
- this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
- if ((indentLength > 0))
- {
- returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
- this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
- }
- }
- return returnValue;
- }
- ///
- /// Remove any indentation
- ///
- public void ClearIndent()
- {
- this.indentLengths.Clear();
- this.currentIndentField = "";
- }
- #endregion
- #region ToString Helpers
- ///
- /// Utility class to produce culture-oriented representation of an object as a string.
- ///
- public class ToStringInstanceHelper
- {
- private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
- ///
- /// Gets or sets format provider to be used by ToStringWithCulture method.
- ///
- public System.IFormatProvider FormatProvider
- {
- get
- {
- return this.formatProviderField ;
- }
- set
- {
- if ((value != null))
- {
- this.formatProviderField = value;
- }
- }
- }
- ///
- /// This is called from the compile/run appdomain to convert objects within an expression block to a string
- ///
- public string ToStringWithCulture(object objectToConvert)
- {
- if ((objectToConvert == null))
- {
- throw new global::System.ArgumentNullException("objectToConvert");
- }
- System.Type t = objectToConvert.GetType();
- System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
- typeof(System.IFormatProvider)});
- if ((method == null))
- {
- return objectToConvert.ToString();
- }
- else
- {
- return ((string)(method.Invoke(objectToConvert, new object[] {
- this.formatProviderField })));
- }
- }
- }
- private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
- ///
- /// Helper to produce culture-oriented representation of an object as a string
- ///
- public ToStringInstanceHelper ToStringHelper
- {
- get
- {
- return this.toStringHelperField;
- }
- }
- #endregion
- }
- #endregion
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/hostDevelopment.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/hostDevelopment.tt
deleted file mode 100644
index 64e97ab..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/hostDevelopment.tt
+++ /dev/null
@@ -1,5 +0,0 @@
-<#@ template language="C#" #>
-{
- //开启Swagger
- "Swagger": true
-}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwt.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwt.Extend.cs
deleted file mode 100644
index 59fbd18..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwt.Extend.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.IO;
-using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- public partial class jwt : ITemplateHandler
- {
- private readonly TemplateBuildModel _model;
-
- public jwt(TemplateBuildModel model)
- {
- _model = model;
- }
-
- public void Save()
- {
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost/config");
- if (!Directory.Exists(dir))
- Directory.CreateDirectory(dir);
-
- var content = TransformText();
- var filePath = Path.Combine(dir, "jwt.json");
- File.WriteAllText(filePath, content);
- }
- }
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwt.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwt.tt
deleted file mode 100644
index 8d8042d..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwt.tt
+++ /dev/null
@@ -1,11 +0,0 @@
-<#@ template language="C#" #>
-{
- //秘钥
- "Key": "twAJ$j5##pVc5*y&",
- //发行商
- "Issuer": "http://www.iamoldli.com",
- //订阅者
- "Audience": "http://www.iamoldli.com",
- //有效期(分钟)
- "Expires": 120
-}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwtDevelopment.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwtDevelopment.Extend.cs
deleted file mode 100644
index 1b4dc6a..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwtDevelopment.Extend.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.IO;
-using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- public partial class jwtDevelopment : ITemplateHandler
- {
- private readonly TemplateBuildModel _model;
-
- public jwtDevelopment(TemplateBuildModel model)
- {
- _model = model;
- }
-
- public void Save()
- {
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost/config");
- if (!Directory.Exists(dir))
- Directory.CreateDirectory(dir);
-
- var content = TransformText();
- var filePath = Path.Combine(dir, "jwt.Development.json");
- File.WriteAllText(filePath, content);
- }
- }
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwtDevelopment.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwtDevelopment.cs
deleted file mode 100644
index 5ad57f9..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwtDevelopment.cs
+++ /dev/null
@@ -1,307 +0,0 @@
-// ------------------------------------------------------------------------------
-//
-// 此代码由工具生成。
-// 运行时版本: 16.0.0.0
-//
-// 对此文件的更改可能导致不正确的行为,如果
-// 重新生成代码,这些更改将会丢失。
-//
-// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- using System;
-
- ///
- /// Class to produce the template output
- ///
-
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\jwtDevelopment.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class jwtDevelopment : jwtDevelopmentBase
- {
-#line hidden
- ///
- /// Create the template output
- ///
- public virtual string TransformText()
- {
- this.Write("{}");
- return this.GenerationEnvironment.ToString();
- }
- }
-
- #line default
- #line hidden
- #region Base class
- ///
- /// Base class for this transformation
- ///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class jwtDevelopmentBase
- {
- #region Fields
- private global::System.Text.StringBuilder generationEnvironmentField;
- private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
- private global::System.Collections.Generic.List indentLengthsField;
- private string currentIndentField = "";
- private bool endsWithNewline;
- private global::System.Collections.Generic.IDictionary sessionField;
- #endregion
- #region Properties
- ///
- /// The string builder that generation-time code is using to assemble generated output
- ///
- protected System.Text.StringBuilder GenerationEnvironment
- {
- get
- {
- if ((this.generationEnvironmentField == null))
- {
- this.generationEnvironmentField = new global::System.Text.StringBuilder();
- }
- return this.generationEnvironmentField;
- }
- set
- {
- this.generationEnvironmentField = value;
- }
- }
- ///
- /// The error collection for the generation process
- ///
- public System.CodeDom.Compiler.CompilerErrorCollection Errors
- {
- get
- {
- if ((this.errorsField == null))
- {
- this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
- }
- return this.errorsField;
- }
- }
- ///
- /// A list of the lengths of each indent that was added with PushIndent
- ///
- private System.Collections.Generic.List indentLengths
- {
- get
- {
- if ((this.indentLengthsField == null))
- {
- this.indentLengthsField = new global::System.Collections.Generic.List();
- }
- return this.indentLengthsField;
- }
- }
- ///
- /// Gets the current indent we use when adding lines to the output
- ///
- public string CurrentIndent
- {
- get
- {
- return this.currentIndentField;
- }
- }
- ///
- /// Current transformation session
- ///
- public virtual global::System.Collections.Generic.IDictionary Session
- {
- get
- {
- return this.sessionField;
- }
- set
- {
- this.sessionField = value;
- }
- }
- #endregion
- #region Transform-time helpers
- ///
- /// Write text directly into the generated output
- ///
- public void Write(string textToAppend)
- {
- if (string.IsNullOrEmpty(textToAppend))
- {
- return;
- }
- // If we're starting off, or if the previous text ended with a newline,
- // we have to append the current indent first.
- if (((this.GenerationEnvironment.Length == 0)
- || this.endsWithNewline))
- {
- this.GenerationEnvironment.Append(this.currentIndentField);
- this.endsWithNewline = false;
- }
- // Check if the current text ends with a newline
- if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
- {
- this.endsWithNewline = true;
- }
- // This is an optimization. If the current indent is "", then we don't have to do any
- // of the more complex stuff further down.
- if ((this.currentIndentField.Length == 0))
- {
- this.GenerationEnvironment.Append(textToAppend);
- return;
- }
- // Everywhere there is a newline in the text, add an indent after it
- textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
- // If the text ends with a newline, then we should strip off the indent added at the very end
- // because the appropriate indent will be added when the next time Write() is called
- if (this.endsWithNewline)
- {
- this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
- }
- else
- {
- this.GenerationEnvironment.Append(textToAppend);
- }
- }
- ///
- /// Write text directly into the generated output
- ///
- public void WriteLine(string textToAppend)
- {
- this.Write(textToAppend);
- this.GenerationEnvironment.AppendLine();
- this.endsWithNewline = true;
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void Write(string format, params object[] args)
- {
- this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void WriteLine(string format, params object[] args)
- {
- this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Raise an error
- ///
- public void Error(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- this.Errors.Add(error);
- }
- ///
- /// Raise a warning
- ///
- public void Warning(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- error.IsWarning = true;
- this.Errors.Add(error);
- }
- ///
- /// Increase the indent
- ///
- public void PushIndent(string indent)
- {
- if ((indent == null))
- {
- throw new global::System.ArgumentNullException("indent");
- }
- this.currentIndentField = (this.currentIndentField + indent);
- this.indentLengths.Add(indent.Length);
- }
- ///
- /// Remove the last indent that was added with PushIndent
- ///
- public string PopIndent()
- {
- string returnValue = "";
- if ((this.indentLengths.Count > 0))
- {
- int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
- this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
- if ((indentLength > 0))
- {
- returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
- this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
- }
- }
- return returnValue;
- }
- ///
- /// Remove any indentation
- ///
- public void ClearIndent()
- {
- this.indentLengths.Clear();
- this.currentIndentField = "";
- }
- #endregion
- #region ToString Helpers
- ///
- /// Utility class to produce culture-oriented representation of an object as a string.
- ///
- public class ToStringInstanceHelper
- {
- private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
- ///
- /// Gets or sets format provider to be used by ToStringWithCulture method.
- ///
- public System.IFormatProvider FormatProvider
- {
- get
- {
- return this.formatProviderField ;
- }
- set
- {
- if ((value != null))
- {
- this.formatProviderField = value;
- }
- }
- }
- ///
- /// This is called from the compile/run appdomain to convert objects within an expression block to a string
- ///
- public string ToStringWithCulture(object objectToConvert)
- {
- if ((objectToConvert == null))
- {
- throw new global::System.ArgumentNullException("objectToConvert");
- }
- System.Type t = objectToConvert.GetType();
- System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
- typeof(System.IFormatProvider)});
- if ((method == null))
- {
- return objectToConvert.ToString();
- }
- else
- {
- return ((string)(method.Invoke(objectToConvert, new object[] {
- this.formatProviderField })));
- }
- }
- }
- private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
- ///
- /// Helper to produce culture-oriented representation of an object as a string
- ///
- public ToStringInstanceHelper ToStringHelper
- {
- get
- {
- return this.toStringHelperField;
- }
- }
- #endregion
- }
- #endregion
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwtDevelopment.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwtDevelopment.tt
deleted file mode 100644
index 60f9b38..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/jwtDevelopment.tt
+++ /dev/null
@@ -1,2 +0,0 @@
-<#@ template language="C#" #>
-{}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/logging.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/logging.Extend.cs
deleted file mode 100644
index 9c6a012..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/logging.Extend.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.IO;
-using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- public partial class logging : ITemplateHandler
- {
- private readonly TemplateBuildModel _model;
-
- public logging(TemplateBuildModel model)
- {
- _model = model;
- }
-
- public void Save()
- {
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost/config");
- if (!Directory.Exists(dir))
- Directory.CreateDirectory(dir);
-
- var content = TransformText();
- var filePath = Path.Combine(dir, "logging.json");
- File.WriteAllText(filePath, content);
- }
- }
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/logging.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/logging.tt
deleted file mode 100644
index 9942aee..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/logging.tt
+++ /dev/null
@@ -1,36 +0,0 @@
-<#@ template language="C#" #>
-{
- "Serilog": {
- "MinimumLevel": {
- "Default": "Error",
- "Override": {
- "Microsoft": "Error",
- "System": "Error"
- }
- },
- "WriteTo": [
- {
- "Name": "Console",
- "Args": {
- "theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console",
- "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} {NewLine}{Exception}"
- }
- },
- {
- "Name": "File",
- "Args": {
- //文件路径
- "path": "log/log.log",
- //文件滚动方式
- "rollingInterval": "Day",
- //消息输出格式
- "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
- //文件数量
- "retainedFileCountLimit": 60,
- //使用缓冲,提高写入效率
- "buffered": false
- }
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/loggingDevelopment.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/loggingDevelopment.Extend.cs
deleted file mode 100644
index 4bea644..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/loggingDevelopment.Extend.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.IO;
-using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- public partial class loggingDevelopment : ITemplateHandler
- {
- private readonly TemplateBuildModel _model;
-
- public loggingDevelopment(TemplateBuildModel model)
- {
- _model = model;
- }
-
- public void Save()
- {
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost/config");
- if (!Directory.Exists(dir))
- Directory.CreateDirectory(dir);
-
- var content = TransformText();
- var filePath = Path.Combine(dir, "logging.Development.json");
- File.WriteAllText(filePath, content);
- }
- }
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/loggingDevelopment.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/loggingDevelopment.tt
deleted file mode 100644
index 496e46a..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/loggingDevelopment.tt
+++ /dev/null
@@ -1,12 +0,0 @@
-<#@ template language="C#" #>
-{
- "Serilog": {
- "MinimumLevel": {
- "Default": "Debug",
- "Override": {
- "Microsoft": "Debug",
- "System": "Debug"
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/module.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/module.Extend.cs
deleted file mode 100644
index 37d8311..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/module.Extend.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.IO;
-using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- public partial class module : ITemplateHandler
- {
- private readonly TemplateBuildModel _model;
-
- public module(TemplateBuildModel model)
- {
- _model = model;
- }
-
- public void Save()
- {
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost/config");
- if (!Directory.Exists(dir))
- Directory.CreateDirectory(dir);
-
- var content = TransformText();
- var filePath = Path.Combine(dir, "module.json");
- File.WriteAllText(filePath, content);
- }
- }
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/module.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/module.cs
deleted file mode 100644
index 5916813..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/module.cs
+++ /dev/null
@@ -1,309 +0,0 @@
-// ------------------------------------------------------------------------------
-//
-// 此代码由工具生成。
-// 运行时版本: 16.0.0.0
-//
-// 对此文件的更改可能导致不正确的行为,如果
-// 重新生成代码,这些更改将会丢失。
-//
-// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- using System;
-
- ///
- /// Class to produce the template output
- ///
-
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\module.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class module : moduleBase
- {
-#line hidden
- ///
- /// Create the template output
- ///
- public virtual string TransformText()
- {
- this.Write("{\r\n //文件上传路径\r\n \"UploadPath\": \"\", \r\n //临时文件路径\r\n \"TempPath\": \"\",\r\n //权限管理模块配置\r" +
- "\n \"Admin\": {\r\n //是否开启审计功能\r\n \"Auditing\": true,\r\n //是否开启权限验证\r\n \"Permi" +
- "ssionValidate\": true\r\n }\r\n}");
- return this.GenerationEnvironment.ToString();
- }
- }
-
- #line default
- #line hidden
- #region Base class
- ///
- /// Base class for this transformation
- ///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class moduleBase
- {
- #region Fields
- private global::System.Text.StringBuilder generationEnvironmentField;
- private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
- private global::System.Collections.Generic.List indentLengthsField;
- private string currentIndentField = "";
- private bool endsWithNewline;
- private global::System.Collections.Generic.IDictionary sessionField;
- #endregion
- #region Properties
- ///
- /// The string builder that generation-time code is using to assemble generated output
- ///
- protected System.Text.StringBuilder GenerationEnvironment
- {
- get
- {
- if ((this.generationEnvironmentField == null))
- {
- this.generationEnvironmentField = new global::System.Text.StringBuilder();
- }
- return this.generationEnvironmentField;
- }
- set
- {
- this.generationEnvironmentField = value;
- }
- }
- ///
- /// The error collection for the generation process
- ///
- public System.CodeDom.Compiler.CompilerErrorCollection Errors
- {
- get
- {
- if ((this.errorsField == null))
- {
- this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
- }
- return this.errorsField;
- }
- }
- ///
- /// A list of the lengths of each indent that was added with PushIndent
- ///
- private System.Collections.Generic.List indentLengths
- {
- get
- {
- if ((this.indentLengthsField == null))
- {
- this.indentLengthsField = new global::System.Collections.Generic.List();
- }
- return this.indentLengthsField;
- }
- }
- ///
- /// Gets the current indent we use when adding lines to the output
- ///
- public string CurrentIndent
- {
- get
- {
- return this.currentIndentField;
- }
- }
- ///
- /// Current transformation session
- ///
- public virtual global::System.Collections.Generic.IDictionary Session
- {
- get
- {
- return this.sessionField;
- }
- set
- {
- this.sessionField = value;
- }
- }
- #endregion
- #region Transform-time helpers
- ///
- /// Write text directly into the generated output
- ///
- public void Write(string textToAppend)
- {
- if (string.IsNullOrEmpty(textToAppend))
- {
- return;
- }
- // If we're starting off, or if the previous text ended with a newline,
- // we have to append the current indent first.
- if (((this.GenerationEnvironment.Length == 0)
- || this.endsWithNewline))
- {
- this.GenerationEnvironment.Append(this.currentIndentField);
- this.endsWithNewline = false;
- }
- // Check if the current text ends with a newline
- if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
- {
- this.endsWithNewline = true;
- }
- // This is an optimization. If the current indent is "", then we don't have to do any
- // of the more complex stuff further down.
- if ((this.currentIndentField.Length == 0))
- {
- this.GenerationEnvironment.Append(textToAppend);
- return;
- }
- // Everywhere there is a newline in the text, add an indent after it
- textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
- // If the text ends with a newline, then we should strip off the indent added at the very end
- // because the appropriate indent will be added when the next time Write() is called
- if (this.endsWithNewline)
- {
- this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
- }
- else
- {
- this.GenerationEnvironment.Append(textToAppend);
- }
- }
- ///
- /// Write text directly into the generated output
- ///
- public void WriteLine(string textToAppend)
- {
- this.Write(textToAppend);
- this.GenerationEnvironment.AppendLine();
- this.endsWithNewline = true;
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void Write(string format, params object[] args)
- {
- this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void WriteLine(string format, params object[] args)
- {
- this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Raise an error
- ///
- public void Error(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- this.Errors.Add(error);
- }
- ///
- /// Raise a warning
- ///
- public void Warning(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- error.IsWarning = true;
- this.Errors.Add(error);
- }
- ///
- /// Increase the indent
- ///
- public void PushIndent(string indent)
- {
- if ((indent == null))
- {
- throw new global::System.ArgumentNullException("indent");
- }
- this.currentIndentField = (this.currentIndentField + indent);
- this.indentLengths.Add(indent.Length);
- }
- ///
- /// Remove the last indent that was added with PushIndent
- ///
- public string PopIndent()
- {
- string returnValue = "";
- if ((this.indentLengths.Count > 0))
- {
- int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
- this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
- if ((indentLength > 0))
- {
- returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
- this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
- }
- }
- return returnValue;
- }
- ///
- /// Remove any indentation
- ///
- public void ClearIndent()
- {
- this.indentLengths.Clear();
- this.currentIndentField = "";
- }
- #endregion
- #region ToString Helpers
- ///
- /// Utility class to produce culture-oriented representation of an object as a string.
- ///
- public class ToStringInstanceHelper
- {
- private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
- ///
- /// Gets or sets format provider to be used by ToStringWithCulture method.
- ///
- public System.IFormatProvider FormatProvider
- {
- get
- {
- return this.formatProviderField ;
- }
- set
- {
- if ((value != null))
- {
- this.formatProviderField = value;
- }
- }
- }
- ///
- /// This is called from the compile/run appdomain to convert objects within an expression block to a string
- ///
- public string ToStringWithCulture(object objectToConvert)
- {
- if ((objectToConvert == null))
- {
- throw new global::System.ArgumentNullException("objectToConvert");
- }
- System.Type t = objectToConvert.GetType();
- System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
- typeof(System.IFormatProvider)});
- if ((method == null))
- {
- return objectToConvert.ToString();
- }
- else
- {
- return ((string)(method.Invoke(objectToConvert, new object[] {
- this.formatProviderField })));
- }
- }
- }
- private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
- ///
- /// Helper to produce culture-oriented representation of an object as a string
- ///
- public ToStringInstanceHelper ToStringHelper
- {
- get
- {
- return this.toStringHelperField;
- }
- }
- #endregion
- }
- #endregion
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/module.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/module.tt
deleted file mode 100644
index be8bd51..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/module.tt
+++ /dev/null
@@ -1,14 +0,0 @@
-<#@ template language="C#" #>
-{
- //文件上传路径
- "UploadPath": "",
- //临时文件路径
- "TempPath": "",
- //权限管理模块配置
- "Admin": {
- //是否开启审计功能
- "Auditing": true,
- //是否开启权限验证
- "PermissionValidate": true
- }
-}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/moduleDevelopment.Extend.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/moduleDevelopment.Extend.cs
deleted file mode 100644
index dc84d3c..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/moduleDevelopment.Extend.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.IO;
-using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
-
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- public partial class moduleDevelopment : ITemplateHandler
- {
- private readonly TemplateBuildModel _model;
-
- public moduleDevelopment(TemplateBuildModel model)
- {
- _model = model;
- }
-
- public void Save()
- {
- var dir = Path.Combine(_model.RootPath, _model.Project.Code, "src/WebHost/config");
- if (!Directory.Exists(dir))
- Directory.CreateDirectory(dir);
-
- var content = TransformText();
- var filePath = Path.Combine(dir, "module.Development.json");
- File.WriteAllText(filePath, content);
- }
- }
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/moduleDevelopment.cs b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/moduleDevelopment.cs
deleted file mode 100644
index ec4399f..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/moduleDevelopment.cs
+++ /dev/null
@@ -1,307 +0,0 @@
-// ------------------------------------------------------------------------------
-//
-// 此代码由工具生成。
-// 运行时版本: 16.0.0.0
-//
-// 对此文件的更改可能导致不正确的行为,如果
-// 重新生成代码,这些更改将会丢失。
-//
-// ------------------------------------------------------------------------------
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Default.T4.src.WebHost.config
-{
- using System;
-
- ///
- /// Class to produce the template output
- ///
-
- #line 1 "D:\MyProject\NetModular.Module.CodeGenerator\src\Library\Infrastructure\Templates\Default\T4\src\WebHost\config\moduleDevelopment.tt"
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public partial class moduleDevelopment : moduleDevelopmentBase
- {
-#line hidden
- ///
- /// Create the template output
- ///
- public virtual string TransformText()
- {
- this.Write("{\r\n\r\n}");
- return this.GenerationEnvironment.ToString();
- }
- }
-
- #line default
- #line hidden
- #region Base class
- ///
- /// Base class for this transformation
- ///
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")]
- public class moduleDevelopmentBase
- {
- #region Fields
- private global::System.Text.StringBuilder generationEnvironmentField;
- private global::System.CodeDom.Compiler.CompilerErrorCollection errorsField;
- private global::System.Collections.Generic.List indentLengthsField;
- private string currentIndentField = "";
- private bool endsWithNewline;
- private global::System.Collections.Generic.IDictionary sessionField;
- #endregion
- #region Properties
- ///
- /// The string builder that generation-time code is using to assemble generated output
- ///
- protected System.Text.StringBuilder GenerationEnvironment
- {
- get
- {
- if ((this.generationEnvironmentField == null))
- {
- this.generationEnvironmentField = new global::System.Text.StringBuilder();
- }
- return this.generationEnvironmentField;
- }
- set
- {
- this.generationEnvironmentField = value;
- }
- }
- ///
- /// The error collection for the generation process
- ///
- public System.CodeDom.Compiler.CompilerErrorCollection Errors
- {
- get
- {
- if ((this.errorsField == null))
- {
- this.errorsField = new global::System.CodeDom.Compiler.CompilerErrorCollection();
- }
- return this.errorsField;
- }
- }
- ///
- /// A list of the lengths of each indent that was added with PushIndent
- ///
- private System.Collections.Generic.List indentLengths
- {
- get
- {
- if ((this.indentLengthsField == null))
- {
- this.indentLengthsField = new global::System.Collections.Generic.List();
- }
- return this.indentLengthsField;
- }
- }
- ///
- /// Gets the current indent we use when adding lines to the output
- ///
- public string CurrentIndent
- {
- get
- {
- return this.currentIndentField;
- }
- }
- ///
- /// Current transformation session
- ///
- public virtual global::System.Collections.Generic.IDictionary Session
- {
- get
- {
- return this.sessionField;
- }
- set
- {
- this.sessionField = value;
- }
- }
- #endregion
- #region Transform-time helpers
- ///
- /// Write text directly into the generated output
- ///
- public void Write(string textToAppend)
- {
- if (string.IsNullOrEmpty(textToAppend))
- {
- return;
- }
- // If we're starting off, or if the previous text ended with a newline,
- // we have to append the current indent first.
- if (((this.GenerationEnvironment.Length == 0)
- || this.endsWithNewline))
- {
- this.GenerationEnvironment.Append(this.currentIndentField);
- this.endsWithNewline = false;
- }
- // Check if the current text ends with a newline
- if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture))
- {
- this.endsWithNewline = true;
- }
- // This is an optimization. If the current indent is "", then we don't have to do any
- // of the more complex stuff further down.
- if ((this.currentIndentField.Length == 0))
- {
- this.GenerationEnvironment.Append(textToAppend);
- return;
- }
- // Everywhere there is a newline in the text, add an indent after it
- textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
- // If the text ends with a newline, then we should strip off the indent added at the very end
- // because the appropriate indent will be added when the next time Write() is called
- if (this.endsWithNewline)
- {
- this.GenerationEnvironment.Append(textToAppend, 0, (textToAppend.Length - this.currentIndentField.Length));
- }
- else
- {
- this.GenerationEnvironment.Append(textToAppend);
- }
- }
- ///
- /// Write text directly into the generated output
- ///
- public void WriteLine(string textToAppend)
- {
- this.Write(textToAppend);
- this.GenerationEnvironment.AppendLine();
- this.endsWithNewline = true;
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void Write(string format, params object[] args)
- {
- this.Write(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Write formatted text directly into the generated output
- ///
- public void WriteLine(string format, params object[] args)
- {
- this.WriteLine(string.Format(global::System.Globalization.CultureInfo.CurrentCulture, format, args));
- }
- ///
- /// Raise an error
- ///
- public void Error(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- this.Errors.Add(error);
- }
- ///
- /// Raise a warning
- ///
- public void Warning(string message)
- {
- System.CodeDom.Compiler.CompilerError error = new global::System.CodeDom.Compiler.CompilerError();
- error.ErrorText = message;
- error.IsWarning = true;
- this.Errors.Add(error);
- }
- ///
- /// Increase the indent
- ///
- public void PushIndent(string indent)
- {
- if ((indent == null))
- {
- throw new global::System.ArgumentNullException("indent");
- }
- this.currentIndentField = (this.currentIndentField + indent);
- this.indentLengths.Add(indent.Length);
- }
- ///
- /// Remove the last indent that was added with PushIndent
- ///
- public string PopIndent()
- {
- string returnValue = "";
- if ((this.indentLengths.Count > 0))
- {
- int indentLength = this.indentLengths[(this.indentLengths.Count - 1)];
- this.indentLengths.RemoveAt((this.indentLengths.Count - 1));
- if ((indentLength > 0))
- {
- returnValue = this.currentIndentField.Substring((this.currentIndentField.Length - indentLength));
- this.currentIndentField = this.currentIndentField.Remove((this.currentIndentField.Length - indentLength));
- }
- }
- return returnValue;
- }
- ///
- /// Remove any indentation
- ///
- public void ClearIndent()
- {
- this.indentLengths.Clear();
- this.currentIndentField = "";
- }
- #endregion
- #region ToString Helpers
- ///
- /// Utility class to produce culture-oriented representation of an object as a string.
- ///
- public class ToStringInstanceHelper
- {
- private System.IFormatProvider formatProviderField = global::System.Globalization.CultureInfo.InvariantCulture;
- ///
- /// Gets or sets format provider to be used by ToStringWithCulture method.
- ///
- public System.IFormatProvider FormatProvider
- {
- get
- {
- return this.formatProviderField ;
- }
- set
- {
- if ((value != null))
- {
- this.formatProviderField = value;
- }
- }
- }
- ///
- /// This is called from the compile/run appdomain to convert objects within an expression block to a string
- ///
- public string ToStringWithCulture(object objectToConvert)
- {
- if ((objectToConvert == null))
- {
- throw new global::System.ArgumentNullException("objectToConvert");
- }
- System.Type t = objectToConvert.GetType();
- System.Reflection.MethodInfo method = t.GetMethod("ToString", new System.Type[] {
- typeof(System.IFormatProvider)});
- if ((method == null))
- {
- return objectToConvert.ToString();
- }
- else
- {
- return ((string)(method.Invoke(objectToConvert, new object[] {
- this.formatProviderField })));
- }
- }
- }
- private ToStringInstanceHelper toStringHelperField = new ToStringInstanceHelper();
- ///
- /// Helper to produce culture-oriented representation of an object as a string
- ///
- public ToStringInstanceHelper ToStringHelper
- {
- get
- {
- return this.toStringHelperField;
- }
- }
- #endregion
- }
- #endregion
-}
diff --git a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/moduleDevelopment.tt b/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/moduleDevelopment.tt
deleted file mode 100644
index da10b29..0000000
--- a/src/Library/Infrastructure/Templates/Default/T4/src/WebHost/config/moduleDevelopment.tt
+++ /dev/null
@@ -1,4 +0,0 @@
-<#@ template language="C#" #>
-{
-
-}
\ No newline at end of file
diff --git a/src/Library/Infrastructure/Templates/ITemplateHandler.cs b/src/Library/Infrastructure/Templates/ITemplateHandler.cs
index c9449e7..61ae888 100644
--- a/src/Library/Infrastructure/Templates/ITemplateHandler.cs
+++ b/src/Library/Infrastructure/Templates/ITemplateHandler.cs
@@ -5,6 +5,11 @@
///
public interface ITemplateHandler
{
+ ///
+ /// 是否是全局文件
+ ///
+ bool IsGlobal { get; }
+
///
/// 保存
///
diff --git a/src/Library/Infrastructure/Templates/Models/ClassBuildModel.cs b/src/Library/Infrastructure/Templates/Models/ClassBuildModel.cs
index 1971899..2d760c5 100644
--- a/src/Library/Infrastructure/Templates/Models/ClassBuildModel.cs
+++ b/src/Library/Infrastructure/Templates/Models/ClassBuildModel.cs
@@ -32,6 +32,11 @@ public class ClassBuildModel
///
public string Remarks { get; set; }
+ ///
+ /// 菜单图标
+ ///
+ public string MenuIcon { get; set; }
+
///
/// 主键类型名称
///
@@ -39,10 +44,11 @@ public string PrimaryKeyTypeName
{
get
{
- var name = BaseEntityType.ToDescription();
- if (name.Contains("Int")) return "int";
- if (name.Contains("Long")) return "long";
- return "Guid";
+ var name = BaseEntityType.ToDescription().ToLower();
+ if (name.Contains("int")) return "int";
+ if (name.Contains("long")) return "long";
+ if (name.Contains("guid")) return "Guid";
+ return "string";
}
}
diff --git a/src/Library/Infrastructure/Templates/Models/ProjectBuildModel.cs b/src/Library/Infrastructure/Templates/Models/ModuleBuildModel.cs
similarity index 61%
rename from src/Library/Infrastructure/Templates/Models/ProjectBuildModel.cs
rename to src/Library/Infrastructure/Templates/Models/ModuleBuildModel.cs
index 2b6ca73..446a53f 100644
--- a/src/Library/Infrastructure/Templates/Models/ProjectBuildModel.cs
+++ b/src/Library/Infrastructure/Templates/Models/ModuleBuildModel.cs
@@ -3,9 +3,9 @@
namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Models
{
///
- /// 项目生成模型
+ /// 模块生成模型
///
- public class ProjectBuildModel
+ public class ModuleBuildModel
{
///
/// 名称
@@ -17,11 +17,21 @@ public class ProjectBuildModel
///
public int No { get; set; }
+ ///
+ /// 图标
+ ///
+ public string Icon { get; set; }
+
///
/// 前缀
///
public string Prefix { get; set; }
+ ///
+ /// 前端组件前缀
+ ///
+ public string UiPrefix { get; set; }
+
///
/// 编码
///
@@ -32,6 +42,21 @@ public class ProjectBuildModel
///
public string Copyright { get; set; }
+ ///
+ /// 公司单位
+ ///
+ public string Company { get; set; }
+
+ ///
+ /// 官方地址
+ ///
+ public string ProjectUrl { get; set; }
+
+ ///
+ /// 仓库地址
+ ///
+ public string RepositoryUrl { get; set; }
+
///
/// 类列表
///
diff --git a/src/Library/Infrastructure/Templates/Models/TemplateBuildModel.cs b/src/Library/Infrastructure/Templates/Models/TemplateBuildModel.cs
index 9af63f1..8930cb8 100644
--- a/src/Library/Infrastructure/Templates/Models/TemplateBuildModel.cs
+++ b/src/Library/Infrastructure/Templates/Models/TemplateBuildModel.cs
@@ -1,18 +1,30 @@
-namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Models
+using NetModular.Module.CodeGenerator.Infrastructure.NuGet;
+
+namespace NetModular.Module.CodeGenerator.Infrastructure.Templates.Models
{
///
/// 模板生成模型
///
public class TemplateBuildModel
{
+ ///
+ /// 生成整个解决方案
+ ///
+ public bool GenerateSln { get; set; }
+
///
/// 代码存储根路径
///
public string RootPath { get; set; }
///
- /// 项目
+ /// 模块模型
+ ///
+ public ModuleBuildModel Module { get; set; }
+
+ ///
+ /// NuGet包版本
///
- public ProjectBuildModel Project { get; set; }
+ public NuGetPackageVersions NuGetPackageVersions { get; set; }
}
}
diff --git a/src/Library/Infrastructure/Templates/TemplateBuilderAbstract.cs b/src/Library/Infrastructure/Templates/TemplateBuilderAbstract.cs
index 604aab9..a223bc2 100644
--- a/src/Library/Infrastructure/Templates/TemplateBuilderAbstract.cs
+++ b/src/Library/Infrastructure/Templates/TemplateBuilderAbstract.cs
@@ -2,7 +2,6 @@
using System.IO;
using System.Linq;
using System.Reflection;
-using NetModular.Lib.Utils.Core;
using NetModular.Module.CodeGenerator.Infrastructure.Templates.Models;
namespace NetModular.Module.CodeGenerator.Infrastructure.Templates
@@ -20,9 +19,8 @@ public virtual void Build(TemplateBuildModel model)
{
Check.NotNull(model, nameof(TemplateBuildModel), "模板生成模型不能为空");
- var dir = Path.Combine(model.RootPath, model.Project.Code);
- if (!Directory.Exists(dir))
- Directory.CreateDirectory(dir);
+ if (!Directory.Exists(model.RootPath))
+ Directory.CreateDirectory(model.RootPath);
var handlerTypeList = Assembly.GetExecutingAssembly().GetTypes().Where(t =>
typeof(ITemplateHandler) != t && typeof(ITemplateHandler).IsAssignableFrom(t)
@@ -31,7 +29,8 @@ public virtual void Build(TemplateBuildModel model)
foreach (var type in handlerTypeList)
{
var instance = (ITemplateHandler)Activator.CreateInstance(type, model);
- instance.Save();
+ if (model.GenerateSln || !instance.IsGlobal)
+ instance.Save();
}
}
}
diff --git a/src/Library/Infrastructure/_modules/CodeGenerator/_module.json b/src/Library/Infrastructure/_modules/CodeGenerator/_module.json
deleted file mode 100644
index 8d317de..0000000
--- a/src/Library/Infrastructure/_modules/CodeGenerator/_module.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Id": "CodeGenerator","Name":"代码生成器","Version":"1.4.5"}
diff --git a/src/UI/module-code-generator/.editorconfig b/src/UI/module-code-generator/.editorconfig
deleted file mode 100644
index 7053c49..0000000
--- a/src/UI/module-code-generator/.editorconfig
+++ /dev/null
@@ -1,5 +0,0 @@
-[*.{js,jsx,ts,tsx,vue}]
-indent_style = space
-indent_size = 2
-trim_trailing_whitespace = true
-insert_final_newline = true
diff --git a/src/UI/module-code-generator/.vscode/settings.json b/src/UI/module-code-generator/.vscode/settings.json
deleted file mode 100644
index ce3d04e..0000000
--- a/src/UI/module-code-generator/.vscode/settings.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "editor.formatOnPaste": true,
- "editor.formatOnSave": true,
- "editor.formatOnType": true,
- "prettier.singleQuote": true,
- "prettier.semi": false,
- "eslint.autoFixOnSave": true,
- "vetur.format.defaultFormatter.html": "prettyhtml",
- "vetur.format.defaultFormatter.js": "vscode-typescript",
- "vetur.format.defaultFormatterOptions": {
- "prettyhtml": {
- "printWidth": 180,
- "singleQuote": false,
- "wrapAttributes": false,
- "sortAttributes": false
- }
- },
- "eslint.validate": [
- "javascript",
- "javascriptreact",
- {
- "language": "vue",
- "autoFix": true
- }
- ],
- "beautify.config": {
- "brace_style": "collapse,preserve-inline"
- }
-}
\ No newline at end of file
diff --git a/src/UI/module-code-generator/package.json b/src/UI/module-code-generator/package.json
deleted file mode 100644
index bdabe5a..0000000
--- a/src/UI/module-code-generator/package.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "name": "netmodular-module-code-generator",
- "version": "1.0.1",
- "author": "Oldli",
- "license": "ISC",
- "code": "codeGenerator",
- "title": "代码生成器",
- "description": "NetModular代码生成器前端模块组件",
- "main": "src/index.js",
- "scripts": {
- "serve": "vue-cli-service serve",
- "build": "vue-cli-service build",
- "lint": "vue-cli-service lint",
- "cm": "rimraf node_modules",
- "cc": "rimraf node_modules/.cache",
- "i": "cd ../../../script && npm_install.ps1",
- "up": "cd ../../../script && npm_update.ps1",
- "pub": "cd ../../../script && npm_publish.ps1"
- },
- "dependencies": {
- "netmodular-module-admin": "^1.0.1",
- "netmodular-ui": "^1.0.4"
- },
- "devDependencies": {
- "@vue/cli-plugin-babel": "^3.10.0",
- "@vue/cli-plugin-eslint": "^3.10.0",
- "@vue/cli-service": "^3.10.0",
- "@vue/eslint-config-standard": "^4.0.0",
- "babel-eslint": "^10.0.2",
- "eslint": "^6.1.0",
- "eslint-config-elemefe": "^0.3.0",
- "eslint-plugin-html": "^6.0.0",
- "eslint-plugin-json": "^1.4.0",
- "eslint-plugin-vue": "^5.2.3",
- "fibers": "^4.0.1",
- "rimraf": "^3.0.0",
- "sass": "^1.22.10",
- "sass-loader": "^7.2.0",
- "uglifyjs-webpack-plugin": "^2.2.0",
- "vue-template-compiler": "^2.6.10"
- }
-}
\ No newline at end of file
diff --git a/src/UI/module-code-generator/src/components/index.js b/src/UI/module-code-generator/src/components/index.js
deleted file mode 100644
index 9859f07..0000000
--- a/src/UI/module-code-generator/src/components/index.js
+++ /dev/null
@@ -1 +0,0 @@
-export default []
diff --git a/src/UI/module-code-generator/src/views/class/components/edit/index.vue b/src/UI/module-code-generator/src/views/class/components/edit/index.vue
deleted file mode 100644
index 9721443..0000000
--- a/src/UI/module-code-generator/src/views/class/components/edit/index.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Add
- Delete
- Edit
- Query
-
-
-
-
-
-
diff --git a/src/UI/module-code-generator/src/views/enum/components/add/index.vue b/src/UI/module-code-generator/src/views/enum/components/add/index.vue
deleted file mode 100644
index f4219fb..0000000
--- a/src/UI/module-code-generator/src/views/enum/components/add/index.vue
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/UI/module-code-generator/src/views/enumItem/components/add/index.vue b/src/UI/module-code-generator/src/views/enumItem/components/add/index.vue
deleted file mode 100644
index 5bbaa23..0000000
--- a/src/UI/module-code-generator/src/views/enumItem/components/add/index.vue
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/UI/module-code-generator/src/views/project/components/add/index.vue b/src/UI/module-code-generator/src/views/project/components/add/index.vue
deleted file mode 100644
index 442080b..0000000
--- a/src/UI/module-code-generator/src/views/project/components/add/index.vue
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/UI/module-code-generator/src/views/project/components/edit/index.vue b/src/UI/module-code-generator/src/views/project/components/edit/index.vue
deleted file mode 100644
index 57ebd56..0000000
--- a/src/UI/module-code-generator/src/views/project/components/edit/index.vue
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/UI/module-code-generator/src/views/project/index/index.vue b/src/UI/module-code-generator/src/views/project/index/index.vue
deleted file mode 100644
index 144bce4..0000000
--- a/src/UI/module-code-generator/src/views/project/index/index.vue
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{row.isShow?'是':'否'}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/UI/module-code-generator/src/views/property/components/edit/index.vue b/src/UI/module-code-generator/src/views/property/components/edit/index.vue
deleted file mode 100644
index 784ec9c..0000000
--- a/src/UI/module-code-generator/src/views/property/components/edit/index.vue
+++ /dev/null
@@ -1,206 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/UI/module-code-generator/.browserslistrc b/src/UI/module-codegenerator/.browserslistrc
similarity index 63%
rename from src/UI/module-code-generator/.browserslistrc
rename to src/UI/module-codegenerator/.browserslistrc
index 9dee646..d6471a3 100644
--- a/src/UI/module-code-generator/.browserslistrc
+++ b/src/UI/module-codegenerator/.browserslistrc
@@ -1,3 +1,2 @@
> 1%
last 2 versions
-not ie <= 8
diff --git a/src/UI/module-code-generator/.eslintrc.js b/src/UI/module-codegenerator/.eslintrc.js
similarity index 53%
rename from src/UI/module-code-generator/.eslintrc.js
rename to src/UI/module-codegenerator/.eslintrc.js
index f3092b0..4ab8d9c 100644
--- a/src/UI/module-code-generator/.eslintrc.js
+++ b/src/UI/module-codegenerator/.eslintrc.js
@@ -3,17 +3,17 @@ module.exports = {
env: {
node: true
},
- extends: ['plugin:vue/essential', '@vue/standard'],
+ extends: ['plugin:vue/essential', '@vue/prettier'],
rules: {
- 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
- 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
- 'space-before-function-paren': 'off'
+ 'no-console': 'off',
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
},
parserOptions: {
parser: 'babel-eslint'
},
globals: {
$http: 'readonly',
- $api: 'readonly'
+ $api: 'readonly',
+ $const: 'readonly'
}
}
diff --git a/src/UI/module-codegenerator/.prettierrc b/src/UI/module-codegenerator/.prettierrc
new file mode 100644
index 0000000..230d376
--- /dev/null
+++ b/src/UI/module-codegenerator/.prettierrc
@@ -0,0 +1,6 @@
+{
+ "tabWidth": 2,
+ "semi": false,
+ "singleQuote": true,
+ "printWidth": 200
+}
diff --git a/src/UI/module-codegenerator/.vscode/settings.json b/src/UI/module-codegenerator/.vscode/settings.json
new file mode 100644
index 0000000..ef42fcf
--- /dev/null
+++ b/src/UI/module-codegenerator/.vscode/settings.json
@@ -0,0 +1,10 @@
+{
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
+ "editor.formatOnPaste": true,
+ "editor.formatOnSave": true,
+ "editor.formatOnType": true,
+ "editor.codeActionsOnSave": {
+ "source.fixAll.tslint": "explicit",
+ "source.fixAll.eslint": "explicit"
+ }
+}
diff --git a/src/UI/module-code-generator/babel.config.js b/src/UI/module-codegenerator/babel.config.js
similarity index 71%
rename from src/UI/module-code-generator/babel.config.js
rename to src/UI/module-codegenerator/babel.config.js
index 2ea5d05..00892ae 100644
--- a/src/UI/module-code-generator/babel.config.js
+++ b/src/UI/module-codegenerator/babel.config.js
@@ -1,7 +1,7 @@
module.exports = {
presets: [
[
- '@vue/app',
+ '@vue/cli-plugin-babel/preset',
{
useBuiltIns: 'entry'
}
diff --git a/src/UI/module-codegenerator/package.json b/src/UI/module-codegenerator/package.json
new file mode 100644
index 0000000..3aaf945
--- /dev/null
+++ b/src/UI/module-codegenerator/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "netmodular-module-codegenerator",
+ "version": "1.0.7",
+ "author": "Oldli",
+ "code": "codeGenerator",
+ "title": "代码生成",
+ "description": "NetModular代码生成器前端模块组件",
+ "main": "src/index.js",
+ "scripts": {
+ "serve": "vue-cli-service serve",
+ "build": "vue-cli-service build",
+ "lint": "vue-cli-service lint",
+ "cm": "rimraf node_modules",
+ "cc": "rimraf node_modules/.cache",
+ "i": "cd ../../../script && npm_install.ps1",
+ "up": "cd ../../../script && npm_update.ps1",
+ "pub": "cd ../../../script && npm_publish.ps1"
+ },
+ "dependencies": {
+ "netmodular-module-admin": "^1.4.7",
+ "netmodular-ui": "^2.0.0"
+ },
+ "devDependencies": {
+ "@vue/cli-plugin-babel": "^4.2.3",
+ "@vue/cli-plugin-eslint": "^4.2.3",
+ "@vue/cli-plugin-router": "^4.2.3",
+ "@vue/cli-plugin-vuex": "^4.2.3",
+ "@vue/cli-service": "^4.2.3",
+ "@vue/eslint-config-prettier": "^5.0.0",
+ "babel-eslint": "^10.1.0",
+ "eslint": "^5.16.0",
+ "eslint-plugin-prettier": "^3.1.2",
+ "eslint-plugin-vue": "^5.0.0",
+ "prettier": "^1.18.2",
+ "rimraf": "^3.0.2",
+ "sass": "^1.26.5",
+ "sass-loader": "^8.0.2",
+ "vue-template-compiler": "^2.6.11"
+ }
+}
diff --git a/src/UI/module-code-generator/postcss.config.js b/src/UI/module-codegenerator/postcss.config.js
similarity index 100%
rename from src/UI/module-code-generator/postcss.config.js
rename to src/UI/module-codegenerator/postcss.config.js
diff --git a/src/UI/module-code-generator/src/api/components/class.js b/src/UI/module-codegenerator/src/api/components/class.js
similarity index 100%
rename from src/UI/module-code-generator/src/api/components/class.js
rename to src/UI/module-codegenerator/src/api/components/class.js
diff --git a/src/UI/module-code-generator/src/api/components/enum.js b/src/UI/module-codegenerator/src/api/components/enum.js
similarity index 100%
rename from src/UI/module-code-generator/src/api/components/enum.js
rename to src/UI/module-codegenerator/src/api/components/enum.js
diff --git a/src/UI/module-code-generator/src/api/components/enumItem.js b/src/UI/module-codegenerator/src/api/components/enumItem.js
similarity index 100%
rename from src/UI/module-code-generator/src/api/components/enumItem.js
rename to src/UI/module-codegenerator/src/api/components/enumItem.js
diff --git a/src/UI/module-code-generator/src/api/components/modelProperty.js b/src/UI/module-codegenerator/src/api/components/modelProperty.js
similarity index 100%
rename from src/UI/module-code-generator/src/api/components/modelProperty.js
rename to src/UI/module-codegenerator/src/api/components/modelProperty.js
diff --git a/src/UI/module-code-generator/src/api/components/project.js b/src/UI/module-codegenerator/src/api/components/module.js
similarity index 100%
rename from src/UI/module-code-generator/src/api/components/project.js
rename to src/UI/module-codegenerator/src/api/components/module.js
diff --git a/src/UI/module-codegenerator/src/api/components/onlineModule.js b/src/UI/module-codegenerator/src/api/components/onlineModule.js
new file mode 100644
index 0000000..11d5839
--- /dev/null
+++ b/src/UI/module-codegenerator/src/api/components/onlineModule.js
@@ -0,0 +1,10 @@
+import module from '../../module'
+
+export default name => {
+ const root = `${module.code}/${name}/`
+ const crud = $http.crud(root)
+
+ return {
+ ...crud
+ }
+}
diff --git a/src/UI/module-code-generator/src/api/components/property.js b/src/UI/module-codegenerator/src/api/components/property.js
similarity index 100%
rename from src/UI/module-code-generator/src/api/components/property.js
rename to src/UI/module-codegenerator/src/api/components/property.js
diff --git a/src/UI/module-code-generator/src/api/index.js b/src/UI/module-codegenerator/src/api/index.js
similarity index 100%
rename from src/UI/module-code-generator/src/api/index.js
rename to src/UI/module-codegenerator/src/api/index.js
diff --git a/src/UI/module-codegenerator/src/components/config-codegenerator/index.vue b/src/UI/module-codegenerator/src/components/config-codegenerator/index.vue
new file mode 100644
index 0000000..5b6aeef
--- /dev/null
+++ b/src/UI/module-codegenerator/src/components/config-codegenerator/index.vue
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/UI/module-codegenerator/src/components/index.js b/src/UI/module-codegenerator/src/components/index.js
new file mode 100644
index 0000000..7aadcfe
--- /dev/null
+++ b/src/UI/module-codegenerator/src/components/index.js
@@ -0,0 +1,10 @@
+import library from 'netmodular-ui/packages/library'
+let components = []
+const requireComponent = require.context('./', true, /index\.vue$/)
+requireComponent.keys().map(fileName => {
+ components.push({
+ name: `${library.prefix.toLowerCase()}-${fileName.split('/')[1]}`,
+ component: requireComponent(fileName).default
+ })
+})
+export default components
diff --git a/src/UI/module-code-generator/src/config/index.js b/src/UI/module-codegenerator/src/config/index.js
similarity index 100%
rename from src/UI/module-code-generator/src/config/index.js
rename to src/UI/module-codegenerator/src/config/index.js
diff --git a/src/UI/module-code-generator/src/index.js b/src/UI/module-codegenerator/src/index.js
similarity index 100%
rename from src/UI/module-code-generator/src/index.js
rename to src/UI/module-codegenerator/src/index.js
index 9dcf4b3..a239d27 100644
--- a/src/UI/module-code-generator/src/index.js
+++ b/src/UI/module-codegenerator/src/index.js
@@ -1,5 +1,5 @@
-import store from './store'
import './api'
+import store from './store'
import routes from './routes'
import components from './components'
import module from './module'
diff --git a/src/UI/module-code-generator/src/main.js b/src/UI/module-codegenerator/src/main.js
similarity index 100%
rename from src/UI/module-code-generator/src/main.js
rename to src/UI/module-codegenerator/src/main.js
diff --git a/src/UI/module-code-generator/src/module.js b/src/UI/module-codegenerator/src/module.js
similarity index 100%
rename from src/UI/module-code-generator/src/module.js
rename to src/UI/module-codegenerator/src/module.js
diff --git a/src/UI/module-code-generator/src/routes/index.js b/src/UI/module-codegenerator/src/routes/index.js
similarity index 56%
rename from src/UI/module-code-generator/src/routes/index.js
rename to src/UI/module-codegenerator/src/routes/index.js
index c6e8a89..7fc7e1f 100644
--- a/src/UI/module-code-generator/src/routes/index.js
+++ b/src/UI/module-codegenerator/src/routes/index.js
@@ -1,5 +1,3 @@
import loadRoutes from 'netmodular-ui/packages/utils/load-routes'
const requireComponent = require.context('../views', true, /\page.js$/)
-export default loadRoutes(
- requireComponent.keys().map(fileName => requireComponent(fileName).route)
-)
+export default loadRoutes(requireComponent.keys().map(fileName => requireComponent(fileName).route))
diff --git a/src/UI/module-code-generator/src/store/index.js b/src/UI/module-codegenerator/src/store/index.js
similarity index 100%
rename from src/UI/module-code-generator/src/store/index.js
rename to src/UI/module-codegenerator/src/store/index.js
diff --git a/src/UI/module-code-generator/src/views/class/components/code-preview/index.vue b/src/UI/module-codegenerator/src/views/class/components/code-preview/index.vue
similarity index 100%
rename from src/UI/module-code-generator/src/views/class/components/code-preview/index.vue
rename to src/UI/module-codegenerator/src/views/class/components/code-preview/index.vue
diff --git a/src/UI/module-code-generator/src/views/class/components/add/index.vue b/src/UI/module-codegenerator/src/views/class/components/save/index.vue
similarity index 53%
rename from src/UI/module-code-generator/src/views/class/components/add/index.vue
rename to src/UI/module-codegenerator/src/views/class/components/save/index.vue
index d5e414e..bddbb56 100644
--- a/src/UI/module-code-generator/src/views/class/components/add/index.vue
+++ b/src/UI/module-codegenerator/src/views/class/components/save/index.vue
@@ -3,19 +3,22 @@
-
+
+
+
+
-
+
-
-
-
-
+
-
+
+
+
+
Add
@@ -30,23 +33,27 @@
diff --git a/src/UI/module-code-generator/src/views/enum/components/select/index.js b/src/UI/module-codegenerator/src/views/enum/components/select/index.js
similarity index 100%
rename from src/UI/module-code-generator/src/views/enum/components/select/index.js
rename to src/UI/module-codegenerator/src/views/enum/components/select/index.js
diff --git a/src/UI/module-code-generator/src/views/enum/index/cols.js b/src/UI/module-codegenerator/src/views/enum/index/cols.js
similarity index 100%
rename from src/UI/module-code-generator/src/views/enum/index/cols.js
rename to src/UI/module-codegenerator/src/views/enum/index/cols.js
diff --git a/src/UI/module-code-generator/src/views/enum/index/index.vue b/src/UI/module-codegenerator/src/views/enum/index/index.vue
similarity index 51%
rename from src/UI/module-code-generator/src/views/enum/index/index.vue
rename to src/UI/module-codegenerator/src/views/enum/index/index.vue
index acda316..8a017ee 100644
--- a/src/UI/module-code-generator/src/views/enum/index/index.vue
+++ b/src/UI/module-codegenerator/src/views/enum/index/index.vue
@@ -13,47 +13,40 @@
-
-
-
-
-
-
+
- {{row.isShow?'是':'否'}}
+ {{ row.isShow ? '是' : '否' }}
-
-
-
+
+
+
+
-
-
-
-
+
diff --git a/src/UI/module-code-generator/src/views/project/components/select/index.vue b/src/UI/module-codegenerator/src/views/module/components/select/index.vue
similarity index 74%
rename from src/UI/module-code-generator/src/views/project/components/select/index.vue
rename to src/UI/module-codegenerator/src/views/module/components/select/index.vue
index a5a8a1d..11fa1da 100644
--- a/src/UI/module-code-generator/src/views/project/components/select/index.vue
+++ b/src/UI/module-codegenerator/src/views/module/components/select/index.vue
@@ -4,7 +4,7 @@ export default {
mixins: [mixins.select],
data() {
return {
- action: $api.codeGenerator.project.select
+ action: $api.codeGenerator.module.select
}
}
}
diff --git a/src/UI/module-code-generator/src/views/project/index/cols.js b/src/UI/module-codegenerator/src/views/module/index/cols.js
similarity index 67%
rename from src/UI/module-code-generator/src/views/project/index/cols.js
rename to src/UI/module-codegenerator/src/views/module/index/cols.js
index 9c775a2..7c8eee9 100644
--- a/src/UI/module-code-generator/src/views/project/index/cols.js
+++ b/src/UI/module-codegenerator/src/views/module/index/cols.js
@@ -17,10 +17,26 @@ export default [
name: 'code',
label: '编码'
},
+ {
+ name: 'icon',
+ label: '图标'
+ },
{
name: 'copyright',
label: '版权声明'
},
+ {
+ name: 'company',
+ label: '公司名称'
+ },
+ {
+ name: 'projectUrl',
+ label: '官方地址'
+ },
+ {
+ name: 'repositoryUrl',
+ label: '仓库地址'
+ },
{
name: 'creator',
label: '创建人',
diff --git a/src/UI/module-codegenerator/src/views/module/index/index.vue b/src/UI/module-codegenerator/src/views/module/index/index.vue
new file mode 100644
index 0000000..6326b41
--- /dev/null
+++ b/src/UI/module-codegenerator/src/views/module/index/index.vue
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ row.isShow ? '是' : '否' }}
+
+
+
+
+
+
+ {{ row.projectUrl }}
+
+
+
+ {{ row.repositoryUrl }}
+
+
+
+
+
+ 操作
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/UI/module-code-generator/src/views/project/index/page.js b/src/UI/module-codegenerator/src/views/module/index/page.js
similarity index 66%
rename from src/UI/module-code-generator/src/views/project/index/page.js
rename to src/UI/module-codegenerator/src/views/module/index/page.js
index a435194..e78e364 100644
--- a/src/UI/module-code-generator/src/views/project/index/page.js
+++ b/src/UI/module-codegenerator/src/views/module/index/page.js
@@ -1,9 +1,9 @@
/** 页面信息 */
-const page = new function() {
- this.title = '项目列表'
- this.icon = 'project'
- this.name = 'codegenerator_project'
- this.path = '/codegenerator/project'
+const page = new (function() {
+ this.title = '模块列表'
+ this.icon = 'product'
+ this.name = 'codegenerator_module'
+ this.path = '/codegenerator/module'
// 关联权限
this.permissions = [`${this.name}_query_get`]
@@ -32,20 +32,26 @@ const page = new function() {
permissions: [`${this.name}_delete_delete`]
},
buildCode: {
- text: '生成',
+ text: '生成代码',
type: 'text',
icon: 'download',
code: `${this.name}_build_code`,
permissions: [`${this.name}_buildcode_post`]
+ },
+ classManage: {
+ text: '实体管理',
+ type: 'text',
+ icon: 'database',
+ code: `${this.name}_class_manage`,
+ permissions: []
}
}
-}()
+})()
/** 路由信息 */
export const route = {
page,
- component: () =>
- import(/* webpackChunkName: "codegenerator.project" */ './index')
+ component: () => import(/* webpackChunkName: "codegenerator.module" */ './index')
}
export default page
diff --git a/src/UI/module-code-generator/src/views/property/components/add/index.vue b/src/UI/module-codegenerator/src/views/property/components/save/index.vue
similarity index 84%
rename from src/UI/module-code-generator/src/views/property/components/add/index.vue
rename to src/UI/module-codegenerator/src/views/property/components/save/index.vue
index 57f5f43..3a55a06 100644
--- a/src/UI/module-code-generator/src/views/property/components/add/index.vue
+++ b/src/UI/module-codegenerator/src/views/property/components/save/index.vue
@@ -2,16 +2,19 @@
-
-
+
+
-
+
-
+
+
+ 长度
@@ -59,11 +62,11 @@ import { mixins } from 'netmodular-ui'
import TypeSelect from '../type-select'
import EnumSelect from '../../../enum/components/select'
-const api = $api.codeGenerator.property
+const { add, edit, update } = $api.codeGenerator.property
const enumApi = $api.codeGenerator.enum
export default {
- mixins: [mixins.dialog],
+ mixins: [mixins.formSave],
components: { TypeSelect, EnumSelect },
data() {
// 验证字符串长度
@@ -82,6 +85,7 @@ export default {
callback()
}
}
+
// 验证精度
const validatePrecision = (rule, value, callback) => {
if (this.showPrecision) {
@@ -98,6 +102,7 @@ export default {
callback()
}
}
+
// 验证刻度
const validateScale = (rule, value, callback) => {
if (this.showScale) {
@@ -116,6 +121,7 @@ export default {
callback()
}
}
+
// 验证枚举
const validateEnum = (rule, value, callback) => {
if (this.showEnum && value === '') {
@@ -124,17 +130,21 @@ export default {
callback()
}
}
+
return {
+ title: '属性',
+ actions: {
+ add,
+ edit,
+ update
+ },
form: {
- title: '添加属性',
- icon: 'add',
width: '40%',
- action: api.add,
model: {
classId: 0,
name: '',
type: 0,
- length: 0,
+ length: 50,
precision: 0,
scale: 0,
enumId: '',
@@ -145,12 +155,8 @@ export default {
hasDefaultValue: false
},
rules: {
- classId: [
- { required: true, message: '请选择类', trigger: 'blur' }
- ],
- name: [
- { required: true, message: '请输入类名', trigger: 'blur' }
- ],
+ classId: [{ required: true, message: '请选择类', trigger: 'blur' }],
+ name: [{ required: true, message: '请输入类名', trigger: 'blur' }],
type: [
{ required: true, message: '请选择类型', trigger: 'blur' },
{ type: 'number', message: '请选择正确的类型', trigger: 'blur' }
@@ -164,12 +170,12 @@ export default {
},
on: {
success: this.onSuccess,
- open: this.onOpen
+ open: this.onOpen,
+ reset: this.onReset
}
}
},
props: {
- total: Number,
parent: {
type: Object,
required: true
@@ -193,15 +199,10 @@ export default {
getEnumSelect() {
return enumApi.select()
},
- onSuccess() {
- this.$emit('success')
- },
- onOpen() {
- this.$nextTick(() => {
- this.$refs.form.reset()
- this.form.model.classId = this.parent.id
- this.form.model.sort = this.total
- })
+ onReset() {
+ this.form.model.classId = this.parent.id
+ this.form.model.sort = this.total
+ this.$refs.name.focus()
}
},
watch: {
diff --git a/src/UI/module-code-generator/src/views/property/components/type-select/index.js b/src/UI/module-codegenerator/src/views/property/components/type-select/index.js
similarity index 62%
rename from src/UI/module-code-generator/src/views/property/components/type-select/index.js
rename to src/UI/module-codegenerator/src/views/property/components/type-select/index.js
index 308b8a6..96db02c 100644
--- a/src/UI/module-code-generator/src/views/property/components/type-select/index.js
+++ b/src/UI/module-codegenerator/src/views/property/components/type-select/index.js
@@ -1,26 +1,14 @@
import { mixins } from 'netmodular-ui'
-const typeArr = [
- 'String',
- 'Byte',
- 'Short',
- 'Int',
- 'Long',
- 'Double',
- 'Decimal',
- 'Bool',
- 'Guid',
- 'DateTime',
- 'Enum'
-]
+const typeArr = ['String', 'Byte', 'Short', 'Int', 'Long', 'Double', 'Decimal', 'Bool', 'Guid', 'DateTime', 'Enum']
let i = 0
const options = typeArr.map(item => {
return { label: item, value: i++ }
})
export default {
mixins: [mixins.select],
- data () {
+ data() {
return {
- action () {
+ action() {
return new Promise(resolve => {
resolve(options)
})
diff --git a/src/UI/module-code-generator/src/views/property/index/cols.js b/src/UI/module-codegenerator/src/views/property/index/cols.js
similarity index 100%
rename from src/UI/module-code-generator/src/views/property/index/cols.js
rename to src/UI/module-codegenerator/src/views/property/index/cols.js
diff --git a/src/UI/module-code-generator/src/views/property/index/index.vue b/src/UI/module-codegenerator/src/views/property/index/index.vue
similarity index 77%
rename from src/UI/module-code-generator/src/views/property/index/index.vue
rename to src/UI/module-codegenerator/src/views/property/index/index.vue
index 9327493..bd2874c 100644
--- a/src/UI/module-code-generator/src/views/property/index/index.vue
+++ b/src/UI/module-codegenerator/src/views/property/index/index.vue
@@ -1,56 +1,55 @@
-
-
+
+
-
+
-
+
- {{row.name}}
+ {{ row.name }}
-
+
-
+
-
+
-
-
+
+
*/
+process.env.VUE_APP_CUSTOM_SCRIPTS = ''
+
+const path = require('path')
+// 开发环境
+const isDev = process.env.NODE_ENV === 'development'
// 打包输出路径
const outputDir = '../../WebHost/wwwroot/app'
@@ -15,20 +19,43 @@ module.exports = {
devServer: {
port: 5222
},
- transpileDependencies: ['nm-.*', 'element-ui'],
- configureWebpack: {
- plugins: [
- /**
- * 复制netmodular-ui/public目录下的文件到输出目录
- */
- new CopyWebpackPlugin([
- {
- from: path.join(__dirname, 'node_modules/netmodular-ui/public'),
- to: path.join(__dirname, outputDir),
- ignore: ['index.html']
- }
- ])
- ]
+ transpileDependencies: ['netmodular-*', 'element-ui'],
+ configureWebpack() {
+ let config = {
+ plugins: [
+ /**
+ * 复制netmodular-ui/public目录下的文件到输出目录
+ */
+ new CopyWebpackPlugin([
+ {
+ from: path.join(__dirname, 'node_modules/netmodular-ui/public'),
+ to: path.join(__dirname, outputDir),
+ ignore: ['index.html']
+ }
+ ])
+ ]
+ }
+
+ if (!isDev) {
+ //自定义代码压缩
+ config.optimization = {
+ minimize: true,
+ minimizer: [
+ new TerserPlugin({
+ cache: true,
+ parallel: true,
+ sourceMap: false,
+ terserOptions: {
+ compress: {
+ drop_console: true,
+ drop_debugger: true
+ }
+ }
+ })
+ ]
+ }
+ }
+ return config
},
chainWebpack: config => {
/**
@@ -56,21 +83,6 @@ module.exports = {
)
// 非开发环境
.when(!isDev, config => {
- config.optimization.minimizer([
- new UglifyJsPlugin({
- uglifyOptions: {
- // 移除 console
- // 其它优化选项 https://segmentfault.com/a/1190000010874406
- warnings: false,
- compress: {
- drop_console: true,
- drop_debugger: true,
- pure_funcs: ['console.log']
- }
- }
- })
- ])
-
// 拆分
config.optimization.splitChunks({
chunks: 'all',
@@ -81,7 +93,7 @@ module.exports = {
test: /[\\/]node_modules[\\/]element-ui(.*)/
},
skins: {
- name: 'chunk-skins',
+ name: 'chunk-netmodular-ui',
priority: 10,
test: /[\\/]node_modules[\\/]netmodular-ui(.*)/
}
diff --git a/src/Web/Controllers/ClassController.cs b/src/Web/Controllers/ClassController.cs
index 92ef2c3..7b5ea4f 100644
--- a/src/Web/Controllers/ClassController.cs
+++ b/src/Web/Controllers/ClassController.cs
@@ -5,32 +5,28 @@
using System.Web;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
-using Microsoft.Extensions.Options;
using NetModular.Lib.Auth.Web.Attributes;
+using NetModular.Lib.Config.Abstractions;
+using NetModular.Lib.Config.Abstractions.Impl;
using NetModular.Lib.Utils.Core.Extensions;
-using NetModular.Lib.Utils.Core.Options;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.ClassService;
using NetModular.Module.CodeGenerator.Application.ClassService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.Class;
using NetModular.Module.CodeGenerator.Domain.Class.Models;
-using NetModular.Module.CodeGenerator.Infrastructure.Options;
+using NetModular.Module.CodeGenerator.Infrastructure;
namespace NetModular.Module.CodeGenerator.Web.Controllers
{
[Description("实体管理")]
[Common]
- public class ClassController : ModuleController
+ public class ClassController : Web.ModuleController
{
private readonly IClassService _service;
- private readonly ModuleCommonOptions _commonOptions;
- private readonly CodeGeneratorOptions _codeGeneratorOptions;
-
- public ClassController(IClassService service, IOptionsMonitor commonOption, IOptionsMonitor codeGeneratorOptions)
+ private readonly IConfigProvider _configProvider;
+ public ClassController(IClassService service, IConfigProvider configProvider)
{
_service = service;
- _codeGeneratorOptions = codeGeneratorOptions.CurrentValue;
- _commonOptions = commonOption.CurrentValue;
+ _configProvider = configProvider;
}
[HttpGet]
@@ -49,16 +45,16 @@ public Task Add(ClassAddModel model)
[HttpDelete]
[Description("删除")]
- public async Task Delete([BindRequired]Guid id)
+ public Task Delete([BindRequired]Guid id)
{
- return await _service.Delete(id);
+ return _service.Delete(id);
}
[HttpGet]
[Description("编辑")]
- public async Task Edit([BindRequired]Guid id)
+ public Task Edit([BindRequired]Guid id)
{
- return await _service.Edit(id);
+ return _service.Edit(id);
}
[HttpPost]
@@ -81,8 +77,7 @@ public IResultModel BaseEntityTypeSelect()
public async Task BuildCode([BindRequired]Guid id)
{
var result = await _service.BuildCode(id);
- var path = Path.Combine(_commonOptions.TempPath, _codeGeneratorOptions.BuildCodePath, result.Data.Id + ".zip");
- return PhysicalFile(path, "application/octet-stream", HttpUtility.UrlEncode(result.Data.Name), true);
+ return PhysicalFile(result.Data.ZipPath, "application/octet-stream", HttpUtility.UrlEncode(result.Data.Name), true);
}
}
}
diff --git a/src/Web/Controllers/EnumController.cs b/src/Web/Controllers/EnumController.cs
index 9f157e1..470be43 100644
--- a/src/Web/Controllers/EnumController.cs
+++ b/src/Web/Controllers/EnumController.cs
@@ -4,7 +4,6 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using NetModular.Lib.Auth.Web.Attributes;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.EnumService;
using NetModular.Module.CodeGenerator.Application.EnumService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.Enum.Models;
@@ -12,7 +11,7 @@
namespace NetModular.Module.CodeGenerator.Web.Controllers
{
[Description("枚举管理")]
- public class EnumController : ModuleController
+ public class EnumController : Web.ModuleController
{
private readonly IEnumService _service;
@@ -37,16 +36,16 @@ public Task Add(EnumAddModel model)
[HttpDelete]
[Description("删除")]
- public async Task Delete([BindRequired] Guid id)
+ public Task Delete([BindRequired] Guid id)
{
- return await _service.Delete(id);
+ return _service.Delete(id);
}
[HttpGet]
[Description("编辑")]
- public async Task Edit([BindRequired] Guid id)
+ public Task Edit([BindRequired] Guid id)
{
- return await _service.Edit(id);
+ return _service.Edit(id);
}
[HttpPost]
diff --git a/src/Web/Controllers/EnumItemController.cs b/src/Web/Controllers/EnumItemController.cs
index 2fcd4a0..f82f6da 100644
--- a/src/Web/Controllers/EnumItemController.cs
+++ b/src/Web/Controllers/EnumItemController.cs
@@ -5,7 +5,6 @@
using Microsoft.AspNetCore.Mvc.ModelBinding;
using NetModular.Lib.Auth.Web.Attributes;
using NetModular.Lib.Utils.Core.Models;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.EnumItemService;
using NetModular.Module.CodeGenerator.Application.EnumItemService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.EnumItem.Models;
@@ -14,7 +13,7 @@ namespace NetModular.Module.CodeGenerator.Web.Controllers
{
[Description("枚举项管理")]
[Common]
- public class EnumItemController : ModuleController
+ public class EnumItemController : Web.ModuleController
{
private readonly IEnumItemService _service;
@@ -39,16 +38,16 @@ public Task Add(EnumItemAddModel model)
[HttpDelete]
[Description("删除")]
- public async Task Delete([BindRequired]Guid id)
+ public Task Delete([BindRequired]Guid id)
{
- return await _service.Delete(id);
+ return _service.Delete(id);
}
[HttpGet]
[Description("编辑")]
- public async Task Edit([BindRequired]Guid id)
+ public Task Edit([BindRequired]Guid id)
{
- return await _service.Edit(id);
+ return _service.Edit(id);
}
[HttpPost]
diff --git a/src/Web/Controllers/ModelPropertyController.cs b/src/Web/Controllers/ModelPropertyController.cs
index 5e7a7c1..dbe7211 100644
--- a/src/Web/Controllers/ModelPropertyController.cs
+++ b/src/Web/Controllers/ModelPropertyController.cs
@@ -5,7 +5,6 @@
using Microsoft.AspNetCore.Mvc.ModelBinding;
using NetModular.Lib.Auth.Web.Attributes;
using NetModular.Lib.Utils.Core.Models;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.ModelPropertyService;
using NetModular.Module.CodeGenerator.Application.ModelPropertyService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.ModelProperty.Models;
@@ -14,7 +13,7 @@ namespace NetModular.Module.CodeGenerator.Web.Controllers
{
[Description("模型属性管理")]
[Common]
- public class ModelPropertyController : ModuleController
+ public class ModelPropertyController : Web.ModuleController
{
private readonly IModelPropertyService _service;
@@ -39,16 +38,16 @@ public Task Add(ModelPropertyAddModel model)
[HttpDelete]
[Description("删除")]
- public async Task Delete([BindRequired]Guid id)
+ public Task Delete([BindRequired]Guid id)
{
- return await _service.Delete(id);
+ return _service.Delete(id);
}
[HttpGet]
[Description("编辑")]
- public async Task Edit([BindRequired]Guid id)
+ public Task Edit([BindRequired]Guid id)
{
- return await _service.Edit(id);
+ return _service.Edit(id);
}
[HttpPost]
diff --git a/src/Web/Controllers/ModuleController.cs b/src/Web/Controllers/ModuleController.cs
new file mode 100644
index 0000000..354c765
--- /dev/null
+++ b/src/Web/Controllers/ModuleController.cs
@@ -0,0 +1,71 @@
+using System;
+using System.ComponentModel;
+using System.IO;
+using System.Threading.Tasks;
+using System.Web;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.ModelBinding;
+using NetModular.Lib.Config.Abstractions;
+using NetModular.Lib.Config.Abstractions.Impl;
+using NetModular.Module.CodeGenerator.Application.ModuleService;
+using NetModular.Module.CodeGenerator.Application.ModuleService.ViewModels;
+using NetModular.Module.CodeGenerator.Domain.Module.Models;
+using NetModular.Module.CodeGenerator.Infrastructure;
+
+namespace NetModular.Module.CodeGenerator.Web.Controllers
+{
+ [Description("模块管理")]
+ public class ModuleController : Web.ModuleController
+ {
+ private readonly IModuleService _service;
+ private readonly IConfigProvider _configProvider;
+ public ModuleController( IModuleService service, IConfigProvider configProvider)
+ {
+ _service = service;
+ _configProvider = configProvider;
+ }
+
+ [HttpGet]
+ [Description("查询")]
+ public Task Query([FromQuery]ModuleQueryModel model)
+ {
+ return _service.Query(model);
+ }
+
+ [HttpPost]
+ [Description("添加")]
+ public Task Add(ModuleAddModel model)
+ {
+ return _service.Add(model);
+ }
+
+ [HttpDelete]
+ [Description("删除")]
+ public Task Delete([BindRequired]Guid id)
+ {
+ return _service.Delete(id);
+ }
+
+ [HttpGet]
+ [Description("编辑")]
+ public Task Edit([BindRequired]Guid id)
+ {
+ return _service.Edit(id);
+ }
+
+ [HttpPost]
+ [Description("修改")]
+ public Task Update(ModuleUpdateModel model)
+ {
+ return _service.Update(model);
+ }
+
+ [HttpPost]
+ [Description("生成代码")]
+ public async Task BuildCode(ModuleBuildCodeModel model)
+ {
+ var result = await _service.BuildCode(model);
+ return PhysicalFile(result.Data.ZipPath, "application/octet-stream", result.Data.Name, true);
+ }
+ }
+}
diff --git a/src/Web/Controllers/OnlineModuleController.cs b/src/Web/Controllers/OnlineModuleController.cs
new file mode 100644
index 0000000..ced05a1
--- /dev/null
+++ b/src/Web/Controllers/OnlineModuleController.cs
@@ -0,0 +1,57 @@
+using System;
+using System.ComponentModel;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.ModelBinding;
+using NetModular.Module.CodeGenerator.Application.OnlineModuleService;
+using NetModular.Module.CodeGenerator.Application.OnlineModuleService.ViewModels;
+using NetModular.Module.CodeGenerator.Domain.OnlineModule.Models;
+
+namespace NetModular.Module.CodeGenerator.Web.Controllers
+{
+ [Description("在线模块管理")]
+ public class OnlineModuleController : Web.ModuleController
+ {
+ private readonly IOnlineModuleService _service;
+
+ public OnlineModuleController(IOnlineModuleService service)
+ {
+ _service = service;
+ }
+
+ [HttpGet]
+ [Description("查询")]
+ public Task Query([FromQuery]OnlineModuleQueryModel model)
+ {
+ return _service.Query(model);
+ }
+
+ [HttpPost]
+ [Description("添加")]
+ public Task Add(OnlineModuleAddModel model)
+ {
+ return _service.Add(model);
+ }
+
+ [HttpDelete]
+ [Description("删除")]
+ public Task Delete([BindRequired]Guid id)
+ {
+ return _service.Delete(id);
+ }
+
+ [HttpGet]
+ [Description("编辑")]
+ public Task Edit([BindRequired]Guid id)
+ {
+ return _service.Edit(id);
+ }
+
+ [HttpPost]
+ [Description("修改")]
+ public Task Update(OnlineModuleUpdateModel model)
+ {
+ return _service.Update(model);
+ }
+ }
+}
diff --git a/src/Web/Controllers/ProjectController.cs b/src/Web/Controllers/ProjectController.cs
deleted file mode 100644
index 099b911..0000000
--- a/src/Web/Controllers/ProjectController.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.IO;
-using System.Threading.Tasks;
-using System.Web;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.AspNetCore.Mvc.ModelBinding;
-using Microsoft.Extensions.Options;
-using NetModular.Lib.Utils.Core.Options;
-using NetModular.Lib.Utils.Core.Result;
-using NetModular.Module.CodeGenerator.Application.ProjectService;
-using NetModular.Module.CodeGenerator.Application.ProjectService.ViewModels;
-using NetModular.Module.CodeGenerator.Domain.Project.Models;
-using NetModular.Module.CodeGenerator.Infrastructure.Options;
-
-namespace NetModular.Module.CodeGenerator.Web.Controllers
-{
- [Description("项目管理")]
- public class ProjectController : ModuleController
- {
- private readonly IProjectService _service;
- private readonly ModuleCommonOptions _commonOptions;
- private readonly CodeGeneratorOptions _codeGeneratorOptions;
- public ProjectController(IProjectService service, IOptionsMonitor commonOptions, IOptionsMonitor codeGeneratorOptions)
- {
- _service = service;
- _commonOptions = commonOptions.CurrentValue;
- _codeGeneratorOptions = codeGeneratorOptions.CurrentValue;
- }
-
- [HttpGet]
- [Description("查询")]
- public async Task Query([FromQuery]ProjectQueryModel model)
- {
- return await _service.Query(model);
- }
-
- [HttpPost]
- [Description("添加")]
- public Task Add(ProjectAddModel model)
- {
- return _service.Add(model);
- }
-
- [HttpDelete]
- [Description("删除")]
- public Task Delete([BindRequired]Guid id)
- {
- return _service.Delete(id);
- }
-
- [HttpGet]
- [Description("编辑")]
- public Task Edit([BindRequired]Guid id)
- {
- return _service.Edit(id);
- }
-
- [HttpPost]
- [Description("修改")]
- public Task Update(ProjectUpdateModel model)
- {
- return _service.Update(model);
- }
-
- [HttpPost]
- [Description("生成代码")]
- public async Task BuildCode(ProjectBuildCodeModel model)
- {
- var result = await _service.BuildCode(model);
- var path = Path.Combine(_commonOptions.TempPath, _codeGeneratorOptions.BuildCodePath, result.Data.Id + ".zip");
- return PhysicalFile(path, "application/octet-stream", HttpUtility.UrlEncode(result.Data.Name), true);
- }
- }
-}
diff --git a/src/Web/Controllers/PropertyController.cs b/src/Web/Controllers/PropertyController.cs
index 67f934b..bda5a10 100644
--- a/src/Web/Controllers/PropertyController.cs
+++ b/src/Web/Controllers/PropertyController.cs
@@ -6,7 +6,6 @@
using NetModular.Lib.Auth.Web.Attributes;
using NetModular.Lib.Utils.Core.Extensions;
using NetModular.Lib.Utils.Core.Models;
-using NetModular.Lib.Utils.Core.Result;
using NetModular.Module.CodeGenerator.Application.PropertyService;
using NetModular.Module.CodeGenerator.Application.PropertyService.ViewModels;
using NetModular.Module.CodeGenerator.Domain.Property;
@@ -16,7 +15,7 @@ namespace NetModular.Module.CodeGenerator.Web.Controllers
{
[Description("实体属性管理")]
[Common]
- public class PropertyController : ModuleController
+ public class PropertyController : Web.ModuleController
{
private readonly IPropertyService _service;
@@ -41,16 +40,16 @@ public Task Add(PropertyAddModel model)
[HttpDelete]
[Description("删除")]
- public async Task Delete([BindRequired]Guid id)
+ public Task Delete([BindRequired]Guid id)
{
- return await _service.Delete(id);
+ return _service.Delete(id);
}
[HttpGet]
[Description("编辑")]
- public async Task Edit([BindRequired]Guid id)
+ public Task Edit([BindRequired]Guid id)
{
- return await _service.Edit(id);
+ return _service.Edit(id);
}
[HttpPost]
diff --git a/src/Web/ModuleInitializer.cs b/src/Web/ModuleInitializer.cs
index ed4adba..9f9b98b 100644
--- a/src/Web/ModuleInitializer.cs
+++ b/src/Web/ModuleInitializer.cs
@@ -1,7 +1,9 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+using NetModular.Lib.Module.Abstractions;
using NetModular.Lib.Module.AspNetCore;
namespace NetModular.Module.CodeGenerator.Web
@@ -11,8 +13,7 @@ public class ModuleInitializer : IModuleInitializer
///
/// 注入服务
///
- ///
- public void ConfigureServices(IServiceCollection services)
+ public void ConfigureServices(IServiceCollection services, IModuleCollection modules, IHostEnvironment env, IConfiguration cfg)
{
}
@@ -31,7 +32,7 @@ public void Configure(IApplicationBuilder app, IHostEnvironment env)
///
public void ConfigureMvc(MvcOptions mvcOptions)
{
-
+
}
}
}
diff --git a/src/Web/Web.csproj b/src/Web/Web.csproj
index d3acc59..0a983d1 100644
--- a/src/Web/Web.csproj
+++ b/src/Web/Web.csproj
@@ -1,19 +1,23 @@
-
- netcoreapp3.0
- false
-
-
-
-
-
-
+
+
+
+
+
+
+
+ true
+ true
+ Always
+
+
+
diff --git a/src/WebHost/Program.cs b/src/WebHost/Program.cs
index 2213d5c..287e32b 100644
--- a/src/WebHost/Program.cs
+++ b/src/WebHost/Program.cs
@@ -1,12 +1,12 @@
-using NetModular.Lib.Host.Web;
+using System.Threading.Tasks;
+using NetModular.Lib.Host.Web;
-namespace NetModular.Module.CodeGenerator.WebHost
+namespace NetModular.Module.CodeGenerator.WebHost;
+
+public class Program
{
- public class Program
+ public static async Task Main(string[] args)
{
- public static void Main(string[] args)
- {
- new HostBuilder().Run(args);
- }
+ await new HostBuilder().RunAsync(args);
}
-}
+}
\ No newline at end of file
diff --git a/src/WebHost/Properties/launchSettings.json b/src/WebHost/Properties/launchSettings.json
index a8a37d7..3c02b3e 100644
--- a/src/WebHost/Properties/launchSettings.json
+++ b/src/WebHost/Properties/launchSettings.json
@@ -1,27 +1,14 @@
{
- "iisSettings": {
- "windowsAuthentication": false,
- "anonymousAuthentication": true,
- "iisExpress": {
- "applicationUrl": "http://localhost:2942/",
- "sslPort": 0
- }
- },
+ "$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
- "IIS Express": {
- "commandName": "IISExpress",
- "launchBrowser": true,
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
- },
"WebHost": {
"commandName": "Project",
"launchBrowser": true,
+ "launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
- "applicationUrl": "http://localhost:2943/"
+ "applicationUrl": "http://localhost:6222"
}
}
}
\ No newline at end of file
diff --git a/src/WebHost/Startup.cs b/src/WebHost/Startup.cs
deleted file mode 100644
index 19c2923..0000000
--- a/src/WebHost/Startup.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using Microsoft.Extensions.Hosting;
-using NetModular.Lib.Host.Web;
-
-namespace NetModular.Module.CodeGenerator.WebHost
-{
- public class Startup : StartupAbstract
- {
- public Startup(IHostEnvironment env) : base(env)
- {
- }
- }
-}
diff --git a/src/WebHost/WebHost.csproj b/src/WebHost/WebHost.csproj
index f66fbe1..111b96c 100644
--- a/src/WebHost/WebHost.csproj
+++ b/src/WebHost/WebHost.csproj
@@ -1,27 +1,29 @@
-
- netcoreapp3.0
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
-
+
+
+
PreserveNewest
-
+
diff --git a/src/WebHost/_modules/02_CodeGenerator/_module.json b/src/WebHost/_modules/02_CodeGenerator/_module.json
new file mode 100644
index 0000000..f1f0b12
--- /dev/null
+++ b/src/WebHost/_modules/02_CodeGenerator/_module.json
@@ -0,0 +1 @@
+{"Id": "02","Name":"代码生成","Code":"CodeGenerator","Icon":"develop","Version":"9.0.2","Description":"NetModular Module CodeGenerator(代码生成) - WebHost"}
diff --git a/src/WebHost/appsettings.Development.json b/src/WebHost/appsettings.Development.json
index 84ae5f9..0d6f4c7 100644
--- a/src/WebHost/appsettings.Development.json
+++ b/src/WebHost/appsettings.Development.json
@@ -1,10 +1,40 @@
-{
- "server.urls": "http://10.32.1.183:5000",
- "Logging": {
- "LogLevel": {
+{
+ "Serilog": {
+ "MinimumLevel": {
"Default": "Debug",
- "System": "Information",
- "Microsoft": "Information"
- }
+ "Override": {
+ "Microsoft": "Debug",
+ "System": "Debug"
+ }
+ },
+ "WriteTo": [
+ //输入到控制台
+ {
+ "Name": "Console",
+ "Args": {
+ "theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console",
+ "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} {NewLine}{Exception}"
+ }
+ },
+ //输出到文件
+ {
+ "Name": "File",
+ "Args": {
+ //文件路径
+ "path": "log/log.log",
+ //文件滚动方式
+ "rollingInterval": "Day",
+ //消息输出格式
+ "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
+ //文件数量
+ "retainedFileCountLimit": 60,
+ //使用缓冲,提高写入效率
+ "buffered": false
+ }
+ }
+ ]
+ },
+ "Db": {
+ "Logging": true
}
}
diff --git a/src/WebHost/appsettings.json b/src/WebHost/appsettings.json
index 9099466..57b8775 100644
--- a/src/WebHost/appsettings.json
+++ b/src/WebHost/appsettings.json
@@ -1,4 +1,78 @@
-{
- "AllowedHosts": "*",
- "server.urls": "http://10.32.1.183:5000"
+{
+ "Host": {
+ //地址
+ "Urls": "http://*:6222",
+ //开启Swagger
+ "Swagger": false,
+ //代理
+ "Proxy": false,
+ //指定跨域访问时预检请求的有效期,单位秒,默认30分钟
+ "PreflightMaxAge": 0
+ },
+ "Serilog": {
+ "MinimumLevel": {
+ "Default": "Error",
+ "Override": {
+ "Microsoft": "Error",
+ "System": "Error"
+ }
+ },
+ "WriteTo": [
+ //输出到文件
+ {
+ "Name": "File",
+ "Args": {
+ //文件路径
+ "path": "log/log.log",
+ //文件滚动方式
+ "rollingInterval": "Day",
+ //消息输出格式
+ "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}",
+ //文件数量
+ "retainedFileCountLimit": 60,
+ //使用缓冲,提高写入效率
+ "buffered": false
+ }
+ }
+ ]
+ },
+ "Db": {
+ //是否开启日志
+ "Logging": false,
+ //数据库类型 0、SqlServer 1、MySql 2、SQLite
+ "Dialect": 2,
+ //数据库版本
+ "Version": "",
+ //数据库地址
+ "Server": "",
+ //端口号
+ "Port": 0,
+ //用户名
+ "UserId": "",
+ //密码
+ "Password": "",
+ //是否创建数据库和表
+ "CreateDatabase": true,
+ //是否初始化数据
+ "InitData": true,
+ "NpgsqlDatabaseName": "",
+ //模块列表
+ "Modules": [
+ {
+ //模块名称
+ "Name": "Admin",
+ //表前缀
+ "Prefix": "",
+ //数据库名称
+ "Database": "Nm_Admin",
+ //自定义版本号
+ "Version": ""
+ },
+ {
+ "Name": "CodeGenerator",
+ "Prefix": "",
+ "Database": "Nm_CodeGenerator"
+ }
+ ]
+ }
}
diff --git a/src/WebHost/config/cache.Development.json b/src/WebHost/config/cache.Development.json
deleted file mode 100644
index 22fdca1..0000000
--- a/src/WebHost/config/cache.Development.json
+++ /dev/null
@@ -1 +0,0 @@
-{}
\ No newline at end of file
diff --git a/src/WebHost/config/cache.json b/src/WebHost/config/cache.json
deleted file mode 100644
index ab37fc7..0000000
--- a/src/WebHost/config/cache.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- // 0、MemoryCache 1、Redis
- "Mode": 0,
- "Redis": {
- "ConnectionString": "127.0.0.1"
- }
-}
\ No newline at end of file
diff --git a/src/WebHost/config/db.Development.json b/src/WebHost/config/db.Development.json
deleted file mode 100644
index 63831f3..0000000
--- a/src/WebHost/config/db.Development.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "Logging": true
-}
\ No newline at end of file
diff --git a/src/WebHost/config/db.json b/src/WebHost/config/db.json
deleted file mode 100644
index 76c2f83..0000000
--- a/src/WebHost/config/db.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- //Ƿ־
- "Logging": false,
- //ݿ 0SqlServer 1MySql 2SQLite
- "Dialect": 2,
- //ݿ汾
- "Version": "",
- //ݿַ
- "Server": "..\\..\\data\\SQLite",
- //˿ں
- "Port": 0,
- //û
- "UserId": "",
- //
- "Password": "",
- //Ƿݿͱ
- "CreateDatabase": false,
- //ģб
- "Modules": [
- {
- //ģ
- "Name": "Admin",
- //ǰ
- "Prefix": "",
- //ݿ
- "Database": "Nm_Admin",
- //ԶϢ
- "ConnectionString": "",
- //Զ汾
- "Version": ""
- },
- {
- "Name": "CodeGenerator",
- "Database": "Nm_CodeGenerator"
- }
- ]
-}
\ No newline at end of file
diff --git a/src/WebHost/config/host.Development.json b/src/WebHost/config/host.Development.json
deleted file mode 100644
index becaf07..0000000
--- a/src/WebHost/config/host.Development.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- //开启Swagger
- "Swagger": true
-}
\ No newline at end of file
diff --git a/src/WebHost/config/host.json b/src/WebHost/config/host.json
deleted file mode 100644
index 7c88ed2..0000000
--- a/src/WebHost/config/host.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- //地址
- "Urls": "http://*:6222",
- //开启Swagger
- "Swagger": false,
- //代理
- "Proxy": false
-}
\ No newline at end of file
diff --git a/src/WebHost/config/jwt.Development.json b/src/WebHost/config/jwt.Development.json
deleted file mode 100644
index 9e26dfe..0000000
--- a/src/WebHost/config/jwt.Development.json
+++ /dev/null
@@ -1 +0,0 @@
-{}
\ No newline at end of file
diff --git a/src/WebHost/config/jwt.json b/src/WebHost/config/jwt.json
deleted file mode 100644
index c75cb8b..0000000
--- a/src/WebHost/config/jwt.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- //秘钥
- "Key": "twAJ$j5##pVc5*y&",
- //发行商
- "Issuer": "http://www.iamoldli.com",
- //订阅者
- "Audience": "http://www.iamoldli.com",
- //有效期(分钟)
- "Expires": 120
-}
\ No newline at end of file
diff --git a/src/WebHost/config/logging.Development.json b/src/WebHost/config/logging.Development.json
deleted file mode 100644
index e68296b..0000000
--- a/src/WebHost/config/logging.Development.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "Serilog": {
- "MinimumLevel": {
- "Default": "Debug",
- "Override": {
- "Microsoft": "Debug",
- "System": "Debug"
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/WebHost/config/module.Development.json b/src/WebHost/config/module.Development.json
deleted file mode 100644
index 0e0dcd2..0000000
--- a/src/WebHost/config/module.Development.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-
-}
\ No newline at end of file
diff --git a/src/WebHost/config/module.json b/src/WebHost/config/module.json
deleted file mode 100644
index 857d615..0000000
--- a/src/WebHost/config/module.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- //文件上传路径
- "UploadPath": "",
- //临时文件路径
- "TempPath": "",
- //权限管理模块配置
- "Admin": {
- //是否开启审计功能
- "Auditing": true,
- //是否开启权限验证
- "PermissionValidate": true
- },
- //代码生成器
- "CodeGenerator": {
- //项目前缀
- "Prefix": "NetModular"
- }
-}
\ No newline at end of file
diff --git a/test/Infrastructure.Test/Infrastructure.Test.csproj b/test/Infrastructure.Test/Infrastructure.Test.csproj
new file mode 100644
index 0000000..ea36ddf
--- /dev/null
+++ b/test/Infrastructure.Test/Infrastructure.Test.csproj
@@ -0,0 +1,26 @@
+
+
+
+ net9.0
+
+ false
+
+
+
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
+
+
+
+
+
+
diff --git a/test/Infrastructure.Test/NugetHelperTest.cs b/test/Infrastructure.Test/NugetHelperTest.cs
new file mode 100644
index 0000000..addb412
--- /dev/null
+++ b/test/Infrastructure.Test/NugetHelperTest.cs
@@ -0,0 +1,31 @@
+using Microsoft.Extensions.DependencyInjection;
+using NetModular;
+using NetModular.Module.CodeGenerator.Infrastructure;
+using NetModular.Module.CodeGenerator.Infrastructure.NuGet;
+using Xunit;
+
+namespace Infrastructure.Test
+{
+ public class NugetHelperTest
+ {
+ private readonly NuGetHelper _nuGetHelper;
+
+ public NugetHelperTest()
+ {
+ var service = new ServiceCollection();
+ service.AddHttpClient();
+ service.AddSingleton();
+ service.AddSingleton();
+ _nuGetHelper = service.BuildServiceProvider().GetService();
+ }
+
+ [Fact]
+ public void GetVersionsTest()
+ {
+ var versions = _nuGetHelper.GetVersions();
+
+ Assert.NotNull(versions.Lib_Auth_Web);
+ Assert.NotNull(versions.Lib_Host_Web);
+ }
+ }
+}