Skip to content

Commit

Permalink
⬆️ Upgrading dependencies. nacos 2.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
lbw committed Nov 2, 2023
1 parent 8f146bd commit 21eb20a
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 44 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Nacos 从 2.2.0 版本开始,可通过 SPI 机制注入多数据源实现插件,

> Nacos 官方默认实现 MySQL、Derby ,其他类型数据库接入需要参考下文自己扩展。
![](https://minio.pigx.vip/oss/202212/1671180565.png)
![](https://minio.pigx.top/oss/202212/1671180565.png)

## 自定义 highgo 插件

Expand All @@ -17,7 +17,7 @@ Nacos 从 2.2.0 版本开始,可通过 SPI 机制注入多数据源实现插件,
<dependency>
<groupId>com.pig4cloud.plugin</groupId>
<artifactId>nacos-datasource-plugin-highgo</artifactId>
<version>0.0.1</version>
<version>0.0.2</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -52,5 +52,5 @@ spring:
datasource:
platform: highgo
```
![](https://minio.pigx.vip/oss/202212/1671184577.png)
![](https://minio.pigx.top/oss/202212/1671184577.png)
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.11</version>
<version>2.7.15</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.pig4cloud.plugin</groupId>
<artifactId>nacos-datasource-plugin-highgo</artifactId>
<version>0.0.2-SNAPSHOT</version>
<version>0.0.2</version>
<name>nacos-datasource-plugin-highgo</name>
<description>nacos 瀚高数据库存储插件</description>
<url>https://pig4cloud.com</url>
Expand Down Expand Up @@ -58,12 +58,12 @@
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-datasource-plugin</artifactId>
<version>2.2.0</version>
<version>2.2.4</version>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-common</artifactId>
<version>2.2.0</version>
<version>2.2.4</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public class ConfigInfoAggrMapperByHighgo extends AbstractMapper implements Conf
* @param datumList
* @return
*/
@Override
public String batchRemoveAggr(List<String> datumList) {
final StringBuilder datumString = new StringBuilder();
for (String datum : datumList) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,46 @@

public class HistoryConfigInfoMapperByHighgo extends AbstractMapper implements HistoryConfigInfoMapper {

@Override
public String removeConfigHistory() {
return "DELETE FROM his_config_info WHERE gmt_modified < ? LIMIT ?";
}

@Override
public String findConfigHistoryCountByTime() {
return "SELECT count(*) FROM his_config_info WHERE gmt_modified < ?";
}

@Override
public String findDeletedConfig() {
return "SELECT DISTINCT data_id, group_id, tenant_id FROM his_config_info WHERE op_type = 'D' AND gmt_modified >= ? AND gmt_modified <= ?";
}

@Override
public String findConfigHistoryFetchRows() {
return "SELECT nid,data_id,group_id,tenant_id,app_name,src_ip,src_user,op_type,gmt_create,gmt_modified FROM his_config_info "
+ "WHERE data_id = ? AND group_id = ? AND tenant_id = ? ORDER BY nid DESC";
}

@Override
public String detailPreviousConfigHistory() {
return "SELECT nid,data_id,group_id,tenant_id,app_name,content,md5,src_user,src_ip,op_type,gmt_create,gmt_modified "
+ "FROM his_config_info WHERE nid = (SELECT max(nid) FROM his_config_info WHERE id = ?) ";
}

@Override
public String getTableName() {
return TableConstant.HIS_CONFIG_INFO;
}

@Override
public String getDataSource() {
return DataSourceConstant.HIGHGO;
}
@Override
public String removeConfigHistory() {
return "DELETE FROM his_config_info WHERE gmt_modified < ? LIMIT ?";
}

@Override
public String findConfigHistoryCountByTime() {
return "SELECT count(*) FROM his_config_info WHERE gmt_modified < ?";
}

@Override
public String findDeletedConfig() {
return "SELECT DISTINCT data_id, group_id, tenant_id FROM his_config_info WHERE op_type = 'D' AND gmt_modified >= ? AND gmt_modified <= ?";
}

@Override
public String findConfigHistoryFetchRows() {
return "SELECT nid,data_id,group_id,tenant_id,app_name,src_ip,src_user,op_type,gmt_create,gmt_modified FROM his_config_info "
+ "WHERE data_id = ? AND group_id = ? AND tenant_id = ? ORDER BY nid DESC";
}

@Override
public String pageFindConfigHistoryFetchRows(int i, int i1) {
throw new UnsupportedOperationException();
}

@Override
public String detailPreviousConfigHistory() {
return "SELECT nid,data_id,group_id,tenant_id,app_name,content,md5,src_user,src_ip,op_type,gmt_create,gmt_modified "
+ "FROM his_config_info WHERE nid = (SELECT max(nid) FROM his_config_info WHERE id = ?) ";
}

@Override
public String getTableName() {
return TableConstant.HIS_CONFIG_INFO;
}

@Override
public String getDataSource() {
return DataSourceConstant.HIGHGO;
}

}

0 comments on commit 21eb20a

Please sign in to comment.