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"); + 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"); + 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 // ------------------------------------------------------------------------------ -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