diff --git a/db/6pigxx_config.sql b/db/6pigxx_config.sql index 6b4cd3be9..1e3258534 100644 --- a/db/6pigxx_config.sql +++ b/db/6pigxx_config.sql @@ -34,7 +34,7 @@ CREATE TABLE `config_info` ( BEGIN; INSERT INTO `config_info` VALUES (1, 'application-dev.yml', 'DEFAULT_GROUP', '# 配置文件加密根密码\njasypt:\n encryptor:\n password: pigx\n algorithm: PBEWithMD5AndDES\n iv-generator-classname: org.jasypt.iv.NoIvGenerator\n\n\nspring:\n mvc:\n pathmatch:\n matching-strategy: ant_path_matcher\n redis:\n host: pigx-redis\n servlet:\n multipart:\n max-file-size: 100MB\n max-request-size: 100MB\n cloud:\n sentinel:\n eager: true\n transport:\n dashboard: pigx-sentinel:5020\n\n# 端点对外暴露\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\' \n endpoint:\n restart:\n enabled: true\n health:\n show-details: ALWAYS\n# feign 相关配置\nfeign:\n sentinel:\n enabled: true\n okhttp:\n enabled: true\n httpclient:\n enabled: false\n client:\n config:\n default:\n connectTimeout: 20000\n readTimeout: 20000\n compression:\n request:\n enabled: true\n response:\n enabled: true\n\n#开启灰度\ngray:\n rule:\n enabled: true\n\n# mybatis-plus 配置\nmybatis-plus:\n tenant-enable: ture\n mapper-locations: classpath:/mapper/*Mapper.xml\n global-config:\n capitalMode: true\n banner: false\n db-config:\n id-type: auto\n select-strategy: not_empty\n insert-strategy: not_empty\n update-strategy: not_null\n type-handlers-package: com.pig4cloud.pigx.common.data.handler\n configuration:\n jdbc-type-for-null: \'null\'\n call-setters-on-nulls: true\n# swagger 全局配置\nknife4j:\n enable: true\nswagger:\n enabled: true\n title: PigX Swagger API\n license: Powered By PigX\n licenseUrl: https://pig4cloud.com/\n terms-of-service-url: https://pig4cloud.com/\n contact:\n email: wangiegie@gmail.com\n url: https://pig4cloud.com/about.html\n authorization:\n name: oauth2\n auth-regex: ^.*$\n authorization-scope-list:\n - scope: server\n description: server all\n token-url-list:\n - http://${GATEWAY_HOST:pigx-gateway}:${GATEWAY_PORT:9999}/auth/oauth/token\n\n# oauth2 资源服务器相关配置\nsecurity:\n oauth2:\n client:\n ignore-urls:\n - /css/**\n - /error\n - /actuator/**\n - /v2/api-docs\n resource:\n loadBalanced: true\n token-info-uri: http://pigx-auth/oauth/check_token', '3aff83b8d6716ede396136a4e31d30c7', '2019-04-18 02:10:20', '2022-08-22 12:39:42', 'nacos', '127.0.0.1', '', '', '通用配置文件', 'null', 'null', 'yaml', 'null'); INSERT INTO `config_info` VALUES (2, 'pigx-auth-dev.yml', 'DEFAULT_GROUP', '# 数据源\nspring:\n freemarker:\n allow-request-override: false\n allow-session-override: false\n cache: true\n charset: UTF-8\n check-template-location: true\n content-type: text/html\n enabled: true\n expose-request-attributes: false\n expose-session-attributes: false\n expose-spring-macro-helpers: true\n prefer-file-system-access: true\n suffix: .ftl\n template-loader-path: classpath:/templates/', '74f53b71c7799aa754da75662378b93c', '2019-04-18 02:11:32', '2021-05-07 23:40:38', NULL, '10.1.1.143', '', '', '认证中心配置文件', 'null', 'null', 'yaml', 'null'); -INSERT INTO `config_info` VALUES (3, 'pigx-codegen-dev.yml', 'DEFAULT_GROUP', '## spring security 配置\nsecurity:\n oauth2:\n client:\n client-id: ENC(gPFcUOmJm8WqM3k3eSqS0Q==)\n client-secret: ENC(gPFcUOmJm8WqM3k3eSqS0Q==)\n scope: server\n ignore-urls:\n - /api/designer/**\n# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL_USER:root}\n password: ${MYSQL_PWD:root}\n url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_codegen}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n resources:\n static-locations: classpath:/static/,classpath:/views/\n\n# 租户表维护\npigx:\n tenant:\n column: tenant_id\n tables:\n - gen_datasource_conf\n - gen_form_conf', '7ac045a03dc5c1d7500b39a1534ad92a', '2019-04-18 02:12:10', '2022-09-02 16:44:34', 'nacos', '127.0.0.1', '', '', '代码生成', 'null', 'null', 'yaml', 'null'); +INSERT INTO `config_info` VALUES (3, 'pigx-codegen-dev.yml', 'DEFAULT_GROUP', '## spring security 配置\nsecurity:\n oauth2:\n client:\n client-id: ENC(gPFcUOmJm8WqM3k3eSqS0Q==)\n client-secret: ENC(gPFcUOmJm8WqM3k3eSqS0Q==)\n scope: server\n ignore-urls:\n - /api/designer/**\n - /actuator/**\n# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL_USER:root}\n password: ${MYSQL_PWD:root}\n url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_codegen}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true\n resources:\n static-locations: classpath:/static/,classpath:/views/\n\n# 租户表维护\npigx:\n tenant:\n column: tenant_id\n tables:\n - gen_datasource_conf\n - gen_form_conf', '93e4c49eab1bf6233925ca2a622d1ee6', '2019-04-18 02:12:10', '2022-12-01 20:22:01', 'nacos', '127.0.0.1', '', '', '代码生成', 'null', 'null', 'yaml', 'null'); INSERT INTO `config_info` VALUES (4, 'pigx-daemon-elastic-job-dev.yml', 'DEFAULT_GROUP', '## spring security 配置\nsecurity:\n oauth2:\n client:\n client-id: ENC(tz2NM4GcmnE7sNJTYL8ZSg==)\n client-secret: ENC(tz2NM4GcmnE7sNJTYL8ZSg==)\n scope: server\n## 定时任务\n# 数据源\nspring:\n datasource:\n type: com.alibaba.druid.pool.DruidDataSource\n druid:\n driver-class-name: com.mysql.cj.jdbc.Driver\n username: ${MYSQL_USER:root}\n password: ${MYSQL_PWD:root}\n url: jdbc:mysql://${MYSQL_HOST:pigx-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pigxx_job}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true', '4124589805657db024b20772cccf57f5', '2019-04-18 02:12:57', '2020-11-09 16:18:05', NULL, '172.16.1.198', '', '', '定时任务-elastic-job配置', 'null', 'null', 'yaml', 'null'); INSERT INTO `config_info` VALUES (5, 'pigx-gateway-dev.yml', 'DEFAULT_GROUP', 'gateway:\n encode-key: \'pigxpigxpigxpigx\'\n\nswagger:\n ignore-providers:\n - pigx-monitor\n - pigx-auth\n - pigx-tx-manager\n\nribbon:\n rule:\n gray-enabled: true\n\n# 验证码相关配置参考: http://t.cn/A647jEdu\naj:\n captcha:\n cache-type: redis\n water-mark: pig4cloud', 'cd9f8a6a46e2c128f3b172be76ea3221', '2019-04-18 02:13:52', '2021-11-09 12:09:34', '', '127.0.0.1', '', '', '', '', '', 'yaml', ''); INSERT INTO `config_info` VALUES (6, 'pigx-monitor-dev.yml', 'DEFAULT_GROUP', 'spring:\n # 安全配置\n security:\n user:\n name: ENC(rZHA4LW5hHmhLAAzJoFNag==) # pigx\n password: ENC(bjeyh+Aeii3kHXkoo00ZUw==) # pigx\n autoconfigure:\n exclude: com.pig4cloud.pigx.common.core.config.JacksonConfiguration\n boot:\n admin:\n ui:\n title: \'pigx 服务状态监控\'\n brand: \'pigx 服务状态监控\'\n external-views:\n - label: \"SQL监控\"\n url: /druid/sql.html\n order: 2000\n iframe: true\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'\n endpoint:\n health:\n show-details: ALWAYS #显示详细信息\n\n\n# druid 监控的服务\nmonitor:\n applications:\n - pigx-upms-biz\n - pigx-pay-platform\n', 'cbc0b536fe11eeff0dcf81be11dab6e4', '2019-04-18 02:14:17', '2022-02-18 13:44:07', 'nacos', '127.0.0.1', '', '', '监控配置文件', 'null', 'null', 'yaml', 'null'); diff --git a/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/service/GenCodeService.java b/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/service/GenCodeService.java index 596f5dadb..c7ae587af 100644 --- a/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/service/GenCodeService.java +++ b/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/service/GenCodeService.java @@ -277,7 +277,7 @@ public interface GenCodeService { Map resultMap = new LinkedHashMap<>(8); for (String template : templates) { - Map templatesData = new HashMap<>(); + Map templatesData = new HashMap<>(); // 渲染模板 StringWriter sw = new StringWriter(); Template tpl = Velocity.getTemplate(template, CharsetUtil.UTF_8); @@ -287,8 +287,8 @@ public interface GenCodeService { String fileName = getFileName(template, tableEntity.getCaseClassName(), map.get("package").toString(), map.get("moduleName").toString()); - templatesData.put("codePath",fileName); - templatesData.put("code",sw.toString()); + templatesData.put("codePath", fileName); + templatesData.put("code", sw.toString()); if (zip != null) { try { diff --git a/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/service/impl/GenDynamicServiceImpl.java b/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/service/impl/GenDynamicServiceImpl.java index 94ab5c7c4..477bae383 100644 --- a/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/service/impl/GenDynamicServiceImpl.java +++ b/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/service/impl/GenDynamicServiceImpl.java @@ -95,7 +95,7 @@ public class GenDynamicServiceImpl implements GenDynamicService { ApiInfo apiInfo = new ApiInfo(); apiInfo.setId(id + "_query"); - Map script = templates.get("template/magic/query.magic.vm"); + Map script = templates.get("template/magic/query.magic.vm"); apiInfo.setScript(script.get("code")); apiInfo.setName("分页"); apiInfo.setPath("/list"); @@ -105,7 +105,7 @@ public class GenDynamicServiceImpl implements GenDynamicService { ApiInfo delApiInfo = new ApiInfo(); delApiInfo.setId(id + "_del"); - Map delScript = templates.get("template/magic/del.magic.vm"); + Map delScript = templates.get("template/magic/del.magic.vm"); delApiInfo.setScript(delScript.get("code")); delApiInfo.setName("删除"); delApiInfo.setPath("/delete"); @@ -115,7 +115,7 @@ public class GenDynamicServiceImpl implements GenDynamicService { ApiInfo addApiInfo = new ApiInfo(); addApiInfo.setId(id + "_add"); - Map addScript = templates.get("template/magic/add.magic.vm"); + Map addScript = templates.get("template/magic/add.magic.vm"); addApiInfo.setScript(addScript.get("code")); addApiInfo.setName("添加"); addApiInfo.setPath("/save"); @@ -125,7 +125,7 @@ public class GenDynamicServiceImpl implements GenDynamicService { ApiInfo updateApiInfo = new ApiInfo(); updateApiInfo.setId(id + "_update"); - Map updateScript = templates.get("template/magic/update.magic.vm"); + Map updateScript = templates.get("template/magic/update.magic.vm"); updateApiInfo.setScript(updateScript.get("code")); updateApiInfo.setName("修改"); updateApiInfo.setPath("/update"); @@ -135,7 +135,7 @@ public class GenDynamicServiceImpl implements GenDynamicService { ApiInfo metadataApiInfo = new ApiInfo(); metadataApiInfo.setId(id + "metadata"); - Map metadataScript = templates.get("template/magic/metadata.magic.vm"); + Map metadataScript = templates.get("template/magic/metadata.magic.vm"); metadataApiInfo.setScript(metadataScript.get("code")); metadataApiInfo.setName("元数据"); metadataApiInfo.setPath("/metadata"); diff --git a/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/service/impl/temp/AvueGenCodeServiceImpl.java b/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/service/impl/temp/AvueGenCodeServiceImpl.java index a0736e9d4..73e5eb7a8 100644 --- a/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/service/impl/temp/AvueGenCodeServiceImpl.java +++ b/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/service/impl/temp/AvueGenCodeServiceImpl.java @@ -87,15 +87,15 @@ public class AvueGenCodeServiceImpl implements GenCodeService { Map resultMap = new HashMap<>(); if (Objects.nonNull(formConf)) { - Map templatesData = new HashMap<>(); + Map templatesData = new HashMap<>(); // 存在 curd 存在设计好的JSON 则使用Json 覆盖 String crudTempName = "template/avue/crud.js.vm"; String fileName = getFileName(crudTempName, tableEntity.getCaseClassName(), map.get("package").toString(), map.get("moduleName").toString()); String contents = CRUD_PREFIX + formConf.getFormInfo(); - templatesData.put("codePath",fileName); - templatesData.put("code",contents); + templatesData.put("codePath", fileName); + templatesData.put("code", contents); if (zip != null) { zip.putNextEntry(new ZipEntry(Objects.requireNonNull(fileName)));