From 8f146bdd7a425b9582287a636604f7e8ad7ddf83 Mon Sep 17 00:00:00 2001 From: lbw Date: Tue, 25 Apr 2023 21:31:29 +0800 Subject: [PATCH] =?UTF-8?q?:bookmark:=20Releasing=20/=20Version=20tags.=20?= =?UTF-8?q?=E7=80=9A=E9=AB=98=E6=95=B0=E6=8D=AE=E5=BA=93=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 27 +++++++++---------- pom.xml | 8 +++--- sql/{nacos-pg.sql => nacos-highgo.sql} | 0 .../plugin/constants/DataSourceConstant.java | 6 +---- .../ConfigInfoAggrMapperByHighgo.java} | 6 ++--- .../ConfigInfoBetaMapperByHighgo.java} | 6 ++--- .../ConfigInfoMapperByHighgo.java} | 6 ++--- .../ConfigInfoTagMapperByHighgo.java} | 6 ++--- .../ConfigTagsRelationMapperByHighgo.java} | 6 ++--- .../GroupCapacityMapperByHighgo.java} | 6 ++--- .../HistoryConfigInfoMapperByHighgo.java} | 6 ++--- .../TenantCapacityMapperByHighgo.java} | 6 ++--- .../TenantInfoMapperByHighgo.java} | 6 ++--- ...baba.nacos.plugin.datasource.mapper.Mapper | 18 ++++++------- 14 files changed, 54 insertions(+), 59 deletions(-) rename sql/{nacos-pg.sql => nacos-highgo.sql} (100%) rename src/main/java/com/pig4cloud/plugin/impl/{postgresql/ConfigInfoAggrMapperByPostgresql.java => highgo/ConfigInfoAggrMapperByHighgo.java} (91%) rename src/main/java/com/pig4cloud/plugin/impl/{postgresql/ConfigInfoBetaMapperByPostgresql.java => highgo/ConfigInfoBetaMapperByHighgo.java} (85%) rename src/main/java/com/pig4cloud/plugin/impl/{postgresql/ConfigInfoMapperByPostgresql.java => highgo/ConfigInfoMapperByHighgo.java} (98%) rename src/main/java/com/pig4cloud/plugin/impl/{postgresql/ConfigInfoTagMapperByPostgresql.java => highgo/ConfigInfoTagMapperByHighgo.java} (84%) rename src/main/java/com/pig4cloud/plugin/impl/{postgresql/ConfigTagsRelationMapperByPostgresql.java => highgo/ConfigTagsRelationMapperByHighgo.java} (95%) rename src/main/java/com/pig4cloud/plugin/impl/{postgresql/GroupCapacityMapperByPostgresql.java => highgo/GroupCapacityMapperByHighgo.java} (92%) rename src/main/java/com/pig4cloud/plugin/impl/{postgresql/HistoryConfigInfoMapperByPostgresql.java => highgo/HistoryConfigInfoMapperByHighgo.java} (87%) rename src/main/java/com/pig4cloud/plugin/impl/{postgresql/TenantCapacityMapperByPostgresql.java => highgo/TenantCapacityMapperByHighgo.java} (90%) rename src/main/java/com/pig4cloud/plugin/impl/{postgresql/TenantInfoMapperByPostgresql.java => highgo/TenantInfoMapperByHighgo.java} (68%) diff --git a/README.md b/README.md index 6475de7..654aca4 100644 --- a/README.md +++ b/README.md @@ -7,28 +7,29 @@ Nacos 从 2.2.0 版本开始,可通过 SPI 机制注入多数据源实现插件, ![](https://minio.pigx.vip/oss/202212/1671180565.png) -## 自定义 PostgreSQL 插件 +## 自定义 highgo 插件 -### 1. 添加 postgresql 插件 +### 1. 添加 highgo 插件 > 依赖已上传 maven 中央仓库,请勿使用阿里云代理 ```xml com.pig4cloud.plugin - nacos-datasource-plugin-pg + nacos-datasource-plugin-highgo 0.0.1 - org.postgresql - postgresql + com.highgo + HgdbJdbc + 6.2.0 ``` -### 2. 导入 nacos postgresql 数据库脚本 +### 2. 导入 nacos highgo 数据库脚本 -./sql/nacos-pg.sql +./sql/nacos-highgo.sql ### 3. 配置 nacos 数据源链接信息 @@ -36,14 +37,12 @@ Nacos 从 2.2.0 版本开始,可通过 SPI 机制注入多数据源实现插件, db: num: 1 url: - 0: jdbc:postgresql://172.27.0.5:5432/pigxx_config - user: - 0: postgres - password: - 0: 123456 + 0: jdbc:highgo://172.27.0.5:5866/highgo?currentSchema=nacos + user: highgo + password: Highgo@123 pool: config: - driver-class-name: org.postgresql.Driver + driver-class-name: com.highgo.jdbc.Driver ``` ### 4. 指定 nacos 数据源平台 @@ -51,7 +50,7 @@ db: ```yaml spring: datasource: - platform: postgresql + platform: highgo ``` ![](https://minio.pigx.vip/oss/202212/1671184577.png) diff --git a/pom.xml b/pom.xml index 2da84f7..a62023d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,14 +5,14 @@ org.springframework.boot spring-boot-starter-parent - 2.7.6 + 2.7.11 com.pig4cloud.plugin - nacos-datasource-plugin-pg + nacos-datasource-plugin-highgo 0.0.2-SNAPSHOT - nacos-datasource-plugin-pg - nacos-datasource-plugin-pg + nacos-datasource-plugin-highgo + nacos 瀚高数据库存储插件 https://pig4cloud.com diff --git a/sql/nacos-pg.sql b/sql/nacos-highgo.sql similarity index 100% rename from sql/nacos-pg.sql rename to sql/nacos-highgo.sql diff --git a/src/main/java/com/pig4cloud/plugin/constants/DataSourceConstant.java b/src/main/java/com/pig4cloud/plugin/constants/DataSourceConstant.java index 7640b82..823b40c 100644 --- a/src/main/java/com/pig4cloud/plugin/constants/DataSourceConstant.java +++ b/src/main/java/com/pig4cloud/plugin/constants/DataSourceConstant.java @@ -24,10 +24,6 @@ public class DataSourceConstant { - public static final String MYSQL = "mysql"; - - public static final String DERBY = "derby"; - - public static final String POSTGRESQL = "postgresql"; + public static final String HIGHGO = "highgo"; } diff --git a/src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigInfoAggrMapperByPostgresql.java b/src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigInfoAggrMapperByHighgo.java similarity index 91% rename from src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigInfoAggrMapperByPostgresql.java rename to src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigInfoAggrMapperByHighgo.java index d031eab..a35ba37 100644 --- a/src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigInfoAggrMapperByPostgresql.java +++ b/src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigInfoAggrMapperByHighgo.java @@ -1,4 +1,4 @@ -package com.pig4cloud.plugin.impl.postgresql; +package com.pig4cloud.plugin.impl.highgo; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; @@ -7,7 +7,7 @@ import java.util.List; -public class ConfigInfoAggrMapperByPostgresql extends AbstractMapper implements ConfigInfoAggrMapper { +public class ConfigInfoAggrMapperByHighgo extends AbstractMapper implements ConfigInfoAggrMapper { /** * 批量删除 @@ -70,7 +70,7 @@ public String getTableName() { @Override public String getDataSource() { - return DataSourceConstant.POSTGRESQL; + return DataSourceConstant.HIGHGO; } } diff --git a/src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigInfoBetaMapperByPostgresql.java b/src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigInfoBetaMapperByHighgo.java similarity index 85% rename from src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigInfoBetaMapperByPostgresql.java rename to src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigInfoBetaMapperByHighgo.java index f5cc197..e1117ef 100644 --- a/src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigInfoBetaMapperByPostgresql.java +++ b/src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigInfoBetaMapperByHighgo.java @@ -1,11 +1,11 @@ -package com.pig4cloud.plugin.impl.postgresql; +package com.pig4cloud.plugin.impl.highgo; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.ConfigInfoBetaMapper; import com.pig4cloud.plugin.constants.DataSourceConstant; -public class ConfigInfoBetaMapperByPostgresql extends AbstractMapper implements ConfigInfoBetaMapper { +public class ConfigInfoBetaMapperByHighgo extends AbstractMapper implements ConfigInfoBetaMapper { @Override public String updateConfigInfo4BetaCas() { @@ -27,7 +27,7 @@ public String getTableName() { @Override public String getDataSource() { - return DataSourceConstant.POSTGRESQL; + return DataSourceConstant.HIGHGO; } } diff --git a/src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigInfoMapperByPostgresql.java b/src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigInfoMapperByHighgo.java similarity index 98% rename from src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigInfoMapperByPostgresql.java rename to src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigInfoMapperByHighgo.java index efeb68f..358fda9 100644 --- a/src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigInfoMapperByPostgresql.java +++ b/src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigInfoMapperByHighgo.java @@ -1,4 +1,4 @@ -package com.pig4cloud.plugin.impl.postgresql; +package com.pig4cloud.plugin.impl.highgo; import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.common.utils.StringUtils; @@ -12,7 +12,7 @@ import java.util.List; import java.util.Map; -public class ConfigInfoMapperByPostgresql extends AbstractMapper implements ConfigInfoMapper { +public class ConfigInfoMapperByHighgo extends AbstractMapper implements ConfigInfoMapper { private static final String DATA_ID = "dataId"; @@ -374,7 +374,7 @@ public String getTableName() { @Override public String getDataSource() { - return DataSourceConstant.POSTGRESQL; + return DataSourceConstant.HIGHGO; } } diff --git a/src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigInfoTagMapperByPostgresql.java b/src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigInfoTagMapperByHighgo.java similarity index 84% rename from src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigInfoTagMapperByPostgresql.java rename to src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigInfoTagMapperByHighgo.java index fbe5a9b..2c8d075 100644 --- a/src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigInfoTagMapperByPostgresql.java +++ b/src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigInfoTagMapperByHighgo.java @@ -1,11 +1,11 @@ -package com.pig4cloud.plugin.impl.postgresql; +package com.pig4cloud.plugin.impl.highgo; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.ConfigInfoTagMapper; import com.pig4cloud.plugin.constants.DataSourceConstant; -public class ConfigInfoTagMapperByPostgresql extends AbstractMapper implements ConfigInfoTagMapper { +public class ConfigInfoTagMapperByHighgo extends AbstractMapper implements ConfigInfoTagMapper { @Override public String updateConfigInfo4TagCas() { @@ -27,7 +27,7 @@ public String getTableName() { @Override public String getDataSource() { - return DataSourceConstant.POSTGRESQL; + return DataSourceConstant.HIGHGO; } } diff --git a/src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigTagsRelationMapperByPostgresql.java b/src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigTagsRelationMapperByHighgo.java similarity index 95% rename from src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigTagsRelationMapperByPostgresql.java rename to src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigTagsRelationMapperByHighgo.java index 06c53fd..c175858 100644 --- a/src/main/java/com/pig4cloud/plugin/impl/postgresql/ConfigTagsRelationMapperByPostgresql.java +++ b/src/main/java/com/pig4cloud/plugin/impl/highgo/ConfigTagsRelationMapperByHighgo.java @@ -1,4 +1,4 @@ -package com.pig4cloud.plugin.impl.postgresql; +package com.pig4cloud.plugin.impl.highgo; import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; @@ -8,7 +8,7 @@ import java.util.Map; -public class ConfigTagsRelationMapperByPostgresql extends AbstractMapper implements ConfigTagsRelationMapper { +public class ConfigTagsRelationMapperByHighgo extends AbstractMapper implements ConfigTagsRelationMapper { @Override public String findConfigInfo4PageCountRows(final Map params, final int tagSize) { @@ -147,7 +147,7 @@ public String getTableName() { @Override public String getDataSource() { - return DataSourceConstant.POSTGRESQL; + return DataSourceConstant.HIGHGO; } } diff --git a/src/main/java/com/pig4cloud/plugin/impl/postgresql/GroupCapacityMapperByPostgresql.java b/src/main/java/com/pig4cloud/plugin/impl/highgo/GroupCapacityMapperByHighgo.java similarity index 92% rename from src/main/java/com/pig4cloud/plugin/impl/postgresql/GroupCapacityMapperByPostgresql.java rename to src/main/java/com/pig4cloud/plugin/impl/highgo/GroupCapacityMapperByHighgo.java index acf278f..29a5589 100644 --- a/src/main/java/com/pig4cloud/plugin/impl/postgresql/GroupCapacityMapperByPostgresql.java +++ b/src/main/java/com/pig4cloud/plugin/impl/highgo/GroupCapacityMapperByHighgo.java @@ -1,11 +1,11 @@ -package com.pig4cloud.plugin.impl.postgresql; +package com.pig4cloud.plugin.impl.highgo; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.GroupCapacityMapper; import com.pig4cloud.plugin.constants.DataSourceConstant; -public class GroupCapacityMapperByPostgresql extends AbstractMapper implements GroupCapacityMapper { +public class GroupCapacityMapperByHighgo extends AbstractMapper implements GroupCapacityMapper { @Override public String insertIntoSelect() { @@ -62,7 +62,7 @@ public String getTableName() { @Override public String getDataSource() { - return DataSourceConstant.POSTGRESQL; + return DataSourceConstant.HIGHGO; } } diff --git a/src/main/java/com/pig4cloud/plugin/impl/postgresql/HistoryConfigInfoMapperByPostgresql.java b/src/main/java/com/pig4cloud/plugin/impl/highgo/HistoryConfigInfoMapperByHighgo.java similarity index 87% rename from src/main/java/com/pig4cloud/plugin/impl/postgresql/HistoryConfigInfoMapperByPostgresql.java rename to src/main/java/com/pig4cloud/plugin/impl/highgo/HistoryConfigInfoMapperByHighgo.java index a2101f3..bef530c 100644 --- a/src/main/java/com/pig4cloud/plugin/impl/postgresql/HistoryConfigInfoMapperByPostgresql.java +++ b/src/main/java/com/pig4cloud/plugin/impl/highgo/HistoryConfigInfoMapperByHighgo.java @@ -1,11 +1,11 @@ -package com.pig4cloud.plugin.impl.postgresql; +package com.pig4cloud.plugin.impl.highgo; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.HistoryConfigInfoMapper; import com.pig4cloud.plugin.constants.DataSourceConstant; -public class HistoryConfigInfoMapperByPostgresql extends AbstractMapper implements HistoryConfigInfoMapper { +public class HistoryConfigInfoMapperByHighgo extends AbstractMapper implements HistoryConfigInfoMapper { @Override public String removeConfigHistory() { @@ -41,7 +41,7 @@ public String getTableName() { @Override public String getDataSource() { - return DataSourceConstant.POSTGRESQL; + return DataSourceConstant.HIGHGO; } } diff --git a/src/main/java/com/pig4cloud/plugin/impl/postgresql/TenantCapacityMapperByPostgresql.java b/src/main/java/com/pig4cloud/plugin/impl/highgo/TenantCapacityMapperByHighgo.java similarity index 90% rename from src/main/java/com/pig4cloud/plugin/impl/postgresql/TenantCapacityMapperByPostgresql.java rename to src/main/java/com/pig4cloud/plugin/impl/highgo/TenantCapacityMapperByHighgo.java index 5721df7..ffd4fe9 100644 --- a/src/main/java/com/pig4cloud/plugin/impl/postgresql/TenantCapacityMapperByPostgresql.java +++ b/src/main/java/com/pig4cloud/plugin/impl/highgo/TenantCapacityMapperByHighgo.java @@ -1,11 +1,11 @@ -package com.pig4cloud.plugin.impl.postgresql; +package com.pig4cloud.plugin.impl.highgo; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.TenantCapacityMapper; import com.pig4cloud.plugin.constants.DataSourceConstant; -public class TenantCapacityMapperByPostgresql extends AbstractMapper implements TenantCapacityMapper { +public class TenantCapacityMapperByHighgo extends AbstractMapper implements TenantCapacityMapper { @Override public String incrementUsageWithDefaultQuotaLimit() { @@ -53,7 +53,7 @@ public String getTableName() { @Override public String getDataSource() { - return DataSourceConstant.POSTGRESQL; + return DataSourceConstant.HIGHGO; } } diff --git a/src/main/java/com/pig4cloud/plugin/impl/postgresql/TenantInfoMapperByPostgresql.java b/src/main/java/com/pig4cloud/plugin/impl/highgo/TenantInfoMapperByHighgo.java similarity index 68% rename from src/main/java/com/pig4cloud/plugin/impl/postgresql/TenantInfoMapperByPostgresql.java rename to src/main/java/com/pig4cloud/plugin/impl/highgo/TenantInfoMapperByHighgo.java index 8376713..03f6665 100644 --- a/src/main/java/com/pig4cloud/plugin/impl/postgresql/TenantInfoMapperByPostgresql.java +++ b/src/main/java/com/pig4cloud/plugin/impl/highgo/TenantInfoMapperByHighgo.java @@ -1,11 +1,11 @@ -package com.pig4cloud.plugin.impl.postgresql; +package com.pig4cloud.plugin.impl.highgo; import com.alibaba.nacos.plugin.datasource.constants.TableConstant; import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper; import com.alibaba.nacos.plugin.datasource.mapper.TenantInfoMapper; import com.pig4cloud.plugin.constants.DataSourceConstant; -public class TenantInfoMapperByPostgresql extends AbstractMapper implements TenantInfoMapper { +public class TenantInfoMapperByHighgo extends AbstractMapper implements TenantInfoMapper { @Override public String getTableName() { @@ -14,7 +14,7 @@ public String getTableName() { @Override public String getDataSource() { - return DataSourceConstant.POSTGRESQL; + return DataSourceConstant.HIGHGO; } } diff --git a/src/main/resources/META-INF/services/com.alibaba.nacos.plugin.datasource.mapper.Mapper b/src/main/resources/META-INF/services/com.alibaba.nacos.plugin.datasource.mapper.Mapper index 1f0447b..bd40c48 100644 --- a/src/main/resources/META-INF/services/com.alibaba.nacos.plugin.datasource.mapper.Mapper +++ b/src/main/resources/META-INF/services/com.alibaba.nacos.plugin.datasource.mapper.Mapper @@ -1,9 +1,9 @@ -com.pig4cloud.plugin.impl.postgresql.ConfigInfoAggrMapperByPostgresql -com.pig4cloud.plugin.impl.postgresql.ConfigInfoBetaMapperByPostgresql -com.pig4cloud.plugin.impl.postgresql.ConfigInfoMapperByPostgresql -com.pig4cloud.plugin.impl.postgresql.ConfigInfoTagMapperByPostgresql -com.pig4cloud.plugin.impl.postgresql.ConfigTagsRelationMapperByPostgresql -com.pig4cloud.plugin.impl.postgresql.HistoryConfigInfoMapperByPostgresql -com.pig4cloud.plugin.impl.postgresql.TenantInfoMapperByPostgresql -com.pig4cloud.plugin.impl.postgresql.TenantCapacityMapperByPostgresql -com.pig4cloud.plugin.impl.postgresql.GroupCapacityMapperByPostgresql +com.pig4cloud.plugin.impl.highgo.ConfigInfoAggrMapperByHighgo +com.pig4cloud.plugin.impl.highgo.ConfigInfoBetaMapperByHighgo +com.pig4cloud.plugin.impl.highgo.ConfigInfoMapperByHighgo +com.pig4cloud.plugin.impl.highgo.ConfigInfoTagMapperByHighgo +com.pig4cloud.plugin.impl.highgo.ConfigTagsRelationMapperByHighgo +com.pig4cloud.plugin.impl.highgo.HistoryConfigInfoMapperByHighgo +com.pig4cloud.plugin.impl.highgo.TenantInfoMapperByHighgo +com.pig4cloud.plugin.impl.highgo.TenantCapacityMapperByHighgo +com.pig4cloud.plugin.impl.highgo.GroupCapacityMapperByHighgo