Skip to content

Commit

Permalink
upgrade(tag): 0.0.4 适配最新 nacos2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lltx committed Aug 25, 2024
1 parent 83ec585 commit b4cec4d
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
releaseversion:
description: 'Release version'
required: true
default: '0.3.0'
default: '0.4.0'


jobs:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ application.properties 配置文件中 spring.datasource.platform 配置项选
|---------------|-------|
| 2.2.0 - 2.3.0 | 0.0.2 |
| 2.3.1 - 2.3.2 | 0.0.3 |
| 2.4.0 - 2.4.1 | 0.0.4 |

```xml
<!--达梦数据库插件-->
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.15</version>
<version>2.7.18</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>


<modelVersion>4.0.0</modelVersion>
<groupId>com.pig4cloud.plugin</groupId>
<artifactId>nacos-datasource-plugin-dm8</artifactId>
<version>0.0.3</version>
<version>0.0.4</version>
<name>nacos-datasource-plugin-dm8</name>
<description>nacos-datasource-plugin-dm8</description>
<url>https://pig4cloud.com</url>
Expand All @@ -25,7 +25,7 @@
</licenses>

<properties>
<nacos.version>2.3.2</nacos.version>
<nacos.version>2.4.1</nacos.version>
<spring.checkstyle.plugin>0.0.32</spring.checkstyle.plugin>
<maven.compiler.version>3.8.1</maven.compiler.version>
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

import com.alibaba.nacos.common.utils.CollectionUtils;
import com.alibaba.nacos.plugin.datasource.constants.FieldConstant;
import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper;
import com.alibaba.nacos.plugin.datasource.mapper.ConfigInfoAggrMapper;
import com.alibaba.nacos.plugin.datasource.model.MapperContext;
import com.alibaba.nacos.plugin.datasource.model.MapperResult;
import com.pig4cloud.plugin.constants.DataSourceConstant;

import java.util.List;

public class ConfigInfoAggrMapperByDm extends AbstractMapper implements ConfigInfoAggrMapper {
public class ConfigInfoAggrMapperByDm extends DmAbstractMapper implements ConfigInfoAggrMapper {

@Override
public MapperResult findConfigInfoAggrByPageFetchRows(MapperContext context) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.pig4cloud.plugin.impl.dm;

import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper;
import com.alibaba.nacos.plugin.datasource.mapper.ConfigInfoBetaMapper;
import com.alibaba.nacos.plugin.datasource.model.MapperContext;
import com.alibaba.nacos.plugin.datasource.model.MapperResult;
Expand All @@ -9,7 +8,7 @@
import java.util.ArrayList;
import java.util.List;

public class ConfigInfoBetaMapperByDm extends AbstractMapper implements ConfigInfoBetaMapper {
public class ConfigInfoBetaMapperByDm extends DmAbstractMapper implements ConfigInfoBetaMapper {

@Override
public MapperResult findAllConfigInfoBetaForDumpAllFetchRows(MapperContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.alibaba.nacos.common.utils.StringUtils;
import com.alibaba.nacos.plugin.datasource.constants.ContextConstant;
import com.alibaba.nacos.plugin.datasource.constants.FieldConstant;
import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper;
import com.alibaba.nacos.plugin.datasource.mapper.ConfigInfoMapper;
import com.alibaba.nacos.plugin.datasource.model.MapperContext;
import com.alibaba.nacos.plugin.datasource.model.MapperResult;
Expand All @@ -38,7 +37,7 @@
* @author hyx
**/

public class ConfigInfoMapperByDm extends AbstractMapper implements ConfigInfoMapper {
public class ConfigInfoMapperByDm extends DmAbstractMapper implements ConfigInfoMapper {

private static final String DATA_ID = "dataId";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package com.pig4cloud.plugin.impl.dm;

import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper;
import com.alibaba.nacos.plugin.datasource.mapper.ConfigInfoTagMapper;
import com.alibaba.nacos.plugin.datasource.model.MapperContext;
import com.alibaba.nacos.plugin.datasource.model.MapperResult;
import com.pig4cloud.plugin.constants.DataSourceConstant;

import java.util.Collections;

public class ConfigInfoTagMapperByDm extends AbstractMapper implements ConfigInfoTagMapper {
public class ConfigInfoTagMapperByDm extends DmAbstractMapper implements ConfigInfoTagMapper {

@Override
public MapperResult findAllConfigInfoTagForDumpAllFetchRows(MapperContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.alibaba.nacos.common.utils.StringUtils;
import com.alibaba.nacos.plugin.datasource.constants.FieldConstant;
import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper;
import com.alibaba.nacos.plugin.datasource.mapper.ConfigTagsRelationMapper;
import com.alibaba.nacos.plugin.datasource.model.MapperContext;
import com.alibaba.nacos.plugin.datasource.model.MapperResult;
Expand All @@ -11,7 +10,7 @@
import java.util.ArrayList;
import java.util.List;

public class ConfigTagsRelationMapperByDm extends AbstractMapper implements ConfigTagsRelationMapper {
public class ConfigTagsRelationMapperByDm extends DmAbstractMapper implements ConfigTagsRelationMapper {

@Override
public MapperResult findConfigInfo4PageFetchRows(MapperContext context) {
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/com/pig4cloud/plugin/impl/dm/DmAbstractMapper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.pig4cloud.plugin.impl.dm;

import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper;
import com.pig4cloud.plugin.constants.DataSourceConstant;

/**
* DM 抽象映射器
*
* @author lengleng
* @date 2024/08/25
*/
public abstract class DmAbstractMapper extends AbstractMapper {

/**
* 获取数据源
* @return {@link String }
*/
@Override
public String getDataSource() {
return DataSourceConstant.DM;
}

/**
* get 函数
* @param functionName 函数名称
* @return {@link String }
*/
@Override
public String getFunction(String functionName) {
return "NOW()";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

import com.alibaba.nacos.common.utils.CollectionUtils;
import com.alibaba.nacos.plugin.datasource.constants.FieldConstant;
import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper;
import com.alibaba.nacos.plugin.datasource.mapper.GroupCapacityMapper;
import com.alibaba.nacos.plugin.datasource.model.MapperContext;
import com.alibaba.nacos.plugin.datasource.model.MapperResult;
import com.pig4cloud.plugin.constants.DataSourceConstant;

public class GroupCapacityMapperByDm extends AbstractMapper implements GroupCapacityMapper {
public class GroupCapacityMapperByDm extends DmAbstractMapper implements GroupCapacityMapper {

@Override
public MapperResult selectGroupInfoBySize(MapperContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

import com.alibaba.nacos.common.utils.CollectionUtils;
import com.alibaba.nacos.plugin.datasource.constants.FieldConstant;
import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper;
import com.alibaba.nacos.plugin.datasource.mapper.HistoryConfigInfoMapper;
import com.alibaba.nacos.plugin.datasource.model.MapperContext;
import com.alibaba.nacos.plugin.datasource.model.MapperResult;
import com.pig4cloud.plugin.constants.DataSourceConstant;

public class HistoryConfigInfoMapperByDm extends AbstractMapper implements HistoryConfigInfoMapper {
public class HistoryConfigInfoMapperByDm extends DmAbstractMapper implements HistoryConfigInfoMapper {

@Override
public MapperResult removeConfigHistory(MapperContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

import com.alibaba.nacos.common.utils.CollectionUtils;
import com.alibaba.nacos.plugin.datasource.constants.FieldConstant;
import com.alibaba.nacos.plugin.datasource.mapper.AbstractMapper;
import com.alibaba.nacos.plugin.datasource.mapper.TenantCapacityMapper;
import com.alibaba.nacos.plugin.datasource.model.MapperContext;
import com.alibaba.nacos.plugin.datasource.model.MapperResult;
import com.pig4cloud.plugin.constants.DataSourceConstant;

public class TenantCapacityMapperByDm extends AbstractMapper implements TenantCapacityMapper {
public class TenantCapacityMapperByDm extends DmAbstractMapper implements TenantCapacityMapper {

@Override
public MapperResult getCapacityList4CorrectUsage(MapperContext context) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
package com.pig4cloud.plugin.impl.dm;

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 TenantInfoMapperByDm extends AbstractMapper implements TenantInfoMapper {
public class TenantInfoMapperByDm extends DmAbstractMapper implements TenantInfoMapper {

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

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

}

0 comments on commit b4cec4d

Please sign in to comment.