yaoq há 2 anos
ascendente
cometimento
6e8c81bda4
10 ficheiros alterados com 60 adições e 16 eliminações
  1. +13
    -0
      smtweb-framework/canal/client/pom.xml
  2. +1
    -1
      smtweb-framework/canal/client/src/main/java/cc/smtweb/system/canal/example/ClientStartedListener.java
  3. +14
    -2
      smtweb-framework/canal/file/pom.xml
  4. +4
    -1
      smtweb-framework/canal/file/src/main/java/cc/smtweb/system/canal/file/CanalFileStartedListener.java
  5. +2
    -3
      smtweb-framework/canal/file/src/main/java/cc/smtweb/system/canal/file/common/AbstractFileWork.java
  6. +7
    -0
      smtweb-framework/canal/file/src/main/java/cc/smtweb/system/canal/file/common/FileDecodeConfig.java
  7. +2
    -5
      smtweb-framework/canal/file/src/main/java/cc/smtweb/system/canal/file/common/FileDecodeService.java
  8. +3
    -3
      smtweb-framework/canal/file/src/main/java/cc/smtweb/system/canal/file/impl/MySqlFileWork.java
  9. +13
    -0
      smtweb-framework/canal/server/pom.xml
  10. +1
    -1
      smtweb-framework/canal/server/src/main/java/cc/smtweb/system/canal/deployer/CanalStartedListener.java

+ 13
- 0
smtweb-framework/canal/client/pom.xml Ver ficheiro

@@ -207,4 +207,17 @@
</build>
</profile>
</profiles>

<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<url>http://47.92.149.153:7000/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://47.92.149.153:7000/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
</project>

+ 1
- 1
smtweb-framework/canal/client/src/main/java/cc/smtweb/system/canal/example/ClientStartedListener.java Ver ficheiro

@@ -16,7 +16,7 @@ public class ClientStartedListener implements IStartListener {

@Override
public int order() {
return SwConsts.DEFAULT_ORDER + 3;
return SwConsts.DEFAULT_ORDER + 99;
}




+ 14
- 2
smtweb-framework/canal/file/pom.xml Ver ficheiro

@@ -43,7 +43,7 @@
<version>3.1.0-SNAPSHOT</version>
</dependency>

<dependency>
<!--<dependency>
<groupId>cc.smtweb</groupId>
<artifactId>canal.example</artifactId>
<version>1.1.5</version>
@@ -53,7 +53,7 @@
<groupId>cc.smtweb</groupId>
<artifactId>canal.deployer</artifactId>
<version>1.1.5</version>
</dependency>
</dependency>-->


<dependency>
@@ -92,4 +92,16 @@
</plugins>
</build>

<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<url>http://47.92.149.153:7000/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://47.92.149.153:7000/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
</project>

+ 4
- 1
smtweb-framework/canal/file/src/main/java/cc/smtweb/system/canal/file/CanalFileStartedListener.java Ver ficheiro

@@ -4,6 +4,8 @@ import cc.smtweb.framework.core.annotation.SwStartListener;
import cc.smtweb.framework.core.common.SwConsts;
import cc.smtweb.framework.core.mvc.controller.IStartListener;
import cc.smtweb.framework.core.systask.SysServiceFactory;
import cc.smtweb.framework.core.util.SpringUtil;
import cc.smtweb.system.canal.file.common.FileDecodeConfig;
import cc.smtweb.system.canal.file.common.FileDecodeService;
import lombok.extern.slf4j.Slf4j;

@@ -24,9 +26,10 @@ public class CanalFileStartedListener implements IStartListener {

@Override
public void init() {
FileDecodeConfig config = SpringUtil.getBean(FileDecodeConfig.class);
SwConsts.SysParam.enableCanal = true;
SwConsts.SysParam.RUN_PROJECTS = "";
SysServiceFactory.getInstance().reg(new FileDecodeService());
if(config.isEnable()) SysServiceFactory.getInstance().reg(new FileDecodeService());
}

@Override


+ 2
- 3
smtweb-framework/canal/file/src/main/java/cc/smtweb/system/canal/file/common/AbstractFileWork.java Ver ficheiro

@@ -7,7 +7,6 @@ import cc.smtweb.framework.core.exception.SwException;
import cc.smtweb.framework.core.util.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Component;

import java.io.File;
@@ -140,7 +139,7 @@ public abstract class AbstractFileWork {
for (String field : fields) {
sql.append("?").append(",");
String value = data.get(field);
if (StringUtils.isEmpty(value)) {
if (StringUtil.isEmpty(value)) {
args.add(null);
} else {
args.add(value);
@@ -161,7 +160,7 @@ public abstract class AbstractFileWork {
if (field.equals(canalVO.getIdField())) continue;
sql.append(field).append("=").append("?").append(",");
String value = data.get(field);
if (StringUtils.isEmpty(value)) {
if (StringUtil.isEmpty(value)) {
args.add(null);
} else {
args.add(value);


+ 7
- 0
smtweb-framework/canal/file/src/main/java/cc/smtweb/system/canal/file/common/FileDecodeConfig.java Ver ficheiro

@@ -14,9 +14,16 @@ public class FileDecodeConfig {
@Value("${canal.file.path}")
private String path;

@Value("${canal.file.enable}")
private boolean enable;

public String getPath() {
return path;
}

public boolean isEnable() {
return enable;
}
}



+ 2
- 5
smtweb-framework/canal/file/src/main/java/cc/smtweb/system/canal/file/common/FileDecodeService.java Ver ficheiro

@@ -4,10 +4,7 @@ import cc.smtweb.framework.core.db.DbEngine;
import cc.smtweb.framework.core.systask.BaseSysService;
import lombok.extern.slf4j.Slf4j;

/**
* Created by Akmm at 2021/12/6 19:19
* 清除当前已结束任务, 10分钟一次
*/

@Slf4j
public class FileDecodeService extends BaseSysService {
@Override
@@ -17,7 +14,7 @@ public class FileDecodeService extends BaseSysService {

@Override
public int getInterval() {
return 5;
return 10;
}

@Override


+ 3
- 3
smtweb-framework/canal/file/src/main/java/cc/smtweb/system/canal/file/impl/MySqlFileWork.java Ver ficheiro

@@ -2,8 +2,8 @@ package cc.smtweb.system.canal.file.impl;

import cc.smtweb.framework.core.common.CanalVO;
import cc.smtweb.framework.core.common.SwEnum;
import cc.smtweb.framework.core.util.StringUtil;
import cc.smtweb.system.canal.file.common.AbstractFileWork;
import org.apache.commons.lang.StringUtils;

import java.util.ArrayList;
import java.util.List;
@@ -47,7 +47,7 @@ public class MySqlFileWork extends AbstractFileWork {
for (String field : fields) {
sql.append("?").append(",");
String value = data.get(field);
if (StringUtils.isEmpty(value)) {
if (StringUtil.isEmpty(value)) {
args.add(null);
} else {
args.add(value);
@@ -69,7 +69,7 @@ public class MySqlFileWork extends AbstractFileWork {
if (field.equals(canalVO.getIdField())) continue;
sql.append(field).append("=").append("?").append(",");
String value = data.get(field);
if (StringUtils.isEmpty(value)) {
if (StringUtil.isEmpty(value)) {
args.add(null);
} else {
args.add(value);


+ 13
- 0
smtweb-framework/canal/server/pom.xml Ver ficheiro

@@ -189,4 +189,17 @@
</build>
</profile>
</profiles>

<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<url>http://47.92.149.153:7000/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://47.92.149.153:7000/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
</project>

+ 1
- 1
smtweb-framework/canal/server/src/main/java/cc/smtweb/system/canal/deployer/CanalStartedListener.java Ver ficheiro

@@ -18,7 +18,7 @@ public class CanalStartedListener implements IStartListener {

@Override
public int order() {
return SwConsts.DEFAULT_ORDER + 2;
return SwConsts.DEFAULT_ORDER + 90;
}




Carregando…
Cancelar
Guardar