Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
|
070090b3a7 | |
|
da1820e368 | |
|
011f3e2a84 | |
|
17887cc8db | |
|
0124e5898f | |
|
c9f3e36482 |
base-buildpackage
pom.xml
src
base-service/src/main/java/com/hzya/frame
sys
dictionaryshopNew/service
flow
sysnew/application
fw-nifi
pom.xml
src/main/java/com/hzya/frame/nifiapi
NifiApplication.java
client
config
model
basemodel
joinbindparametercontexts
joincontrollerenabled
joincreateconnection
joincreateconnections
joincreatemysqlapp
joincreateoracleapp
joincreateprocessconnection
joincreateprocessorandupdateparam
joincreatetemp
joincreparamcontext
joinfindneedmodifycontroller
joingetallcontrollerservice
joingetcontroller
joinparametercontexts
joinprocessgroups
joinsnippetinstance
joinsnippets
joinstartorstopprocessgroup
joinupdateprocessor
nifitemplates
processgroupid
|
@ -18,22 +18,6 @@
|
|||
<artifactId>base-webapp</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.hzya.frame</groupId>
|
||||
<artifactId>fw-nifi</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bazaarvoice.jolt</groupId>
|
||||
<artifactId>jolt-core</artifactId>
|
||||
<version>${latest.jolt.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bazaarvoice.jolt</groupId>
|
||||
<artifactId>json-utils</artifactId>
|
||||
<version>${latest.jolt.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
|
@ -48,12 +32,6 @@
|
|||
</profile>
|
||||
|
||||
|
||||
<profile>
|
||||
<id>liuy</id> <!--刘洋-->
|
||||
<properties>
|
||||
<profile.active>liuy</profile.active>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>llg</id> <!--吕磊钢-->
|
||||
<properties>
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
#######################dev环境#######################
|
||||
logging:
|
||||
#日志级别 指定目录级别
|
||||
level:
|
||||
root: warn
|
||||
encodings: UTF-8
|
||||
file:
|
||||
# 日志保存路径
|
||||
path: /Users/liuyang/workspaces/hzya/fw-nifi/zt-log
|
||||
spring:
|
||||
datasource:
|
||||
dynamic:
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
|
||||
username: root
|
||||
password: bd993088e8a7c3dc5f44441617f9b4bf
|
||||
driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
|
||||
savefile:
|
||||
# 文件保存路径
|
||||
path: /Users/liuyang/workspaces/hzya/fw-nifi/zt-file
|
||||
# path: D:\webservice\file
|
||||
# pluginpath: D:\webservice\plugin
|
||||
pluginpath: /home/webservice/zt/plugin
|
||||
# tomcatpath: D:\apache-tomcat-9.0.69\webapps\kangarooDataCenter\WEB-INF\classes\
|
||||
tomcatpath: /home/webservice/zt/tomcatV3/webapps/kangarooDataCenterV3/WEB-INF/classes/
|
||||
cbs8:
|
||||
appId: 1P4AGrpz
|
||||
appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
|
||||
url: https://cbs8-openapi-reprd.csuat.cmburl.cn
|
||||
# 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
|
||||
ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44
|
||||
# 这个私钥到时候上传到cbs,和下面到是同一对
|
||||
#ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
|
||||
ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
|
||||
cbs_public_key: 0469146F06BF3B01236E84632441E826
|
||||
#电子回单下载临时存放位置
|
||||
elec_path: /Users/xiangerlin/Downloads/
|
||||
OA:
|
||||
data_source_code: yc_oa
|
||||
zt:
|
||||
url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface
|
||||
|
||||
nifi:
|
||||
api:
|
||||
url: https://192.168.2.233:8443/nifi-api
|
||||
username: hzya
|
||||
password: hzya1314*nifi
|
|
@ -1,136 +0,0 @@
|
|||
package com.hzya.frame;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.joincreateprocessorandupdateparam.CreateProcessorAndUpdateParamJoin;
|
||||
import com.hzya.frame.nifiapi.model.joingetallcontrollerservice.Component19;
|
||||
import com.hzya.frame.nifiapi.model.joingetallcontrollerservice.ControllerServices19;
|
||||
import com.hzya.frame.nifiapi.model.resultNeedModifyController.PortFilterResult;
|
||||
import com.hzya.frame.nifiapi.model.resultprocessorsinfo.Component16;
|
||||
import com.hzya.frame.nifiapi.model.resultprocessorsinfo.Config16;
|
||||
import com.hzya.frame.nifiapi.operation.INifiAppOperation;
|
||||
import com.hzya.frame.nifiapi.operation.INifiBaseOperation;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame
|
||||
* @Project:fw-nifi
|
||||
* @name:TestINifiBaseOperation
|
||||
* @Date:2025/5/22 17:02
|
||||
* @Filename:TestINifiBaseOperation
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = {WebappApplication.class})
|
||||
public class TestINifiBaseOperation {
|
||||
|
||||
@Autowired
|
||||
private INifiBaseOperation iNifiBaseOperation;
|
||||
|
||||
@Autowired
|
||||
private INifiAppOperation iNifiAppOperation;
|
||||
|
||||
@Test
|
||||
public void testGetNeedModifyControllerServicesByProcessGroup() throws Exception {
|
||||
try {
|
||||
List<ControllerServices19> needModifyControllerServicesByProcessGroup = iNifiBaseOperation.getNeedModifyControllerServicesByProcessGroup("4143d803-0196-1000-968f-b06f55b43a3f");
|
||||
System.out.println(needModifyControllerServicesByProcessGroup.size());
|
||||
ControllerServices19 controllerServices19 = needModifyControllerServicesByProcessGroup.get(0);
|
||||
Component19 component = controllerServices19.getComponent();
|
||||
System.out.println(component.getName());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetNeedModifyControllerServicesByProcessGroup2() throws Exception {
|
||||
try {
|
||||
ControllerServices19 czfJwnb9sb = iNifiBaseOperation.getNeedModifyControllerServicesByProcessGroup("4143d803-0196-1000-968f-b06f55b43a3f", "CZFJwnb9sb");
|
||||
if (czfJwnb9sb != null && czfJwnb9sb.getComponent() != null) {
|
||||
Component19 component = czfJwnb9sb.getComponent();
|
||||
String name = component.getName();
|
||||
System.out.println(name);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetNeedModifyControllerRelationshipByProcessGroup() throws Exception {
|
||||
try {
|
||||
PortFilterResult needModifyControllerRelationshipByProcessGroup = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup("41437b87-0196-1000-6951-50e41e75c0da", "f5228bc8-0360-41eb-a640-9f4df953937c");
|
||||
System.out.println(needModifyControllerRelationshipByProcessGroup);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCopyProcessor() throws Exception {
|
||||
try {
|
||||
String targetProcessorId = "7f70897a-0196-1000-241a-3a7cdf5bf521";
|
||||
String parentProcessGroupId = "76e23100-ad84-1aab-4447-b9ee936ee7d5";
|
||||
String copyTargetProcessGroupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||
String s = iNifiBaseOperation.copyProcessor(targetProcessorId, parentProcessGroupId, copyTargetProcessGroupId);
|
||||
System.out.println("新处理器id:" + s);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateProcessorAndUpdateParam() {
|
||||
try {
|
||||
Map<String, String> properties = new HashMap<>();
|
||||
properties.put("File Size", "1B");
|
||||
properties.put("Batch Size", "2");
|
||||
properties.put("Data Format", "Binary");
|
||||
properties.put("Unique FlowFiles", "true");
|
||||
properties.put("character-set", "GBK");
|
||||
|
||||
Config16 config16 = new Config16();
|
||||
config16.setProperties(properties);
|
||||
|
||||
Component16 component16 = new Component16();
|
||||
component16.setName("修改处理器名称2");
|
||||
component16.setConfig(config16);
|
||||
|
||||
CreateProcessorAndUpdateParamJoin createProcessorAndUpdateParamJoin = new CreateProcessorAndUpdateParamJoin();
|
||||
createProcessorAndUpdateParamJoin.setComponent(component16);
|
||||
createProcessorAndUpdateParamJoin.setTargetProcessorId("7f70897a-0196-1000-241a-3a7cdf5bf521");
|
||||
createProcessorAndUpdateParamJoin.setCopyTargetProcessGroupId("76e23115-ad84-1aab-7630-21c76aa3973d");
|
||||
createProcessorAndUpdateParamJoin.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||
|
||||
String processorAndUpdateParam = iNifiAppOperation.createProcessorAndUpdateParam(createProcessorAndUpdateParamJoin);
|
||||
System.out.println("新处理器id:" + processorAndUpdateParam);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testgGetFindStateClearMarkProcessor() throws Exception {
|
||||
try {
|
||||
iNifiBaseOperation.getFindStateClearMarkProcessor("41437b87-0196-1000-6951-50e41e75c0da", "接口状态清理标记");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBatchEnabledControllerServices() throws Exception {
|
||||
try {
|
||||
iNifiBaseOperation.batchEnabledControllerServices("4143d803-0196-1000-968f-b06f55b43a3f", "xxxx");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,761 +0,0 @@
|
|||
package com.hzya.frame;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.joincreateconnections.Component18;
|
||||
import com.hzya.frame.nifiapi.model.joincreateconnections.CreateConnections18;
|
||||
import com.hzya.frame.nifiapi.model.joincreateconnections.Revision18;
|
||||
import com.hzya.frame.nifiapi.model.joincreateconnections.SourceOrDestination18;
|
||||
import com.hzya.frame.nifiapi.model.joincreateoracleapp.CreateAppInstanceJoin;
|
||||
import com.hzya.frame.nifiapi.model.joincreateprocessconnection.CreateProcessorConnections;
|
||||
import com.hzya.frame.nifiapi.model.joincreateprocessorandupdateparam.CreateProcessorAndUpdateParamJoin;
|
||||
import com.hzya.frame.nifiapi.model.joincreparamcontext.CreateParamContextJoin;
|
||||
import com.hzya.frame.nifiapi.model.joinfindneedmodifycontroller.FindNeedModifyController;
|
||||
import com.hzya.frame.nifiapi.model.joingetcontroller.Component12;
|
||||
import com.hzya.frame.nifiapi.model.joingetcontroller.ControllerService12;
|
||||
import com.hzya.frame.nifiapi.model.joinparametercontexts.*;
|
||||
import com.hzya.frame.nifiapi.model.joinprocessgroups.Component7;
|
||||
import com.hzya.frame.nifiapi.model.joinprocessgroups.ProcessGroupsJoin;
|
||||
import com.hzya.frame.nifiapi.model.joinprocessgroups.Revision5;
|
||||
import com.hzya.frame.nifiapi.model.joinsnippetinstance.SnippetInstanceJoin;
|
||||
import com.hzya.frame.nifiapi.model.joinsnippets.Snippet;
|
||||
import com.hzya.frame.nifiapi.model.joinsnippets.SnippetsJoin;
|
||||
import com.hzya.frame.nifiapi.model.joinstartorstopprocessgroup.Revision10;
|
||||
import com.hzya.frame.nifiapi.model.joinstartorstopprocessgroup.StartOrStopProcessGroupsInfoJoin10;
|
||||
import com.hzya.frame.nifiapi.model.resultNeedModifyController.PortFilterResult;
|
||||
import com.hzya.frame.nifiapi.model.resultcreateoracleapp.CreateAppInstanceResult;
|
||||
import com.hzya.frame.nifiapi.model.resultcreateprocessor.*;
|
||||
import com.hzya.frame.nifiapi.model.resultcreateprocessors.CreateProcess16;
|
||||
import com.hzya.frame.nifiapi.model.resultcreatesnippet.Flow15;
|
||||
import com.hzya.frame.nifiapi.model.resultcreatesnippet.ProcessGroups15;
|
||||
import com.hzya.frame.nifiapi.model.resultcreatesnippet.SnippetInstance15;
|
||||
import com.hzya.frame.nifiapi.model.resultprocessgroups.ProcessgroupsResult;
|
||||
import com.hzya.frame.nifiapi.model.resultprocessgroupsinfo.ProcessGroupsInfoResult9;
|
||||
import com.hzya.frame.nifiapi.model.resultprocessgroupsinfo.Revision9;
|
||||
import com.hzya.frame.nifiapi.model.resultsnippets.Snippet13;
|
||||
import com.hzya.frame.nifiapi.model.resultsnippets.SnippetResult13;
|
||||
import com.hzya.frame.nifiapi.operation.INifiAppOperation;
|
||||
import com.hzya.frame.nifiapi.operation.INifiBaseOperation;
|
||||
import com.hzya.frame.nifiapi.service.NifiApiService;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame
|
||||
* @Project:fw-nifi
|
||||
* @name:TestNifiDbSync
|
||||
* @Date:2025/5/20 17:49
|
||||
* @Filename:TestNifiDbSync
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = {WebappApplication.class})
|
||||
public class TestNifiDbSync {
|
||||
|
||||
@Autowired
|
||||
private NifiApiService nifiApiService;
|
||||
|
||||
@Autowired
|
||||
private INifiAppOperation nifiOperation;
|
||||
|
||||
@Autowired
|
||||
private INifiBaseOperation iNifiBaseOperation;
|
||||
|
||||
/**
|
||||
* 测试nifi数据同步场景调用
|
||||
*/
|
||||
@Test
|
||||
public void testDbSync2() throws Exception {
|
||||
//创建业务数据流对应的流程组
|
||||
String parentProcessGroupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||
String processGroupsName = "Oracle19c->Mysql跨数据源同步";
|
||||
String newProcessGroupsId = testCreateProcessGroups(parentProcessGroupId, processGroupsName);
|
||||
|
||||
//新建GenerateFlowFile处理器(开始的处理器)
|
||||
// String generateFlowFileId = testCreateProcessor(newProcessGroupsId);
|
||||
CreateProcessorAndUpdateParamJoin createProcessorAndUpdateParamJoin = new CreateProcessorAndUpdateParamJoin();
|
||||
createProcessorAndUpdateParamJoin.setTargetProcessorId("02d23f3c-7003-1a1b-1cdc-e9f37874bd78");
|
||||
createProcessorAndUpdateParamJoin.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||
createProcessorAndUpdateParamJoin.setCopyTargetProcessGroupId(newProcessGroupsId);
|
||||
String generateFlowFileId = nifiOperation.createProcessorAndUpdateParam(createProcessorAndUpdateParamJoin);
|
||||
|
||||
//创建Oracle应用
|
||||
//初始化实例
|
||||
CreateAppInstanceJoin createOracleApp = new CreateAppInstanceJoin();
|
||||
createOracleApp.setAppProcessGroupId("41437b87-0196-1000-6951-50e41e75c0da");
|
||||
createOracleApp.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||
createOracleApp.setCopyTargetProcessGroupId(newProcessGroupsId);
|
||||
//上下文
|
||||
CreateParamContextJoin createParamContextJoin = setOracleParamContextJoin();
|
||||
createOracleApp.setCreateParamContextJoin(createParamContextJoin);
|
||||
//控制器
|
||||
// FindNeedModifyController findNeedModifyController = setOracleFindNeedModifyController(newProcessGroupsId);
|
||||
// createOracleApp.setFindNeedModifyController(findNeedModifyController);
|
||||
CreateAppInstanceResult oracleAppContext = nifiOperation.createAppContext(createOracleApp);
|
||||
|
||||
//创建Mysql应用
|
||||
//初始化实例
|
||||
CreateAppInstanceJoin createOracleApp2 = new CreateAppInstanceJoin();
|
||||
createOracleApp2.setAppProcessGroupId("4143d803-0196-1000-968f-b06f55b43a3f");
|
||||
createOracleApp2.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||
createOracleApp2.setCopyTargetProcessGroupId(newProcessGroupsId);
|
||||
//上下文
|
||||
CreateParamContextJoin createParamContextJoin2 = setMysqlParamContextJoin(newProcessGroupsId);
|
||||
createOracleApp2.setCreateParamContextJoin(createParamContextJoin2);
|
||||
//控制器
|
||||
// FindNeedModifyController findNeedModifyController2 = setMysqlFindNeedModifyController(newProcessGroupsId);
|
||||
// createOracleApp2.setFindNeedModifyController(findNeedModifyController2);
|
||||
CreateAppInstanceResult mysqlAppContext = nifiOperation.createAppContext(createOracleApp2);
|
||||
|
||||
//新建LogAttribute处理器(结束处理器)
|
||||
// String logAttributeId = testCreateProcessor2();
|
||||
// String logAttributeId = null;
|
||||
CreateProcessorAndUpdateParamJoin createProcessorAndUpdateParamJoin2 = new CreateProcessorAndUpdateParamJoin();
|
||||
createProcessorAndUpdateParamJoin2.setTargetProcessorId("7f70897a-0196-1000-241a-3a7cdf5bf521");
|
||||
createProcessorAndUpdateParamJoin2.setParentProcessGroupId("76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||
createProcessorAndUpdateParamJoin2.setCopyTargetProcessGroupId(newProcessGroupsId);
|
||||
String logAttributeId = nifiOperation.createProcessorAndUpdateParam(createProcessorAndUpdateParamJoin2);
|
||||
|
||||
//查找对应应用的连接标记
|
||||
//TYPE=INPUT_PORT
|
||||
PortFilterResult oracleMarkInput = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(oracleAppContext.getNewProcessGroupId(), "f5228bc8-0360-41eb-a640-9f4df953937c");
|
||||
PortFilterResult oracleMarkOutPut = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(oracleAppContext.getNewProcessGroupId(), "4929a9ac-291a-4ea2-a4b1-286ddf47164a");
|
||||
//TYPE=OUTPUT_PORT
|
||||
PortFilterResult mysqlMarkInput = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(mysqlAppContext.getNewProcessGroupId(), "be05a6ad-a440-43ed-b4c0-d1edcf03334f");
|
||||
PortFilterResult mysqlMarkOutput = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(mysqlAppContext.getNewProcessGroupId(), "7ac85368-f2c9-48df-ab5b-ea610449083d");
|
||||
//查找Mysql应用的输入端口
|
||||
PortFilterResult automaticTableCreation = iNifiBaseOperation.getNeedModifyControllerRelationshipByProcessGroup(mysqlAppContext.getNewProcessGroupId(), "9480f217-9d94-4dcd-ba80-f718cc6e59db");
|
||||
|
||||
//批量创建连接关系
|
||||
//连接关系一:开始处理器->Oracle应用
|
||||
SourceOrDestination18 source = new SourceOrDestination18();
|
||||
source.setId(generateFlowFileId);
|
||||
source.setGroupId(newProcessGroupsId);
|
||||
source.setType("PROCESSOR");
|
||||
|
||||
SourceOrDestination18 destination = new SourceOrDestination18();
|
||||
destination.setId(oracleMarkInput.getInputPorts().get(0).getId());
|
||||
destination.setGroupId(oracleAppContext.getNewProcessGroupId());
|
||||
destination.setType("INPUT_PORT");
|
||||
|
||||
List<String> selectedRelationships = new ArrayList<>();
|
||||
selectedRelationships.add("success");
|
||||
|
||||
Component18 component18 = new Component18();
|
||||
component18.setSource(source);
|
||||
component18.setDestination(destination);
|
||||
component18.setSelectedRelationships(selectedRelationships);
|
||||
|
||||
Revision18 revision18 = new Revision18();
|
||||
revision18.setVersion("0");//默认传递0
|
||||
|
||||
CreateConnections18 createConnections17 = new CreateConnections18();
|
||||
createConnections17.setComponent(component18);
|
||||
createConnections17.setRevision(revision18);
|
||||
|
||||
List<CreateConnections18> createConnections18List = new ArrayList<>();
|
||||
createConnections18List.add(createConnections17);
|
||||
|
||||
//连接关系二:Oracle应用->Mysql应用
|
||||
SourceOrDestination18 source2 = new SourceOrDestination18();
|
||||
source2.setId(oracleMarkOutPut.getOutputPorts().get(0).getId());
|
||||
source2.setGroupId(oracleAppContext.getNewProcessGroupId());
|
||||
source2.setType("OUTPUT_PORT");
|
||||
|
||||
SourceOrDestination18 destination2 = new SourceOrDestination18();
|
||||
destination2.setId(mysqlMarkInput.getInputPorts().get(0).getId());
|
||||
destination2.setGroupId(mysqlAppContext.getNewProcessGroupId());
|
||||
destination2.setType("INPUT_PORT");
|
||||
|
||||
// List<String> selectedRelationships2 = new ArrayList<>();
|
||||
// selectedRelationships2.add("success");
|
||||
|
||||
Component18 component182 = new Component18();
|
||||
component182.setSource(source2);
|
||||
component182.setDestination(destination2);
|
||||
// component182.setSelectedRelationships(selectedRelationships2);
|
||||
|
||||
Revision18 revision182 = new Revision18();
|
||||
revision182.setVersion("0");//默认传递0
|
||||
|
||||
CreateConnections18 createConnections172 = new CreateConnections18();
|
||||
createConnections172.setComponent(component182);
|
||||
createConnections172.setRevision(revision182);
|
||||
createConnections18List.add(createConnections172);
|
||||
|
||||
//连接关系三:Mysql应用->结束处理器
|
||||
SourceOrDestination18 source3 = new SourceOrDestination18();
|
||||
source3.setId(mysqlMarkOutput.getOutputPorts().get(0).getId());
|
||||
source3.setGroupId(mysqlAppContext.getNewProcessGroupId());
|
||||
source3.setType("OUTPUT_PORT");
|
||||
|
||||
SourceOrDestination18 destination3 = new SourceOrDestination18();
|
||||
destination3.setId(logAttributeId);
|
||||
destination3.setGroupId(newProcessGroupsId);
|
||||
destination3.setType("PROCESSOR");
|
||||
|
||||
// List<String> selectedRelationships3 = new ArrayList<>();
|
||||
// selectedRelationships3.add("success");
|
||||
|
||||
Component18 component183 = new Component18();
|
||||
component183.setSource(source3);
|
||||
component183.setDestination(destination3);
|
||||
// component183.setSelectedRelationships(selectedRelationships3);
|
||||
|
||||
Revision18 revision183 = new Revision18();
|
||||
revision183.setVersion("0");//默认传递0
|
||||
|
||||
CreateConnections18 createConnections173 = new CreateConnections18();
|
||||
createConnections173.setComponent(component183);
|
||||
createConnections173.setRevision(revision183);
|
||||
createConnections18List.add(createConnections173);
|
||||
|
||||
//连接关系四:如果存在自动建表,则需要从开始节点-连接到Mysql应用的"自动建表"的输入端口
|
||||
List<String> selectedRelationships2 = new ArrayList<>();
|
||||
selectedRelationships2.add("success");
|
||||
|
||||
SourceOrDestination18 source4 = new SourceOrDestination18();
|
||||
source4.setId(generateFlowFileId);
|
||||
source4.setGroupId(newProcessGroupsId);
|
||||
source4.setType("PROCESSOR");
|
||||
|
||||
SourceOrDestination18 destination4 = new SourceOrDestination18();
|
||||
destination4.setId(automaticTableCreation.getInputPorts().get(0).getId());
|
||||
destination4.setGroupId(mysqlAppContext.getNewProcessGroupId());
|
||||
destination4.setType("INPUT_PORT");
|
||||
|
||||
Component18 component184 = new Component18();
|
||||
component184.setSource(source4);
|
||||
component184.setDestination(destination4);
|
||||
component184.setSelectedRelationships(selectedRelationships2);
|
||||
|
||||
Revision18 revision184 = new Revision18();
|
||||
revision184.setVersion("0");//默认传递0
|
||||
|
||||
CreateConnections18 createConnections174 = new CreateConnections18();
|
||||
createConnections174.setComponent(component184);
|
||||
createConnections174.setRevision(revision184);
|
||||
createConnections18List.add(createConnections174);
|
||||
|
||||
CreateProcessorConnections createProcessorConnections = new CreateProcessorConnections();
|
||||
createProcessorConnections.setProcessGroupsId(newProcessGroupsId);
|
||||
createProcessorConnections.setCreateConnections18(createConnections18List);
|
||||
iNifiBaseOperation.batchCreateProcessorConnections(createProcessorConnections);
|
||||
|
||||
//去掉流程组内对应的处理器旧状态
|
||||
// List<String> stringList = new ArrayList<>();
|
||||
// stringList.add(oracleAppContext.getNewProcessGroupId());
|
||||
// stringList.add(mysqlAppContext.getNewProcessGroupId());
|
||||
// iNifiBaseOperation.clearProcessGroupState(stringList);
|
||||
|
||||
//启动业务处理器
|
||||
ProcessGroupsInfoResult9 processGroups = nifiApiService.getProcessGroups(newProcessGroupsId);
|
||||
Revision9 revision = processGroups.getRevision();
|
||||
|
||||
Revision10 revision10 = new Revision10();
|
||||
revision10.setVersion(revision.getVersion());
|
||||
|
||||
StartOrStopProcessGroupsInfoJoin10 startOrStopProcessGroupsInfoJoin10 = new StartOrStopProcessGroupsInfoJoin10();
|
||||
startOrStopProcessGroupsInfoJoin10.setId(processGroups.getId());
|
||||
startOrStopProcessGroupsInfoJoin10.setState("RUNNING");
|
||||
startOrStopProcessGroupsInfoJoin10.setRevision(revision10);
|
||||
ProcessGroupsInfoResult9 processGroupsInfoResult9 = nifiApiService.startOrStopProcessGroups(startOrStopProcessGroupsInfoJoin10);
|
||||
System.out.println("流程组id:" + processGroupsInfoResult9.getId());
|
||||
}
|
||||
|
||||
|
||||
public CreateParamContextJoin setOracleParamContextJoin() throws Exception {
|
||||
Revision revision = new Revision();
|
||||
revision.setVersion(0);
|
||||
|
||||
Parameter2 parameter = new Parameter2();
|
||||
parameter.setSensitive(false);
|
||||
parameter.setName("additionalWhereClause");
|
||||
parameter.setValue("1=1");
|
||||
parameter.setDescription("where条件");
|
||||
|
||||
Parameter2 parameter2 = new Parameter2();
|
||||
parameter2.setSensitive(false);
|
||||
parameter2.setName("columnsToReturn");
|
||||
parameter2.setValue("csaleid,vreceiptcode,ts");
|
||||
parameter2.setDescription("需要查询的表字段");
|
||||
|
||||
Parameter2 parameter3 = new Parameter2();
|
||||
parameter3.setSensitive(false);
|
||||
parameter3.setName("customOrderByColumn");
|
||||
parameter3.setValue("ts,csaleid asc");
|
||||
parameter3.setDescription("排序规则,如果有增量同步需求,一定要通过时间+主键");
|
||||
|
||||
Parameter2 parameter4 = new Parameter2();
|
||||
parameter4.setSensitive(false);
|
||||
parameter4.setName("maximumValueColumns");
|
||||
parameter4.setValue("ts");
|
||||
parameter4.setDescription("分片字段");
|
||||
|
||||
Parameter2 parameter5 = new Parameter2();
|
||||
parameter5.setSensitive(false);
|
||||
parameter5.setName("sourceTbName");
|
||||
parameter5.setValue("U8C241231.SO_SALE");
|
||||
parameter5.setDescription("查询表名称");
|
||||
|
||||
Parameters2 parameters = new Parameters2();
|
||||
parameters.setParameter(parameter);
|
||||
|
||||
Parameters2 parameters2 = new Parameters2();
|
||||
parameters2.setParameter(parameter2);
|
||||
|
||||
Parameters2 parameters3 = new Parameters2();
|
||||
parameters3.setParameter(parameter3);
|
||||
|
||||
Parameters2 parameters4 = new Parameters2();
|
||||
parameters4.setParameter(parameter4);
|
||||
|
||||
Parameters2 parameters5 = new Parameters2();
|
||||
parameters5.setParameter(parameter5);
|
||||
|
||||
List<Parameters2> parametersList = new ArrayList<>();
|
||||
parametersList.add(parameters);
|
||||
parametersList.add(parameters2);
|
||||
parametersList.add(parameters3);
|
||||
parametersList.add(parameters4);
|
||||
parametersList.add(parameters5);
|
||||
|
||||
Component3 component = new Component3();
|
||||
component.setName("oracle参数环境" + createParamTime());
|
||||
component.setParameters(parametersList);
|
||||
|
||||
ParameterContextsJoin parameterContextsJoin = new ParameterContextsJoin();
|
||||
parameterContextsJoin.setComponent(component);
|
||||
parameterContextsJoin.setRevision(revision);
|
||||
|
||||
CreateParamContextJoin createParamContextJoin = new CreateParamContextJoin();
|
||||
createParamContextJoin.setParameterContextsJoin(parameterContextsJoin);
|
||||
// createParamContextJoin.setProcessGroupsId(processGroupsId);
|
||||
return createParamContextJoin;
|
||||
}
|
||||
|
||||
public static String createParamTime() {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyMMddHHmm");
|
||||
String formattedTime = now.format(formatter);
|
||||
return formattedTime;
|
||||
}
|
||||
|
||||
public CreateParamContextJoin setMysqlParamContextJoin(String processGroupsId) throws Exception {
|
||||
Revision revision = new Revision();
|
||||
revision.setVersion(0);
|
||||
|
||||
// Parameter2 parameter = new Parameter2();
|
||||
// parameter.setSensitive(false);
|
||||
// parameter.setName("Release Signal Identifier");
|
||||
// parameter.setValue("table_creation");
|
||||
// parameter.setDescription("参数描述");
|
||||
|
||||
// Parameter2 parameter2 = new Parameter2();
|
||||
// parameter2.setSensitive(false);
|
||||
// parameter2.setName("autoTableCreation");
|
||||
// parameter2.setValue("Y");
|
||||
// parameter2.setDescription("是否自动建表");
|
||||
|
||||
Parameter2 parameter3 = new Parameter2();
|
||||
parameter3.setSensitive(false);
|
||||
parameter3.setName("mappingRelationship");
|
||||
parameter3.setValue("[\n" + " {\n" + " \"targetTbName\": \"iep_so_sale\",\n" + " \"targetDBType\": \"mysql8.0.44\",\n" + " \"writeType\": \"1\",\n" + " \"fieldRelationship\": [\n" + " {\n" + " \"sourceFieldName\": \"csaleid\",\n" + " \"sourceFieldType\": \"varchar2(30)\",\n" + " \"targetFieldName\": \"csaleid\",\n" + " \"targetFieldType\": \"varchar(100)\",\n" + " \"targetFieldNameNotes\": \"主键\",\n" + " \"primaryKey\": \"Y\"\n" + " },\n" + " {\n" + " \"sourceFieldName\": \"vreceiptcode\",\n" + " \"sourceFieldType\": \"varchar2(30)\",\n" + " \"targetFieldName\": \"vreceiptcode\",\n" + " \"targetFieldType\": \"varchar(100)\",\n" + " \"targetFieldNameNotes\": \"编码\"\n" + " },\n" + " {\n" + " \"sourceFieldName\": \"ts\",\n" + " \"sourceFieldType\": \"varchar2(30)\",\n" + " \"targetFieldName\": \"ts\",\n" + " \"targetFieldType\": \"varchar(100)\",\n" + " \"targetFieldNameNotes\": \"更新时间\"\n" + " }\n" + " ]\n" + " }\n" + "]");
|
||||
parameter3.setDescription("字段映射关系");
|
||||
|
||||
// Parameter2 parameter4 = new Parameter2();
|
||||
// parameter4.setSensitive(false);
|
||||
// parameter4.setName("releaseSignalIdentifier");
|
||||
// parameter4.setValue(UUID.randomUUID().toString());
|
||||
// parameter4.setDescription("建表信号,传随机值!");
|
||||
|
||||
// Parameter2 parameter4 = new Parameter2();
|
||||
// parameter4.setSensitive(false);
|
||||
// parameter4.setName("maximumValueColumns");
|
||||
// parameter4.setValue("ts");
|
||||
// parameter4.setDescription("参数描述");
|
||||
|
||||
// Parameter2 parameter5 = new Parameter2();
|
||||
// parameter5.setSensitive(false);
|
||||
// parameter5.setName("sourceTbName");
|
||||
// parameter5.setValue("U8C241231.SO_SALE");
|
||||
// parameter5.setDescription("参数描述");
|
||||
|
||||
// Parameters2 parameters = new Parameters2();
|
||||
// parameters.setParameter(parameter4);
|
||||
|
||||
// Parameters2 parameters2 = new Parameters2();
|
||||
// parameters2.setParameter(parameter2);
|
||||
|
||||
Parameters2 parameters3 = new Parameters2();
|
||||
parameters3.setParameter(parameter3);
|
||||
|
||||
// Parameters2 parameters4 = new Parameters2();
|
||||
// parameters4.setParameter(parameter4);
|
||||
|
||||
// Parameters2 parameters5 = new Parameters2();
|
||||
// parameters5.setParameter(parameter5);
|
||||
|
||||
List<Parameters2> parametersList = new ArrayList<>();
|
||||
// parametersList.add(parameters);
|
||||
// parametersList.add(parameters2);
|
||||
parametersList.add(parameters3);
|
||||
// parametersList.add(parameters4);
|
||||
// parametersList.add(parameters5);
|
||||
|
||||
Component3 component = new Component3();
|
||||
component.setName("mysql参数环境" + createParamTime());
|
||||
component.setParameters(parametersList);
|
||||
|
||||
ParameterContextsJoin parameterContextsJoin = new ParameterContextsJoin();
|
||||
parameterContextsJoin.setComponent(component);
|
||||
parameterContextsJoin.setRevision(revision);
|
||||
|
||||
CreateParamContextJoin createParamContextJoin = new CreateParamContextJoin();
|
||||
createParamContextJoin.setParameterContextsJoin(parameterContextsJoin);
|
||||
createParamContextJoin.setProcessGroupsId(processGroupsId);
|
||||
return createParamContextJoin;
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制器参数-oracle
|
||||
*/
|
||||
private FindNeedModifyController setOracleFindNeedModifyController(String processGroupId) {
|
||||
//创建Mysql数据源
|
||||
Map<String, String> properties = new HashMap<>();
|
||||
properties.put("Database Connection URL", "jdbc:oracle:thin:@39.170.109.90:1521:orcl");
|
||||
properties.put("Database Driver Class Name", "oracle.jdbc.OracleDriver");
|
||||
properties.put("database-driver-locations", "/data/nifi-1.28.1/lib/ojdbc8.jar");
|
||||
properties.put("Database User", "U8C241231");
|
||||
properties.put("Password", "U8C241231");
|
||||
properties.put("Max Wait Time", "600001 millis");
|
||||
properties.put("Max Total Connections", "20");
|
||||
properties.put("Validation-query", "select 1 from dual");
|
||||
properties.put("dbcp-min-idle-conns", "5");
|
||||
properties.put("dbcp-max-idle-conns", "10");
|
||||
properties.put("dbcp-max-conn-lifetime", "-1");
|
||||
properties.put("dbcp-time-between-eviction-runs", "-1");
|
||||
properties.put("dbcp-min-evictable-idle-time", "30 mins");
|
||||
properties.put("dbcp-soft-min-evictable-idle-time", "-1");
|
||||
|
||||
Component12 component12 = new Component12();
|
||||
component12.setName("Oracle数据源");
|
||||
component12.setType("org.apache.nifi.dbcp.DBCPConnectionPool");
|
||||
//传这个值并没有用
|
||||
// component12.setState("ENABLED");
|
||||
component12.setProperties(properties);
|
||||
component12.setComments("Oracle数据源备注");
|
||||
component12.setBulletinLevel("DEBUG");
|
||||
// component12.setId();//需要修改的控制器id
|
||||
|
||||
ControllerService12 controllerService11 = new ControllerService12();
|
||||
controllerService11.setComponent(component12);
|
||||
controllerService11.setModifyMarkId("vuBXdbEu7v");
|
||||
// controllerService11.setId();//需要修改的控制器id
|
||||
|
||||
List<ControllerService12> controllerService12List = new ArrayList<>();
|
||||
controllerService12List.add(controllerService11);
|
||||
|
||||
FindNeedModifyController findNeedModifyController = new FindNeedModifyController();
|
||||
findNeedModifyController.setNeedModifyController(controllerService12List);
|
||||
findNeedModifyController.setProcessGroupId(processGroupId);
|
||||
return findNeedModifyController;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 控制器参数-oracle
|
||||
*/
|
||||
private FindNeedModifyController setMysqlFindNeedModifyController(String processGroupId) {
|
||||
//创建Mysql数据源
|
||||
Map<String, String> properties = new HashMap<>();
|
||||
properties.put("Database Connection URL", "jdbc:mysql://ufidahz.com.cn:9015/apache_nifi_sync?useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8&useLegacyDatetimeCode=false");
|
||||
properties.put("Database Driver Class Name", "com.mysql.cj.jdbc.Driver");
|
||||
properties.put("database-driver-locations", "/data/nifi-1.28.1/lib/mysql-connector-java-8.0.30.jar");
|
||||
properties.put("Database User", "root");
|
||||
properties.put("Password", "hzya1314");
|
||||
properties.put("Max Wait Time", "600001 millis");
|
||||
properties.put("Max Total Connections", "15");
|
||||
properties.put("Validation-query", "select 1");
|
||||
properties.put("dbcp-min-idle-conns", "5");
|
||||
properties.put("dbcp-max-idle-conns", "10");
|
||||
properties.put("dbcp-max-conn-lifetime", "-1");
|
||||
properties.put("dbcp-time-between-eviction-runs", "-1");
|
||||
properties.put("dbcp-min-evictable-idle-time", "30 mins");
|
||||
properties.put("dbcp-soft-min-evictable-idle-time", "-1");
|
||||
|
||||
Component12 component12 = new Component12();
|
||||
component12.setName("Mysql数据源");
|
||||
component12.setType("org.apache.nifi.dbcp.DBCPConnectionPool");
|
||||
//传这个值并没有用
|
||||
// component12.setState("ENABLED");
|
||||
component12.setProperties(properties);
|
||||
component12.setComments("Mysql数据源备注");
|
||||
component12.setBulletinLevel("DEBUG");
|
||||
// component12.setId();//需要修改的控制器id
|
||||
|
||||
ControllerService12 controllerService11 = new ControllerService12();
|
||||
controllerService11.setComponent(component12);
|
||||
controllerService11.setModifyMarkId("CZFJwnb9sb");
|
||||
// controllerService11.setId();//需要修改的控制器id
|
||||
|
||||
List<ControllerService12> controllerService12List = new ArrayList<>();
|
||||
controllerService12List.add(controllerService11);
|
||||
|
||||
FindNeedModifyController findNeedModifyController = new FindNeedModifyController();
|
||||
findNeedModifyController.setNeedModifyController(controllerService12List);
|
||||
findNeedModifyController.setProcessGroupId(processGroupId);
|
||||
return findNeedModifyController;
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试nifi数据同步场景调用
|
||||
*/
|
||||
@Test
|
||||
public void testDbSync() throws Exception {
|
||||
//新建「开始」处理器
|
||||
String parentProcessGroupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||
String processGroupsName = "跨数据源同步";
|
||||
String processGroupsId = testCreateProcessGroups(parentProcessGroupId, processGroupsName);
|
||||
|
||||
//新建GenerateFlowFile处理器(最开始的处理器)
|
||||
String generateFlowFileId = testCreateProcessor(processGroupsId);
|
||||
|
||||
//拷贝Oracle应用,并实例化到新建的流程组
|
||||
// String processGroupId = "41437b87-0196-1000-6951-50e41e75c0da";
|
||||
// String parentProcessGroupId = "76e23100-ad84-1aab-4447-b9ee936ee7d5";
|
||||
String oracleSnippetId = testCreateSnippets("41437b87-0196-1000-6951-50e41e75c0da", "76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||
String oracleProcessGroupId = testCreateSnippetInstance(processGroupsId, parentProcessGroupId, oracleSnippetId);
|
||||
|
||||
//拷贝Mysql应用,并实例化到新建的流程组
|
||||
// String processGroupId2 = "4143d803-0196-1000-968f-b06f55b43a3f";
|
||||
// String parentProcessGroupId2 = "76e23100-ad84-1aab-4447-b9ee936ee7d5";
|
||||
String mysqlSnippetId = testCreateSnippets("4143d803-0196-1000-968f-b06f55b43a3f", "76e23100-ad84-1aab-4447-b9ee936ee7d5");
|
||||
String mysqlProcessGroupId = testCreateSnippetInstance(processGroupsId, parentProcessGroupId, mysqlSnippetId);
|
||||
|
||||
//新建LogAttribute处理器(结束处理器)
|
||||
// String logAttributeId = testCreateProcessor2();
|
||||
String logAttributeId = null;
|
||||
|
||||
//修改Oracle应用数据源
|
||||
//修改Oracle应用上下文环境
|
||||
//修改mysql应用数据源
|
||||
//修改mysql应用上下文环境
|
||||
//启动Mysql应用对应的控制器服务
|
||||
//启动Oracle应用对应的控制器服务
|
||||
//创建连接关系
|
||||
//启动处理器
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建空的流程组
|
||||
*
|
||||
* @param parentProcessGroupId 需要新建的目标流程组的父流程组id
|
||||
* @param name 目标流程组名称
|
||||
*/
|
||||
public String testCreateProcessGroups(String parentProcessGroupId, String name) throws Exception {
|
||||
String processGroupsId = "";
|
||||
try {
|
||||
Revision5 revision5 = new Revision5();
|
||||
revision5.setVersion(0);
|
||||
|
||||
Component7 component7 = new Component7();
|
||||
component7.setName(name);
|
||||
|
||||
ProcessGroupsJoin processGroupsJoin = new ProcessGroupsJoin();
|
||||
processGroupsJoin.setRevision(revision5);
|
||||
processGroupsJoin.setComponent(component7);
|
||||
|
||||
//父处理器组
|
||||
// String parentGroupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||
ProcessgroupsResult processGroups = nifiApiService.createProcessGroups(parentProcessGroupId, processGroupsJoin);
|
||||
processGroupsId = processGroups.getId();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return processGroupsId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建GenerateFlowFile处理器
|
||||
*/
|
||||
public String testCreateProcessor(String groupId) {
|
||||
String processId = null;
|
||||
try {
|
||||
Revision15 revision15 = new Revision15();
|
||||
revision15.setVersion("0");
|
||||
|
||||
Component15 component15 = new Component15();
|
||||
component15.setType("org.apache.nifi.processors.standard.GenerateFlowFile");
|
||||
component15.setName("定时调度");
|
||||
|
||||
// Position15 position15 = new Position15();
|
||||
// position15.setX("0");
|
||||
// position15.setY("0");
|
||||
|
||||
Config15 config15 = new Config15();
|
||||
config15.setSchedulingPeriod("1 min");
|
||||
|
||||
Properties15 properties15 = new Properties15();
|
||||
properties15.setFileSize("1KB");
|
||||
|
||||
config15.setProperties(properties15);
|
||||
|
||||
component15.setConfig(config15);
|
||||
|
||||
CreateProcessorJoin15 createProcessorJoin15 = new CreateProcessorJoin15();
|
||||
createProcessorJoin15.setComponent(component15);
|
||||
createProcessorJoin15.setRevision(revision15);
|
||||
|
||||
// String groupId = "019610d1-f933-1f70-16ea-3cf005012c4b";
|
||||
CreateProcess16 processor = nifiApiService.createProcessor(groupId, createProcessorJoin15);
|
||||
processId = processor.getId();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return processId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 为指定流程组创建片段
|
||||
*
|
||||
* @param targetCopyProcessGroupId 需要复制的目标流程组id
|
||||
* @param parentProcessGroupId 目标流程组的父流程组id
|
||||
*/
|
||||
public String testCreateSnippets(String targetCopyProcessGroupId, String parentProcessGroupId) {
|
||||
String snippetId = null;
|
||||
try {
|
||||
//查询目标流程组版本
|
||||
ProcessGroupsInfoResult9 processGroups = nifiApiService.getProcessGroups(targetCopyProcessGroupId);
|
||||
Revision9 revision = processGroups.getRevision();
|
||||
|
||||
Map<String, String> processGroupsMap2 = new HashMap<>();
|
||||
processGroupsMap2.put("version", revision.getVersion());//目标流程组版本号
|
||||
|
||||
Map<String, Map<String, String>> processGroupsMap = new HashMap<>();
|
||||
processGroupsMap.put(targetCopyProcessGroupId, processGroupsMap2);//目标流程组id
|
||||
|
||||
Snippet snippet = new Snippet();
|
||||
snippet.setParentGroupId(parentProcessGroupId);//目标流程组id的父流程组id
|
||||
snippet.setProcessGroups(processGroupsMap);
|
||||
|
||||
SnippetsJoin snippetsJoin = new SnippetsJoin();
|
||||
snippetsJoin.setSnippet(snippet);
|
||||
SnippetResult13 snippets = nifiApiService.createSnippets(snippetsJoin);
|
||||
Snippet13 snippet1 = snippets.getSnippet();
|
||||
snippetId = snippet1.getId();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return snippetId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建LogAttribute处理器
|
||||
*/
|
||||
@Test
|
||||
public void testCreateProcessor2() throws Exception {
|
||||
// String processorId = null;
|
||||
try {
|
||||
Revision15 revision15 = new Revision15();
|
||||
revision15.setVersion("0");
|
||||
|
||||
Component15 component15 = new Component15();
|
||||
component15.setType("org.apache.nifi.processors.standard.LogAttribute");
|
||||
component15.setName("结束节点");
|
||||
|
||||
// Position15 position15 = new Position15();
|
||||
// position15.setX("0");
|
||||
// position15.setY("0");
|
||||
|
||||
Properties15 properties15 = new Properties15();
|
||||
properties15.setLogLevel("info");
|
||||
properties15.setLogPayload("false");
|
||||
properties15.setAttributesToLogRegex(".*");
|
||||
properties15.setLogFlowFileProperties("true");
|
||||
properties15.setOutputFormat("Line per Attribute");
|
||||
properties15.setCharacterSet("UTF-8");
|
||||
|
||||
Config15 config15 = new Config15();
|
||||
config15.setProperties(properties15);
|
||||
config15.setBulletinLevel("DEBUG");
|
||||
|
||||
component15.setConfig(config15);
|
||||
// component15.setPosition(position15);
|
||||
|
||||
//定义连接关系
|
||||
Relationships15 relationships15 = new Relationships15();
|
||||
relationships15.setName("success");
|
||||
relationships15.setAutoTerminate(true);
|
||||
// relationships15.setRetry(true);
|
||||
// relationships15.setDescription("123");
|
||||
List<Relationships15> relationships15List = new ArrayList<>();
|
||||
relationships15List.add(relationships15);
|
||||
component15.setRelationships(relationships15List);
|
||||
|
||||
CreateProcessorJoin15 createProcessorJoin15 = new CreateProcessorJoin15();
|
||||
createProcessorJoin15.setComponent(component15);
|
||||
createProcessorJoin15.setRevision(revision15);
|
||||
|
||||
String groupId = "76e23115-ad84-1aab-7630-21c76aa3973d";
|
||||
CreateProcess16 processor = nifiApiService.createProcessor(groupId, createProcessorJoin15);
|
||||
// System.out.println("处理器id:" + processor.getId());
|
||||
// processorId = processor.getId();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// return processorId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将片段实例到指定位置
|
||||
*
|
||||
* @param groupId 目标流程组id(需要拷贝到哪个流程组)
|
||||
* @param parentGroupId 目标流程组的父流程组id()
|
||||
* @param snippetId 片段id
|
||||
*/
|
||||
public String testCreateSnippetInstance(String groupId, String parentGroupId, String snippetId) throws Exception {
|
||||
String processGroupId = null;
|
||||
try {
|
||||
//先请求得到代码片段id
|
||||
ProcessGroupsInfoResult9 processGroups = nifiApiService.getProcessGroups(groupId);
|
||||
Revision9 revision = processGroups.getRevision();
|
||||
|
||||
Map<String, String> processGroupsMap2 = new HashMap<>();
|
||||
processGroupsMap2.put("version", revision.getVersion());//目标流程组版本号
|
||||
|
||||
Map<String, Map<String, String>> processGroupsMap = new HashMap<>();
|
||||
processGroupsMap.put(groupId, processGroupsMap2);//目标流程组id
|
||||
|
||||
// Snippet snippet = new Snippet();
|
||||
// snippet.setParentGroupId(parentGroupId);//目标流程组id的父流程组id
|
||||
// snippet.setProcessGroups(processGroupsMap);
|
||||
|
||||
// SnippetsJoin snippetsJoin = new SnippetsJoin();
|
||||
// snippetsJoin.setSnippet(snippet);
|
||||
// SnippetResult13 snippets = nifiApiService.createSnippets(snippetsJoin);
|
||||
// Snippet13 snippet1 = snippets.getSnippet();
|
||||
// System.out.println(snippet1.getId());
|
||||
|
||||
//将片段实例化到指定位置
|
||||
// String groupId = "019610d1-f933-1f70-16ea-3cf005012c4b";//流程组id
|
||||
SnippetInstanceJoin snippetInstanceJoin = new SnippetInstanceJoin();
|
||||
snippetInstanceJoin.setSnippetId(snippetId);
|
||||
// snippetInstanceJoin.setOriginY("0");
|
||||
// snippetInstanceJoin.setOriginX("0");
|
||||
SnippetInstance15 snippetInstance = nifiApiService.createSnippetInstance(groupId, snippetInstanceJoin);
|
||||
Flow15 flow = snippetInstance.getFlow();
|
||||
ProcessGroups15 processGroups15 = flow.getProcessGroups().get(0);
|
||||
// System.out.println(processGroups15.getId());
|
||||
processGroupId = processGroups15.getId();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return processGroupId;
|
||||
}
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
package com.hzya.frame;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.nifilog.dao.ILoggingEvent20250430Dao;
|
||||
import com.hzya.frame.nifilog.entity.LoggingEvent20250430Entity;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame
|
||||
* @Project:fw-nifi
|
||||
* @name:TestNifiLog
|
||||
* @Date:2025/5/20 11:53
|
||||
* @Filename:TestNifiLog
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = {WebappApplication.class})
|
||||
public class TestNifiLog {
|
||||
|
||||
@Autowired
|
||||
private ILoggingEvent20250430Dao iLoggingEvent20250430Dao;
|
||||
|
||||
/**
|
||||
* 获取nifi token
|
||||
*/
|
||||
@Test
|
||||
public void getAccessToken() {
|
||||
try {
|
||||
// PageAttribute<LoggingEvent20250430Entity> loggingEvent20250430EntityPageAttribute = iLoggingEvent20250430Dao.queryPaged();
|
||||
|
||||
List<String> arg0List = new ArrayList<>();
|
||||
arg0List.add("UpdateAttribute[id=ad841aed-30f7-16e2-4fa0-595ab0ab9fdc]");
|
||||
|
||||
List<String> logDateList = new ArrayList<>();
|
||||
logDateList.add("20250519");
|
||||
logDateList.add("20250520");
|
||||
|
||||
LoggingEvent20250430Entity loggingEvent20250430Entity = new LoggingEvent20250430Entity();
|
||||
loggingEvent20250430Entity.setArg0List(arg0List);
|
||||
loggingEvent20250430Entity.setLogDateList(logDateList);
|
||||
loggingEvent20250430Entity.setPageNum(1);
|
||||
loggingEvent20250430Entity.setPageSize(100);
|
||||
|
||||
PageInfo<LoggingEvent20250430Entity> loggingEvent20250430EntityPageInfo = iLoggingEvent20250430Dao.queryLoggingEventByProcessorId(loggingEvent20250430Entity);
|
||||
List<LoggingEvent20250430Entity> list = loggingEvent20250430EntityPageInfo.getList();
|
||||
System.out.println(list.size());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,51 +0,0 @@
|
|||
package com.hzya.frame.jolt;
|
||||
|
||||
import com.bazaarvoice.jolt.Chainr;
|
||||
import com.bazaarvoice.jolt.JsonUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* "cardinality"
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame
|
||||
* @Project:fw-nifi
|
||||
* @name:TestJolt
|
||||
* @Date:2025/6/18 11:19
|
||||
* @Filename:TestJolt
|
||||
*/
|
||||
public class TestJoltCardinality {
|
||||
|
||||
private final String jsonFileRootRoute = "/Users/liuyang/workspaces/hzya/fw-nifi/jolt-demo";
|
||||
|
||||
/**
|
||||
* ONE:如果输入值是一个列表,则获取该列表中的第一个元素,并将其设置为该元素的数据,不支持其他类型
|
||||
*/
|
||||
@Test
|
||||
public void testDemo() {
|
||||
//输入json
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/cardinality/input.json");
|
||||
//spec
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/cardinality/spec.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* 'MANY':如果输入不是列表,则创建一个列表并将第一个元素设置为输入值
|
||||
* 如果输入是"null",使它成为一个空列表。如果输入是一个列表,不支持
|
||||
*/
|
||||
@Test
|
||||
public void testDemo2() {
|
||||
//输入json
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/cardinality/input2.json");
|
||||
//spec
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/cardinality/spec2.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
package com.hzya.frame.jolt;
|
||||
|
||||
//import org.flywaydb.core.internal.util.JsonUtils;
|
||||
//import org.flywaydb.core.internal.util.JsonUtils;
|
||||
//import org.flywaydb.core.internal.util.JsonUtils;
|
||||
|
||||
import com.bazaarvoice.jolt.Chainr;
|
||||
import com.bazaarvoice.jolt.JsonUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
//import java.util.List;
|
||||
|
||||
/**
|
||||
* jolt框架的default部分测试,
|
||||
* default是一种为json对象设置默认值的核心操作,当目标json中某个字段不存在,或字段值为null时,
|
||||
* 用你指定的默认值填充该字段,如果字段已存在且值非 null,则不会覆盖原有值
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame
|
||||
* @Project:fw-nifi
|
||||
* @name:TestJolt
|
||||
* @Date:2025/6/18 11:19
|
||||
* @Filename:TestJolt
|
||||
*/
|
||||
public class TestJoltDefault {
|
||||
|
||||
private final String jsonFileRootRoute = "/Users/liuyang/workspaces/hzya/fw-nifi/jolt-demo";
|
||||
|
||||
/**
|
||||
* 增加一些指定属性
|
||||
*/
|
||||
@Test
|
||||
public void testDemo() {
|
||||
//输入json
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/default/input.json");
|
||||
//spec
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/default/spec.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加一些指定属性
|
||||
*/
|
||||
@Test
|
||||
public void testDemo2() {
|
||||
//输入json
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/default/input3.json");
|
||||
//spec
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/default/spec3.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package com.hzya.frame.jolt;
|
||||
|
||||
import com.bazaarvoice.jolt.Chainr;
|
||||
import com.bazaarvoice.jolt.JsonUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* jolt框架的modify部分测试
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame
|
||||
* @Project:fw-nifi
|
||||
* @name:TestJolt
|
||||
* @Date:2025/6/18 11:19
|
||||
* @Filename:TestJolt
|
||||
*/
|
||||
public class TestJoltModify {
|
||||
|
||||
private final String jsonFileRootRoute = "/Users/liuyang/workspaces/hzya/fw-nifi/jolt-demo";
|
||||
|
||||
@Test
|
||||
public void testDemo() {
|
||||
//输入json
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/modify/input.json");
|
||||
//spec
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/modify/spec.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
package com.hzya.frame.jolt;
|
||||
|
||||
import com.bazaarvoice.jolt.Chainr;
|
||||
import com.bazaarvoice.jolt.JsonUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* "remove" 是一种用于从输入 JSON 中删除指定字段或元素的核心转换操作
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame
|
||||
* @Project:fw-nifi
|
||||
* @name:TestJolt
|
||||
* @Date:2025/6/18 11:19
|
||||
* @Filename:TestJolt
|
||||
*/
|
||||
public class TestJoltRemove {
|
||||
|
||||
private final String jsonFileRootRoute = "/Users/liuyang/workspaces/hzya/fw-nifi/jolt-demo";
|
||||
|
||||
@Test
|
||||
public void testDemo() {
|
||||
//输入json
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/remove/input.json");
|
||||
//spec
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/remove/spec.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDemo2() {
|
||||
//输入json
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/remove/input3.json");
|
||||
//spec
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/remove/spec3.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
}
|
|
@ -1,218 +0,0 @@
|
|||
package com.hzya.frame.jolt;
|
||||
|
||||
//import org.flywaydb.core.internal.util.JsonUtils;
|
||||
//import org.flywaydb.core.internal.util.JsonUtils;
|
||||
//import org.flywaydb.core.internal.util.JsonUtils;
|
||||
|
||||
import com.bazaarvoice.jolt.Chainr;
|
||||
import com.bazaarvoice.jolt.JsonUtils;
|
||||
//import org.flywaydb.core.internal.util.JsonUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
//import java.util.List;
|
||||
|
||||
/**
|
||||
* jolt框架的shift部分测试,Shiftr的基本操作是复制输入JSON的value
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame
|
||||
* @Project:fw-nifi
|
||||
* @name:TestJolt
|
||||
* @Date:2025/6/18 11:19
|
||||
* @Filename:TestJolt
|
||||
*/
|
||||
public class TestJoltShift {
|
||||
|
||||
private final String jsonFileRootRoute = "/Users/liuyang/workspaces/hzya/fw-nifi/jolt-demo";
|
||||
|
||||
@Test
|
||||
public void testDemo() {
|
||||
//输入json
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input.json");
|
||||
//spec
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* 字段映射符
|
||||
*/
|
||||
@Test
|
||||
public void testDemo2() {
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input2.json");
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec2.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* *通配符
|
||||
*/
|
||||
@Test
|
||||
public void testDemo3() {
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input3.json");
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec3.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDemo4() {
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input4.json");
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec4.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* &通配符
|
||||
*/
|
||||
@Test
|
||||
public void testDemo5() {
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input5.json");
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec5.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* $通配符
|
||||
*/
|
||||
@Test
|
||||
public void testDemo6() {
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input6.json");
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec6.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* #通配符,在右边
|
||||
*/
|
||||
@Test
|
||||
public void testDemo7() {
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input7.json");
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec7.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* #通配符,在左边
|
||||
*/
|
||||
@Test
|
||||
public void testDemo8() {
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input8.json");
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec8.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* | 通配符,在左边
|
||||
*/
|
||||
@Test
|
||||
public void testDemo9() {
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input9.json");
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec9.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* @通配符,在左边
|
||||
*/
|
||||
@Test
|
||||
public void testDemo10() {
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input10.json");
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec10.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* @通配符,在右边
|
||||
*/
|
||||
@Test
|
||||
public void testDemo11() {
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input11.json");
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec11.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理输入中的json数组
|
||||
*/
|
||||
@Test
|
||||
public void testDemo12() {
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input12.json");
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec12.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理输出的json数组
|
||||
*/
|
||||
@Test
|
||||
public void testDemo13() {
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input13.json");
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec13.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* 同一个输入源,可以输出到多个目标输出处
|
||||
*/
|
||||
@Test
|
||||
public void testDemo14() {
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input14.json");
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec14.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐式数组
|
||||
*/
|
||||
@Test
|
||||
public void testDemo15() {
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/input15.json");
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/shift/spec15.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package com.hzya.frame.jolt;
|
||||
|
||||
import com.bazaarvoice.jolt.Chainr;
|
||||
import com.bazaarvoice.jolt.JsonUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* "Sort":排序场景
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame
|
||||
* @Project:fw-nifi
|
||||
* @name:TestJolt
|
||||
* @Date:2025/6/18 11:19
|
||||
* @Filename:TestJolt
|
||||
*/
|
||||
public class TestJoltSort {
|
||||
|
||||
private final String jsonFileRootRoute = "/Users/liuyang/workspaces/hzya/fw-nifi/jolt-demo";
|
||||
|
||||
/**
|
||||
* 默认按字母升序排列(A → Z),排序后键顺序为:a → b → d → r
|
||||
*/
|
||||
@Test
|
||||
public void testDemo() {
|
||||
//输入json
|
||||
Object input = JsonUtils.filepathToObject(jsonFileRootRoute + "/sort/input.json");
|
||||
//spec
|
||||
Object spec = JsonUtils.filepathToObject(jsonFileRootRoute + "/sort/spec.json");
|
||||
|
||||
Chainr chainr = Chainr.fromSpec(spec);
|
||||
Object transform = chainr.transform(input);
|
||||
System.out.println(JsonUtils.toJsonString(transform));
|
||||
}
|
||||
}
|
|
@ -22,4 +22,11 @@ public interface ISysDictionaryshopNewService {
|
|||
* @return
|
||||
*/
|
||||
SysDictionaryshopNew getDictionaryshopByValue(String tabName, String columnName, String columnValue);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity queryDictionaryList(JSONObject object);
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.hzya.frame.sys.dictionaryshopNew.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hzya.frame.serviceUtil.ServiceUtil;
|
||||
|
@ -11,7 +12,7 @@ import org.slf4j.LoggerFactory;
|
|||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -49,4 +50,17 @@ public class SysDictionaryshopNewServiceImpl extends ServiceUtil implements ISy
|
|||
sysDictionaryshopNew.setColumnValue(columnValue);
|
||||
return sysdictionaryshopnewMapper.entity_get_by_value(sysDictionaryshopNew);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryDictionaryList(JSONObject object) {
|
||||
SysDictionaryshopNew dictionary = getData("jsonStr", object, SysDictionaryshopNew.class);
|
||||
List<SysDictionaryshopNew> dictionaryList = sysdictionaryshopnewMapper.entity_list_base(dictionary);
|
||||
return BaseResult.getSuccessMessageEntity("查询列表成功", dictionaryList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,13 @@ import com.hzya.frame.web.entity.BaseEntity;
|
|||
* @since 2025-04-29 10:16:27
|
||||
*/
|
||||
public class SysFlowStepAccountEntity extends BaseEntity {
|
||||
|
||||
|
||||
//流程id
|
||||
private String flowId;
|
||||
//流程步骤id
|
||||
private String stepId;
|
||||
//应用id
|
||||
private String appId;
|
||||
/** 账户名称 */
|
||||
private String name;
|
||||
/** ip地址 */
|
||||
|
@ -122,5 +128,28 @@ public class SysFlowStepAccountEntity extends BaseEntity {
|
|||
this.agentid = agentid;
|
||||
}
|
||||
|
||||
public String getFlowId() {
|
||||
return flowId;
|
||||
}
|
||||
|
||||
public void setFlowId(String flowId) {
|
||||
this.flowId = flowId;
|
||||
}
|
||||
|
||||
public String getStepId() {
|
||||
return stepId;
|
||||
}
|
||||
|
||||
public void setStepId(String stepId) {
|
||||
this.stepId = stepId;
|
||||
}
|
||||
|
||||
public String getAppId() {
|
||||
return appId;
|
||||
}
|
||||
|
||||
public void setAppId(String appId) {
|
||||
this.appId = appId;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
<result property="dbName" column="db_name" jdbcType="VARCHAR"/>
|
||||
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
|
||||
<result property="password" column="password" jdbcType="VARCHAR"/>
|
||||
<result property="flowId" column="flow_id" jdbcType="VARCHAR"/>
|
||||
<result property="stepId" column="step_id" jdbcType="VARCHAR"/>
|
||||
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
|
||||
<result property="dbType" column="db_type" jdbcType="VARCHAR"/>
|
||||
<result property="appKey" column="app_key" jdbcType="VARCHAR"/>
|
||||
<result property="appSecret" column="app_secret" jdbcType="VARCHAR"/>
|
||||
|
@ -35,7 +38,10 @@
|
|||
,db_name
|
||||
,user_name
|
||||
,password
|
||||
,db_type
|
||||
,flow_id
|
||||
,step_id
|
||||
,app_id
|
||||
,db_type
|
||||
,app_key
|
||||
,app_secret
|
||||
,corpId
|
||||
|
@ -59,6 +65,9 @@
|
|||
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
|
||||
<if test="userName != null and userName != ''"> and user_name = #{userName} </if>
|
||||
<if test="password != null and password != ''"> and password = #{password} </if>
|
||||
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
|
||||
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
|
||||
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
|
||||
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
|
||||
<if test="appKey != null and appKey != ''"> and app_key = #{appKey} </if>
|
||||
<if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret} </if>
|
||||
|
@ -86,6 +95,9 @@
|
|||
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
|
||||
<if test="userName != null and userName != ''"> and user_name = #{userName} </if>
|
||||
<if test="password != null and password != ''"> and password = #{password} </if>
|
||||
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
|
||||
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
|
||||
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
|
||||
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
|
||||
<if test="appKey != null and appKey != ''"> and app_key = #{appKey} </if>
|
||||
<if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret} </if>
|
||||
|
@ -115,6 +127,9 @@
|
|||
<if test="dbName != null and dbName != ''"> and db_name like concat('%',#{dbName},'%') </if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%',#{userName},'%') </if>
|
||||
<if test="password != null and password != ''"> and password like concat('%',#{password},'%') </if>
|
||||
<if test="flowId != null and flowId != ''"> and flow_id like concat('%',#{flowId},'%') </if>
|
||||
<if test="stepId != null and stepId != ''"> and step_id like concat('%',#{stepId},'%') </if>
|
||||
<if test="appId != null and appId != ''"> and app_id like concat('%',#{appId},'%') </if>
|
||||
<if test="dbType != null and dbType != ''"> and db_type like concat('%',#{dbType},'%') </if>
|
||||
<if test="appKey != null and appKey != ''"> and app_key like concat('%',#{appKey},'%') </if>
|
||||
<if test="appSecret != null and appSecret != ''"> and app_secret like concat('%',#{appSecret},'%') </if>
|
||||
|
@ -144,6 +159,9 @@
|
|||
<if test="dbName != null and dbName != ''"> or db_name = #{dbName} </if>
|
||||
<if test="userName != null and userName != ''"> or user_name = #{userName} </if>
|
||||
<if test="password != null and password != ''"> or password = #{password} </if>
|
||||
<if test="flowId != null and flowId != ''"> or flow_id = #{flowId} </if>
|
||||
<if test="stepId != null and stepId != ''"> or step_id = #{stepId} </if>
|
||||
<if test="appId != null and appId != ''"> or app_id = #{appId} </if>
|
||||
<if test="dbType != null and dbType != ''"> or db_type = #{dbType} </if>
|
||||
<if test="appKey != null and appKey != ''"> or app_key = #{appKey} </if>
|
||||
<if test="appSecret != null and appSecret != ''"> or app_secret = #{appSecret} </if>
|
||||
|
@ -171,6 +189,9 @@
|
|||
<if test="dbName != null and dbName != ''"> db_name , </if>
|
||||
<if test="userName != null and userName != ''"> user_name , </if>
|
||||
<if test="password != null and password != ''"> password , </if>
|
||||
<if test="flowId != null and flowId != ''"> flow_id , </if>
|
||||
<if test="stepId != null and stepId != ''"> step_id , </if>
|
||||
<if test="appId != null and appId != ''"> app_id , </if>
|
||||
<if test="dbType != null and dbType != ''"> db_type , </if>
|
||||
<if test="appKey != null and appKey != ''"> app_key , </if>
|
||||
<if test="appSecret != null and appSecret != ''"> app_secret , </if>
|
||||
|
@ -193,6 +214,9 @@
|
|||
<if test="dbName != null and dbName != ''"> #{dbName} ,</if>
|
||||
<if test="userName != null and userName != ''"> #{userName} ,</if>
|
||||
<if test="password != null and password != ''"> #{password} ,</if>
|
||||
<if test="flowId != null and flowId != ''"> #{flowId} ,</if>
|
||||
<if test="stepId != null and stepId != ''"> #{stepId} ,</if>
|
||||
<if test="appId != null and appId != ''"> #{appId} ,</if>
|
||||
<if test="dbType != null and dbType != ''"> #{dbType} ,</if>
|
||||
<if test="appKey != null and appKey != ''"> #{appKey} ,</if>
|
||||
<if test="appSecret != null and appSecret != ''"> #{appSecret} ,</if>
|
||||
|
@ -205,18 +229,18 @@
|
|||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_flow_step_account(create_user_id, create_time, modify_user_id, modify_time, sts, name, ip_address, port, db_name, user_name, password, db_type, app_key, app_secret, corpId, agentId, sts)
|
||||
insert into sys_flow_step_account(create_user_id, create_time, modify_user_id, modify_time, sts, name, ip_address, port, db_name, user_name, password,flow_id,step_id,app_id, db_type, app_key, app_secret, corpId, agentId, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid}, 'Y')
|
||||
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.flowId},#{entity.stepId},#{entity.appId},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_flow_step_account(create_user_id, create_time, modify_user_id, modify_time, sts, name, ip_address, port, db_name, user_name, password, db_type, app_key, app_secret, corpId, agentId)
|
||||
insert into sys_flow_step_account(create_user_id, create_time, modify_user_id, modify_time, sts, name, ip_address, port, db_name, user_name, password,flow_id,step_id,app_id, db_type, app_key, app_secret, corpId, agentId)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid})
|
||||
(#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.name},#{entity.ipAddress},#{entity.port},#{entity.dbName},#{entity.userName},#{entity.password},#{entity.flowId},#{entity.stepId},#{entity.appId},#{entity.dbType},#{entity.appKey},#{entity.appSecret},#{entity.corpid},#{entity.agentid})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
create_user_id = values(create_user_id),
|
||||
|
@ -230,6 +254,9 @@
|
|||
db_name = values(db_name),
|
||||
user_name = values(user_name),
|
||||
password = values(password),
|
||||
flow_id = values(flow_id),
|
||||
step_id = values(step_id),
|
||||
app_id = values(app_id),
|
||||
db_type = values(db_type),
|
||||
app_key = values(app_key),
|
||||
app_secret = values(app_secret),
|
||||
|
@ -250,6 +277,9 @@ update sys_flow_step_account set
|
|||
<if test="dbName != null and dbName != ''"> db_name = #{dbName},</if>
|
||||
<if test="userName != null and userName != ''"> user_name = #{userName},</if>
|
||||
<if test="password != null and password != ''"> password = #{password},</if>
|
||||
<if test="flowId != null and flowId != ''"> flow_id = #{flowId},</if>
|
||||
<if test="stepId != null and stepId != ''"> step_id = #{stepId},</if>
|
||||
<if test="appId != null and appId != ''"> app_id = #{appId},</if>
|
||||
<if test="dbType != null and dbType != ''"> db_type = #{dbType},</if>
|
||||
<if test="appKey != null and appKey != ''"> app_key = #{appKey},</if>
|
||||
<if test="appSecret != null and appSecret != ''"> app_secret = #{appSecret},</if>
|
||||
|
@ -275,6 +305,9 @@ update sys_flow_step_account set sts= 'N' ,modify_time = #{modify_time},modify_
|
|||
<if test="dbName != null and dbName != ''"> and db_name = #{dbName} </if>
|
||||
<if test="userName != null and userName != ''"> and user_name = #{userName} </if>
|
||||
<if test="password != null and password != ''"> and password = #{password} </if>
|
||||
<if test="flowId != null and flowId != ''"> and flow_id = #{flowId} </if>
|
||||
<if test="stepId != null and stepId != ''"> and step_id = #{stepId} </if>
|
||||
<if test="appId != null and appId != ''"> and app_id = #{appId} </if>
|
||||
<if test="dbType != null and dbType != ''"> and db_type = #{dbType} </if>
|
||||
<if test="appKey != null and appKey != ''"> and app_key = #{appKey} </if>
|
||||
<if test="appSecret != null and appSecret != ''"> and app_secret = #{appSecret} </if>
|
||||
|
|
|
@ -35,6 +35,8 @@ public class SysFlowStepConfigEntity extends BaseEntity {
|
|||
/** 动态sql语句 */
|
||||
private String sqlStatement;
|
||||
|
||||
//步骤账户表id
|
||||
private String stepAccountId;
|
||||
|
||||
public String getFlowId() {
|
||||
return flowId;
|
||||
|
@ -132,5 +134,12 @@ public class SysFlowStepConfigEntity extends BaseEntity {
|
|||
this.sqlStatement = sqlStatement;
|
||||
}
|
||||
|
||||
public String getStepAccountId() {
|
||||
return stepAccountId;
|
||||
}
|
||||
|
||||
public void setStepAccountId(String stepAccountId) {
|
||||
this.stepAccountId = stepAccountId;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,8 +32,10 @@ public class SysFlowStepEntity extends BaseEntity {
|
|||
private String nifiApiId;
|
||||
/** nifi应用排序模式;先进先出/先进后出 */
|
||||
private String sortMode;
|
||||
|
||||
|
||||
//定时任务 corn表达式
|
||||
private String taskCorn;
|
||||
//账户对象
|
||||
private SysFlowStepAccountEntity account;
|
||||
public Integer getStep() {
|
||||
return step;
|
||||
}
|
||||
|
@ -121,5 +123,21 @@ public class SysFlowStepEntity extends BaseEntity {
|
|||
public void setFlowId(String flowId) {
|
||||
this.flowId = flowId;
|
||||
}
|
||||
|
||||
public SysFlowStepAccountEntity getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(SysFlowStepAccountEntity account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public String getTaskCorn() {
|
||||
return taskCorn;
|
||||
}
|
||||
|
||||
public void setTaskCorn(String taskCorn) {
|
||||
this.taskCorn = taskCorn;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,29 +17,31 @@
|
|||
<result property="actionType" column="action_type" jdbcType="VARCHAR"/>
|
||||
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
|
||||
<result property="apiId" column="api_id" jdbcType="VARCHAR"/>
|
||||
<result property="taskCorn" column="task_corn" jdbcType="VARCHAR"/>
|
||||
<result property="nifiAppId" column="nifi_app_id" jdbcType="VARCHAR"/>
|
||||
<result property="nifiApiId" column="nifi_api_id" jdbcType="VARCHAR"/>
|
||||
<result property="sortMode" column="sort_mode" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="SysFlowStepEntity_Base_Column_List">
|
||||
id
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,step
|
||||
,step_type
|
||||
,flowId
|
||||
,description
|
||||
,api_name
|
||||
,action_type
|
||||
,app_id
|
||||
,api_id
|
||||
,nifi_app_id
|
||||
,nifi_api_id
|
||||
,sort_mode
|
||||
id,
|
||||
create_user_id,
|
||||
create_time,
|
||||
modify_user_id,
|
||||
modify_time,
|
||||
sts,
|
||||
step,
|
||||
step_type,
|
||||
flowId,
|
||||
description,
|
||||
api_name,
|
||||
action_type,
|
||||
app_id,
|
||||
api_id,
|
||||
taskCorn,
|
||||
nifi_app_id,
|
||||
nifi_api_id,
|
||||
sort_mode
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysFlowStepEntity-result"
|
||||
|
@ -182,6 +184,7 @@
|
|||
<if test="actionType != null and actionType != ''">action_type ,</if>
|
||||
<if test="appId != null and appId != ''">app_id ,</if>
|
||||
<if test="apiId != null and apiId != ''">api_id ,</if>
|
||||
<if test="taskCorn != null and taskCorn != ''">task_corn ,</if>
|
||||
<if test="nifiAppId != null and nifiAppId != ''">nifi_app_id ,</if>
|
||||
<if test="nifiApiId != null and nifiApiId != ''">nifi_api_id ,</if>
|
||||
<if test="sortMode != null and sortMode != ''">sort_mode ,</if>
|
||||
|
@ -204,6 +207,7 @@
|
|||
<if test="actionType != null and actionType != ''">#{actionType} ,</if>
|
||||
<if test="appId != null and appId != ''">#{appId} ,</if>
|
||||
<if test="apiId != null and apiId != ''">#{apiId} ,</if>
|
||||
<if test="taskCorn != null and taskCorn != ''">#{taskCorn} ,</if>
|
||||
<if test="nifiAppId != null and nifiAppId != ''">#{nifiAppId} ,</if>
|
||||
<if test="nifiApiId != null and nifiApiId != ''">#{nifiApiId} ,</if>
|
||||
<if test="sortMode != null and sortMode != ''">#{sortMode} ,</if>
|
||||
|
@ -267,6 +271,7 @@
|
|||
<if test="actionType != null and actionType != ''">action_type = #{actionType},</if>
|
||||
<if test="appId != null and appId != ''">app_id = #{appId},</if>
|
||||
<if test="apiId != null and apiId != ''">api_id = #{apiId},</if>
|
||||
<if test="taskCorn != null and taskCorn != ''">task_corn = #{taskCorn},</if>
|
||||
<if test="nifiAppId != null and nifiAppId != ''">nifi_app_id = #{nifiAppId},</if>
|
||||
<if test="nifiApiId != null and nifiApiId != ''">nifi_api_id = #{nifiApiId},</if>
|
||||
<if test="sortMode != null and sortMode != ''">sort_mode = #{sortMode},</if>
|
||||
|
@ -295,6 +300,7 @@
|
|||
<if test="actionType != null and actionType != ''">and action_type = #{actionType}</if>
|
||||
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
|
||||
<if test="apiId != null and apiId != ''">and api_id = #{apiId}</if>
|
||||
<if test="taskCorn != null and taskCorn != ''">and task_corn = #{taskCorn}</if>
|
||||
<if test="nifiAppId != null and nifiAppId != ''">and nifi_app_id = #{nifiAppId}</if>
|
||||
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if>
|
||||
<if test="sortMode != null and sortMode != ''">and sort_mode = #{sortMode}</if>
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.hzya.frame.sys.flow.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
* 流程步骤账户表(SysFlowStepAccount)表服务接口
|
||||
*
|
||||
|
@ -9,4 +12,53 @@ import com.hzya.frame.basedao.service.IBaseService;
|
|||
* @since 2025-04-29 10:16:28
|
||||
*/
|
||||
public interface ISysFlowStepAccountService extends IBaseService<SysFlowStepAccountEntity, String>{
|
||||
|
||||
/**
|
||||
* 保存账户信息
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity saveAccount(JSONObject object);
|
||||
|
||||
/**
|
||||
* 更新账户信息
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity updateAccount(JSONObject object);
|
||||
|
||||
/**
|
||||
* 删除账户信息
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity deleteAccount(JSONObject object);
|
||||
|
||||
/**
|
||||
* 查询账户详情
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity getAccount(JSONObject object);
|
||||
|
||||
/**
|
||||
* 查询账户列表数据
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity queryAccountList(JSONObject object);
|
||||
|
||||
/**
|
||||
* 查询账户分页数据
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity queryAccountPaged(JSONObject object);
|
||||
|
||||
/**
|
||||
* 验证数据库账户
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity verifyDataBase(JSONObject object);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.hzya.frame.sys.flow.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
* 映射信息主表(SysFlowStepConfig)表服务接口
|
||||
*
|
||||
|
@ -9,4 +12,11 @@ import com.hzya.frame.basedao.service.IBaseService;
|
|||
* @since 2025-04-29 10:16:28
|
||||
*/
|
||||
public interface ISysFlowStepConfigService extends IBaseService<SysFlowStepConfigEntity, String>{
|
||||
|
||||
/**
|
||||
* 测试sql
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity testSql(JSONObject object);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.hzya.frame.sys.flow.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.flow.entity.SysFlowStepEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
* 流程步骤信息(SysFlowStep)表服务接口
|
||||
*
|
||||
|
@ -9,4 +12,39 @@ import com.hzya.frame.basedao.service.IBaseService;
|
|||
* @since 2025-04-29 10:16:27
|
||||
*/
|
||||
public interface ISysFlowStepService extends IBaseService<SysFlowStepEntity, String>{
|
||||
|
||||
/**
|
||||
* 保存流程步骤
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity saveFlowStep(JSONObject object);
|
||||
|
||||
/**
|
||||
* 更新流程步骤
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity updateFlowStep(JSONObject object);
|
||||
|
||||
/**
|
||||
* 删除流程步骤
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity deleteFlowStep(JSONObject object);
|
||||
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity queryList(JSONObject object);
|
||||
/**
|
||||
* 步骤详情
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
JsonResultEntity getFlowStep(JSONObject object);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public class SysFlowServiceImpl extends BaseService<SysFlowEntity, String> imple
|
|||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
sysFlowDao.save(flowEntity);
|
||||
return BaseResult.getSuccessMessageEntity("保存成功");
|
||||
return BaseResult.getSuccessMessageEntity("保存成功",flowEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,12 +1,30 @@
|
|||
package com.hzya.frame.sys.flow.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.datasource.DataSourceUtilProperties;
|
||||
import com.hzya.frame.serviceUtil.DsDataSourceUtil;
|
||||
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
|
||||
import com.hzya.frame.sys.flow.dao.ISysFlowStepAccountDao;
|
||||
import com.hzya.frame.sys.flow.service.ISysFlowStepAccountService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity;
|
||||
import com.hzya.frame.sysnew.application.database.service.ISysApplicationDatabaseService;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import com.hzya.frame.web.exception.BaseSystemException;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程步骤账户表(SysFlowStepAccount)表服务实现类
|
||||
*
|
||||
|
@ -15,12 +33,252 @@ import com.hzya.frame.basedao.service.impl.BaseService;
|
|||
*/
|
||||
@Service(value = "sysFlowStepAccountService")
|
||||
public class SysFlowStepAccountServiceImpl extends BaseService<SysFlowStepAccountEntity, String> implements ISysFlowStepAccountService {
|
||||
|
||||
|
||||
private ISysFlowStepAccountDao sysFlowStepAccountDao;
|
||||
|
||||
@Resource
|
||||
private DsDataSourceUtil dsDataSourceUtil;
|
||||
@Autowired
|
||||
public void setSysFlowStepAccountDao(ISysFlowStepAccountDao dao) {
|
||||
this.sysFlowStepAccountDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
private ISysApplicationDatabaseService sysApplicationDatabaseService;
|
||||
|
||||
@Autowired
|
||||
public void setSysFlowStepAccountDao(ISysFlowStepAccountDao dao) {
|
||||
this.sysFlowStepAccountDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存账户信息
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity saveAccount(JSONObject object) {
|
||||
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
|
||||
try {
|
||||
checkParam(entity, "save");
|
||||
//控制一下名字不能重复
|
||||
List<SysFlowStepAccountEntity> queryList = queryByName(entity);
|
||||
if (CollectionUtils.isNotEmpty(queryList) && queryList.size() > 0) {
|
||||
return BaseResult.getFailureMessageEntity(entity.getName() + "重复");
|
||||
}
|
||||
sysFlowStepAccountDao.save(entity);
|
||||
//保存数据源表,测试sql的时候要用动态数据源,动态数据源是从sys_application_database表查数据的
|
||||
saveOrDataBase(entity);
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("新增成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据源表,测试sql的时候要用动态数据源,动态数据源是从sys_application_database表查数据的
|
||||
*
|
||||
* @param entity
|
||||
*/
|
||||
private void saveOrDataBase(SysFlowStepAccountEntity entity) throws Exception {
|
||||
Assert.notNull(entity, "参数不能为空");
|
||||
Assert.notEmpty(entity.getName(), "账户名称不能为空");
|
||||
SysApplicationDatabaseEntity db = new SysApplicationDatabaseEntity();
|
||||
db.setSourceCode(entity.getName() + "_flow");
|
||||
List<SysApplicationDatabaseEntity> queryList = sysApplicationDatabaseService.query(db);
|
||||
if (CollectionUtils.isNotEmpty(queryList)) {
|
||||
for (SysApplicationDatabaseEntity sys : queryList) {
|
||||
sysApplicationDatabaseService.logicRemove(sys);
|
||||
}
|
||||
}
|
||||
SysApplicationDatabaseEntity databaseEntity = new SysApplicationDatabaseEntity();
|
||||
databaseEntity.setAppId(entity.getAppId());
|
||||
databaseEntity.setSourceCode(entity.getName() + "_flow");
|
||||
databaseEntity.setSourceName(entity.getName());
|
||||
databaseEntity.setSourceType(entity.getDbType());
|
||||
databaseEntity.setSourceIp(entity.getIpAddress());
|
||||
databaseEntity.setSourcePort(entity.getPort());
|
||||
databaseEntity.setLoginName(entity.getUserName());
|
||||
databaseEntity.setPassword(entity.getPassword());
|
||||
databaseEntity.setDbName(entity.getDbName());
|
||||
databaseEntity.setDbStatus("1");
|
||||
sysApplicationDatabaseService.save(databaseEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新账户信息
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity updateAccount(JSONObject object) {
|
||||
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
|
||||
try {
|
||||
checkParam(entity, "update");
|
||||
//检查一下名字不能重复
|
||||
List<SysFlowStepAccountEntity> queryList = queryByName(entity);
|
||||
if (CollectionUtils.isNotEmpty(queryList) && queryList.size() > 0) {
|
||||
for (SysFlowStepAccountEntity acc : queryList) {
|
||||
if (!acc.getId().equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity(entity.getName() + "重复");
|
||||
}
|
||||
}
|
||||
}
|
||||
sysFlowStepAccountDao.update(entity);
|
||||
//保存数据源表,测试sql的时候要用动态数据源,动态数据源是从sys_application_database表查数据的
|
||||
saveOrDataBase(entity);
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除账户信息
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity deleteAccount(JSONObject object) {
|
||||
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
|
||||
try {
|
||||
checkParam(entity, "delete");
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
sysFlowStepAccountDao.logicRemove(entity);
|
||||
return BaseResult.getSuccessMessageEntity("删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询账户详情
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity getAccount(JSONObject object) {
|
||||
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
|
||||
try {
|
||||
checkParam(entity, "get");
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
SysFlowStepAccountEntity SysFlowStepAccountEntity = sysFlowStepAccountDao.get(entity.getId());
|
||||
return BaseResult.getSuccessMessageEntity("查询账户详情成功", SysFlowStepAccountEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询账户列表数据
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryAccountList(JSONObject object) {
|
||||
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
|
||||
try {
|
||||
checkParam(entity, "queryList");
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
List<SysFlowStepAccountEntity> queryList = sysFlowStepAccountDao.query(entity);
|
||||
return BaseResult.getSuccessMessageEntity("查询列表成功", queryList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询账户分页数据
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryAccountPaged(JSONObject object) {
|
||||
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
|
||||
try {
|
||||
checkParam(entity, "queryPaged");
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
//根据账户名称查询
|
||||
private List<SysFlowStepAccountEntity> queryByName(SysFlowStepAccountEntity entity) {
|
||||
if (StrUtil.isNotEmpty(entity.getName())) {
|
||||
SysFlowStepAccountEntity account = new SysFlowStepAccountEntity();
|
||||
account.setName(entity.getName());
|
||||
List<SysFlowStepAccountEntity> queryList = sysFlowStepAccountDao.query(account);
|
||||
return queryList;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证账户
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity verifyDataBase(JSONObject object) {
|
||||
SysFlowStepAccountEntity entity = getData("jsonStr", object, SysFlowStepAccountEntity.class);
|
||||
try {
|
||||
checkParam(entity, "verify");
|
||||
String dbType = entity.getDbType();
|
||||
String driveClass = "";
|
||||
StringBuffer sourceUrl = new StringBuffer();
|
||||
if (StrUtil.isNotEmpty(dbType)) {
|
||||
if ("mysql".equals(dbType)) {
|
||||
driveClass = DataSourceUtilProperties.MYSQLDRIVER_6;
|
||||
sourceUrl.append("jdbc:mysql://").append(entity.getIpAddress()).append(":").append(entity.getPort()).append("/").append(entity.getDbName()).append("?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true");
|
||||
} else if ("oracle".equals(dbType)) {
|
||||
driveClass = DataSourceUtilProperties.ORACLEDRIVER;
|
||||
sourceUrl.append("jdbc:oracle:thin:@").append(entity.getIpAddress()).append(":").append(entity.getPort()).append(":").append(entity.getDbName());
|
||||
} else if ("sqlserver2000".equals(dbType)) {
|
||||
driveClass = DataSourceUtilProperties.SQL2000DRIVER;
|
||||
sourceUrl.append("jdbc:sqlserver://").append(entity.getIpAddress()).append(":").append(entity.getPort()).append(";DatabaseName=").append(entity.getDbName()).append(";encrypt=false;trustServerCertificate=true");
|
||||
} else if ("sqlserver2005".equals(dbType)) {
|
||||
driveClass = DataSourceUtilProperties.SQL2005DRIVER;
|
||||
sourceUrl.append("jdbc:sqlserver://").append(entity.getIpAddress()).append(":").append(entity.getPort()).append(";DatabaseName=").append(entity.getDbName()).append(";encrypt=false;trustServerCertificate=true");
|
||||
}
|
||||
//测试连接
|
||||
Class.forName(driveClass);
|
||||
Connection connection = DriverManager.getConnection(sourceUrl.toString(), entity.getUserName(), entity.getPassword());// 相当于连接数据库
|
||||
if (null != connection) {
|
||||
return BaseResult.getSuccessMessageEntity("验证成功");
|
||||
} else {
|
||||
return BaseResult.getFailureMessageEntity("验证失败");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
//数据检查
|
||||
private void checkParam(SysFlowStepAccountEntity entity, String type) {
|
||||
Assert.notNull(entity, "参数不能为空");
|
||||
if ("save".equals(type)) {
|
||||
Assert.notEmpty(entity.getFlowId(), "flowId不能为空");
|
||||
Assert.notEmpty(entity.getAppId(), "appId不能为空");
|
||||
Assert.notEmpty(entity.getName(), "账户名称不能为空");
|
||||
} else if ("update".equals(type)) {
|
||||
Assert.notEmpty(entity.getId(), "id不能为空");
|
||||
} else if ("delete".equals(type)) {
|
||||
Assert.notEmpty(entity.getId(), "id不能为空");
|
||||
} else if ("get".equals(type)) {
|
||||
Assert.notEmpty(entity.getId(), "id不能为空");
|
||||
} else if ("queryList".equals(type)) {
|
||||
Assert.notEmpty(entity.getFlowId(), "flowId不能为空");
|
||||
Assert.notEmpty(entity.getStepId(), "stepId不能为空");
|
||||
Assert.notEmpty(entity.getAppId(), "appId不能为空");
|
||||
} else if ("queryPaged".equals(type)) {
|
||||
Assert.notNull(entity.getPageNum(), "pageNum不能为空");
|
||||
Assert.notNull(entity.getPageSize(), "pageSize不能为空");
|
||||
} else if ("verify".equals(type)) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,27 @@
|
|||
package com.hzya.frame.sys.flow.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
|
||||
import com.hzya.frame.sys.flow.entity.SysFlowStepConfigEntity;
|
||||
import com.hzya.frame.sys.flow.dao.ISysFlowStepConfigDao;
|
||||
import com.hzya.frame.sys.flow.service.ISysFlowStepAccountService;
|
||||
import com.hzya.frame.sys.flow.service.ISysFlowStepConfigService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity;
|
||||
import com.hzya.frame.sysnew.application.database.service.ISysApplicationDatabaseService;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import com.hzya.frame.web.exception.BaseSystemException;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 映射信息主表(SysFlowStepConfig)表服务实现类
|
||||
*
|
||||
|
@ -15,12 +30,53 @@ import com.hzya.frame.basedao.service.impl.BaseService;
|
|||
*/
|
||||
@Service(value = "sysFlowStepConfigService")
|
||||
public class SysFlowStepConfigServiceImpl extends BaseService<SysFlowStepConfigEntity, String> implements ISysFlowStepConfigService {
|
||||
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(ISysFlowStepConfigService.class);
|
||||
private ISysFlowStepConfigDao sysFlowStepConfigDao;
|
||||
|
||||
@Autowired
|
||||
private ISysFlowStepAccountService sysFlowStepAccountService;
|
||||
@Autowired
|
||||
private ISysApplicationDatabaseService sysApplicationDatabaseService;
|
||||
@Autowired
|
||||
public void setSysFlowStepConfigDao(ISysFlowStepConfigDao dao) {
|
||||
this.sysFlowStepConfigDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试sql
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity testSql(JSONObject object) {
|
||||
SysFlowStepConfigEntity config = getData("jsonStr",object,SysFlowStepConfigEntity.class);
|
||||
try {
|
||||
checkParams(config,"type");
|
||||
}catch (Exception e){
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
SysFlowStepAccountEntity accountEntity = sysFlowStepAccountService.get(config.getId());
|
||||
Assert.notNull(accountEntity,"没有找到对应账户");
|
||||
//查询数据源
|
||||
SysApplicationDatabaseEntity database = new SysApplicationDatabaseEntity();
|
||||
database.setSourceCode(accountEntity.getName()+"_flow");
|
||||
List<SysApplicationDatabaseEntity> databaseList = sysApplicationDatabaseService.query(database);
|
||||
if (CollectionUtils.isEmpty(databaseList)){
|
||||
throw new BaseSystemException("没有找到数据源");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证数据
|
||||
* @param entity
|
||||
* @param type
|
||||
*/
|
||||
private void checkParams(SysFlowStepConfigEntity entity, String type) {
|
||||
Assert.notNull(entity,"参数不能为空");
|
||||
Assert.notEmpty(entity.getTableName(),"tabName不能为空");
|
||||
Assert.notEmpty(entity.getStepAccountId(),"tabName不能为空");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,21 @@
|
|||
package com.hzya.frame.sys.flow.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.flow.dao.ISysFlowStepAccountDao;
|
||||
import com.hzya.frame.sys.flow.entity.SysFlowStepAccountEntity;
|
||||
import com.hzya.frame.sys.flow.entity.SysFlowStepEntity;
|
||||
import com.hzya.frame.sys.flow.dao.ISysFlowStepDao;
|
||||
import com.hzya.frame.sys.flow.service.ISysFlowStepAccountService;
|
||||
import com.hzya.frame.sys.flow.service.ISysFlowStepService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 流程步骤信息(SysFlowStep)表服务实现类
|
||||
*
|
||||
|
@ -15,12 +24,137 @@ import com.hzya.frame.basedao.service.impl.BaseService;
|
|||
*/
|
||||
@Service(value = "sysFlowStepService")
|
||||
public class SysFlowStepServiceImpl extends BaseService<SysFlowStepEntity, String> implements ISysFlowStepService {
|
||||
|
||||
|
||||
private ISysFlowStepDao sysFlowStepDao;
|
||||
|
||||
@Autowired
|
||||
public void setSysFlowStepDao(ISysFlowStepDao dao) {
|
||||
this.sysFlowStepDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
private ISysFlowStepAccountService sysFlowStepAccountService;
|
||||
|
||||
@Autowired
|
||||
public void setSysFlowStepDao(ISysFlowStepDao dao) {
|
||||
this.sysFlowStepDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存流程步骤
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity saveFlowStep(JSONObject object) {
|
||||
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
|
||||
try {
|
||||
checkParams(sysFlowStep, "save");
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
sysFlowStepDao.save(sysFlowStep);
|
||||
return BaseResult.getSuccessMessageEntity("保存成功", sysFlowStep);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新流程步骤
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity updateFlowStep(JSONObject object) {
|
||||
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
|
||||
try {
|
||||
checkParams(sysFlowStep, "update");
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
sysFlowStepDao.update(sysFlowStep);
|
||||
//保存账户信息
|
||||
if (null != sysFlowStep.getAccount()) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("jsonStr", JSONObject.toJSONString(sysFlowStep.getAccount()));
|
||||
sysFlowStepAccountService.saveAccount(jsonObject);
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("保存成功", sysFlowStep);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程步骤
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity deleteFlowStep(JSONObject object) {
|
||||
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
|
||||
try {
|
||||
checkParams(sysFlowStep, "delete");
|
||||
String id = sysFlowStep.getId();
|
||||
SysFlowStepEntity step = sysFlowStepDao.get(id);
|
||||
//删除流程步骤账户表
|
||||
SysFlowStepAccountEntity stepAccount = new SysFlowStepAccountEntity();
|
||||
stepAccount.setFlowId(step.getFlowId());
|
||||
stepAccount.setStepId(id);
|
||||
sysFlowStepAccountService.logicRemoveMultiCondition(stepAccount);
|
||||
//删除流程步骤
|
||||
sysFlowStepDao.logicRemove(step);
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryList(JSONObject object) {
|
||||
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
|
||||
try {
|
||||
checkParams(sysFlowStep, "queryList");
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
List<SysFlowStepEntity> list = sysFlowStepDao.query(sysFlowStep);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 步骤详情
|
||||
*
|
||||
* @param object
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public JsonResultEntity getFlowStep(JSONObject object) {
|
||||
SysFlowStepEntity sysFlowStep = getData("jsonStr", object, SysFlowStepEntity.class);
|
||||
try {
|
||||
checkParams(sysFlowStep, "get");
|
||||
} catch (Exception e) {
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
SysFlowStepEntity entity = sysFlowStepDao.get(sysFlowStep.getId());
|
||||
return BaseResult.getSuccessMessageEntity("查询详情成功", entity);
|
||||
}
|
||||
|
||||
private void checkParams(SysFlowStepEntity entity, String type) {
|
||||
Assert.notNull(entity, "参数不能为空");
|
||||
if ("save".equals(type)) {
|
||||
Assert.notEmpty(entity.getFlowId(), "flowId不能为空");
|
||||
Assert.notNull(entity.getStep(), "步骤号不能为空");
|
||||
Assert.notEmpty(entity.getStepType(), "stepType不能为空");
|
||||
} else if ("update".equals(type)) {
|
||||
Assert.notEmpty(entity.getAppId(), "appId不能为空");
|
||||
Assert.notEmpty(entity.getNifiApiId(), "nifiApiId不能为空");
|
||||
} else if ("delete".equals(type)) {
|
||||
Assert.notEmpty(entity.getId(), "id不能为空");
|
||||
}else if ("queryList".equals(type)){
|
||||
Assert.notEmpty(entity.getFlowId(),"flowId不能为空");
|
||||
}else if ("get".equals(type)){
|
||||
Assert.notEmpty(entity.getId(),"id不能为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,6 +82,9 @@ public class SysApplicationApiEntity extends BaseEntity {
|
|||
/** 返回描述字段*/
|
||||
private String returnMsg;
|
||||
|
||||
//对应nifi的apiid
|
||||
private String nifiApiId;
|
||||
|
||||
public String getReturnMsg() {
|
||||
return returnMsg;
|
||||
}
|
||||
|
@ -321,5 +324,13 @@ public class SysApplicationApiEntity extends BaseEntity {
|
|||
public void setAppCode(Long appCode) {
|
||||
this.appCode = appCode;
|
||||
}
|
||||
|
||||
public String getNifiApiId() {
|
||||
return nifiApiId;
|
||||
}
|
||||
|
||||
public void setNifiApiId(String nifiApiId) {
|
||||
this.nifiApiId = nifiApiId;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<result property="appCode" column="app_code"/>
|
||||
<result property="apiPath" column="api_path" jdbcType="VARCHAR"/>
|
||||
<result property="appId" column="app_id" jdbcType="VARCHAR"/>
|
||||
<result property="nifiApiId" column="nifi_api_id" jdbcType="VARCHAR"/>
|
||||
<result property="appName" column="app_name" jdbcType="VARCHAR"/>
|
||||
<result property="appUrl" column="app_url" jdbcType="VARCHAR"/>
|
||||
<result property="catalogueId" column="catalogue_id" jdbcType="VARCHAR"/>
|
||||
|
@ -51,7 +52,8 @@
|
|||
,api_code
|
||||
,api_path
|
||||
,app_id
|
||||
,catalogue_id
|
||||
,nifi_api_id
|
||||
,catalogue_id
|
||||
,api_name
|
||||
,api_remark
|
||||
,need_Login
|
||||
|
@ -85,6 +87,7 @@
|
|||
<sql id="SysApplicationApiEntity_join_sysApp_like_Column_Lis">
|
||||
sys_application_api.id,
|
||||
sys_application.app_id as app_code,
|
||||
sys_application.nifi_api_id as nifi_api_id,
|
||||
sys_application_api.api_code,
|
||||
sys_application_api.api_name,
|
||||
sys_application_api.api_remark,
|
||||
|
@ -111,6 +114,7 @@
|
|||
b.name as app_name,
|
||||
b.interface_address as app_url,
|
||||
a.app_id,
|
||||
a.nifi_api_id,
|
||||
a.catalogue_id,
|
||||
c.name as catalogue_name,
|
||||
a.api_name,
|
||||
|
@ -162,6 +166,7 @@ WHERE
|
|||
,api.api_code
|
||||
,api.api_path
|
||||
,api.app_id
|
||||
,api.nifi_api_id
|
||||
,api.catalogue_id
|
||||
,api.api_name
|
||||
,api.api_remark
|
||||
|
@ -200,6 +205,7 @@ WHERE
|
|||
<if test="apiCode != null ">and api.api_code = #{apiCode}</if>
|
||||
<if test="apiPath != null and apiPath != ''">and api.api_path = #{apiPath}</if>
|
||||
<if test="appId != null and appId != ''">and api.app_id = #{appId}</if>
|
||||
<if test="nifiApiId != null and nifiApiId != ''">and api.nifi_api_id = #{nifiApiId}</if>
|
||||
<if test="catalogueId != null and catalogueId != ''">and api.catalogue_id = #{catalogueId}</if>
|
||||
<if test="apiName != null and apiName != ''">and api.api_name = #{apiName}</if>
|
||||
<if test="apiRemark != null and apiRemark != ''">and api.api_remark = #{apiRemark}</if>
|
||||
|
@ -251,6 +257,7 @@ WHERE
|
|||
<if test="apiCode != null ">and api_code = #{apiCode}</if>
|
||||
<if test="apiPath != null and apiPath != ''">and api_path = #{apiPath}</if>
|
||||
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
|
||||
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if>
|
||||
<if test="catalogueId != null and catalogueId != ''">and catalogue_id = #{catalogueId}</if>
|
||||
<if test="apiName != null and apiName != ''">and api_name = #{apiName}</if>
|
||||
<if test="apiRemark != null and apiRemark != ''">and api_remark = #{apiRemark}</if>
|
||||
|
@ -304,6 +311,7 @@ WHERE
|
|||
<if test="apiCode != null ">and api_code like concat('%',#{apiCode},'%')</if>
|
||||
<if test="apiPath != null and apiPath != ''">and api_path like concat('%',#{apiPath},'%')</if>
|
||||
<if test="appId != null and appId != ''">and app_id like concat('%',#{appId},'%')</if>
|
||||
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id like concat('%',#{nifiApiId},'%')</if>
|
||||
<if test="catalogueId != null and catalogueId != ''">and catalogue_id like concat('%',#{catalogueId},'%')
|
||||
</if>
|
||||
<if test="apiName != null and apiName != ''">and api_name like concat('%',#{apiName},'%')</if>
|
||||
|
@ -372,6 +380,7 @@ WHERE
|
|||
<if test="apiCode != null ">and sys_application_api.api_code like concat('%',#{apiCode},'%')</if>
|
||||
<if test="apiPath != null and apiPath != ''">and sys_application_api.api_path like concat('%',#{apiPath},'%')</if>
|
||||
<if test="appId != null and appId != ''">and sys_application_api.app_id like concat('%',#{appId},'%')</if>
|
||||
<if test="nifiApiId != null and nifiApiId != ''">and sys_application_api.nifi_api_id like concat('%',#{nifiApiId},'%')</if>
|
||||
<if test="catalogueId != null and catalogueId != ''">and sys_application_api.catalogue_id like concat('%',#{catalogueId},'%')
|
||||
</if>
|
||||
<if test="apiName != null and apiName != ''">and sys_application_api.api_name like concat('%',#{apiName},'%')</if>
|
||||
|
@ -438,6 +447,7 @@ WHERE
|
|||
<if test="apiCode != null ">or api_code = #{apiCode}</if>
|
||||
<if test="apiPath != null and apiPath != ''">or api_path = #{apiPath}</if>
|
||||
<if test="appId != null and appId != ''">or app_id = #{appId}</if>
|
||||
<if test="nifiApiId != null and nifiApiId != ''">or nifi_api_id = #{nifiApiId}</if>
|
||||
<if test="catalogueId != null and catalogueId != ''">or catalogue_id = #{catalogueId}</if>
|
||||
<if test="apiName != null and apiName != ''">or api_name = #{apiName}</if>
|
||||
<if test="apiRemark != null and apiRemark != ''">or api_remark = #{apiRemark}</if>
|
||||
|
@ -490,6 +500,7 @@ WHERE
|
|||
<if test="apiCode == null ">api_code ,</if>
|
||||
<if test="apiPath != null and apiPath != ''">api_path ,</if>
|
||||
<if test="appId != null and appId != ''">app_id ,</if>
|
||||
<if test="nifiApiId != null and nifiApiId != ''">nifi_api_id ,</if>
|
||||
<if test="catalogueId != null and catalogueId != ''">catalogue_id ,</if>
|
||||
<if test="apiName != null and apiName != ''">api_name ,</if>
|
||||
<if test="apiRemark != null and apiRemark != ''">api_remark ,</if>
|
||||
|
@ -531,6 +542,7 @@ WHERE
|
|||
</if>
|
||||
<if test="apiPath != null and apiPath != ''">#{apiPath} ,</if>
|
||||
<if test="appId != null and appId != ''">#{appId} ,</if>
|
||||
<if test="nifiApiId != null and nifiApiId != ''">#{nifiApiId} ,</if>
|
||||
<if test="catalogueId != null and catalogueId != ''">#{catalogueId} ,</if>
|
||||
<if test="apiName != null and apiName != ''">#{apiName} ,</if>
|
||||
<if test="apiRemark != null and apiRemark != ''">#{apiRemark} ,</if>
|
||||
|
@ -567,31 +579,32 @@ WHERE
|
|||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into sys_application_api(api_status,api_code,api_path, app_id, catalogue_id, api_name, api_remark,
|
||||
insert into sys_application_api(api_status,api_code,api_path, app_id,nifi_api_id, catalogue_id, api_name, api_remark,
|
||||
need_Login, authentication_port, parameter_passing_mode, destination_address, request_coding, request_method,
|
||||
timeout_period, current_limiting, header_in, query_in, body_in_type, body_in, body_out, bean_name,return_msg,return_success_field,return_success_value, fun_name, extension_api, sorts, create_user_id,
|
||||
create_time, modify_user_id, modify_time, sts, org_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.apiStatus},#{entity.apiCode},#{entity.apiPath},#{entity.appId},#{entity.catalogueId},#{entity.apiName},#{entity.apiRemark},#{entity.needLogin},#{entity.authenticationPort},#{entity.parameterPassingMode},#{entity.destinationAddress},#{entity.requestCoding},#{entity.requestMethod},#{entity.timeoutPeriod},#{entity.currentLimiting},#{entity.headerIn},#{entity.queryIn},#{entity.bodyInType},#{entity.bodyIn},#{entity.bodyOut},#{entity.beanName},#{entity.returnMsg},#{entity.returnSuccessField},#{entity.returnSuccessValue},#{entity.funName},#{entity.extensionApi},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
|
||||
(#{entity.apiStatus},#{entity.apiCode},#{entity.apiPath},#{entity.appId},#{entity.nifiApiId},#{entity.catalogueId},#{entity.apiName},#{entity.apiRemark},#{entity.needLogin},#{entity.authenticationPort},#{entity.parameterPassingMode},#{entity.destinationAddress},#{entity.requestCoding},#{entity.requestMethod},#{entity.timeoutPeriod},#{entity.currentLimiting},#{entity.headerIn},#{entity.queryIn},#{entity.bodyInType},#{entity.bodyIn},#{entity.bodyOut},#{entity.beanName},#{entity.returnMsg},#{entity.returnSuccessField},#{entity.returnSuccessValue},#{entity.funName},#{entity.extensionApi},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into sys_application_api(api_status,api_code,api_path, app_id, catalogue_id, api_name, api_remark,
|
||||
insert into sys_application_api(api_status,api_code,api_path, app_id,nifi_api_id, catalogue_id, api_name, api_remark,
|
||||
need_Login, authentication_port, parameter_passing_mode, destination_address, request_coding, request_method,
|
||||
timeout_period, current_limiting, header_in, query_in, body_in_type, body_in, body_out,bean_name,return_msg,return_success_field,return_success_value,fun_name,extension_api, sorts, create_user_id,
|
||||
create_time, modify_user_id, modify_time, sts, org_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.apiStatus},#{entity.apiCode},#{entity.apiPath},#{entity.appId},#{entity.catalogueId},#{entity.apiName},#{entity.apiRemark},#{entity.needLogin},#{entity.authenticationPort},#{entity.parameterPassingMode},#{entity.destinationAddress},#{entity.requestCoding},#{entity.requestMethod},#{entity.timeoutPeriod},#{entity.currentLimiting},#{entity.headerIn},#{entity.queryIn},#{entity.bodyInType},#{entity.bodyIn},#{entity.bodyOut},#{entity.beanName},#{entity.returnMsg},#{entity.returnSuccessField},#{entity.returnSuccessValue},#{entity.funName},#{entity.extensionApi},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
|
||||
(#{entity.apiStatus},#{entity.apiCode},#{entity.apiPath},#{entity.appId},#{entity.nifiApiId},#{entity.catalogueId},#{entity.apiName},#{entity.apiRemark},#{entity.needLogin},#{entity.authenticationPort},#{entity.parameterPassingMode},#{entity.destinationAddress},#{entity.requestCoding},#{entity.requestMethod},#{entity.timeoutPeriod},#{entity.currentLimiting},#{entity.headerIn},#{entity.queryIn},#{entity.bodyInType},#{entity.bodyIn},#{entity.bodyOut},#{entity.beanName},#{entity.returnMsg},#{entity.returnSuccessField},#{entity.returnSuccessValue},#{entity.funName},#{entity.extensionApi},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
api_status = values(api_status),
|
||||
api_code = values(api_code),
|
||||
api_path = values(api_path),
|
||||
app_id = values(app_id),
|
||||
nifi_api_id = values(nifi_api_id),
|
||||
catalogue_id = values(catalogue_id),
|
||||
api_name = values(api_name),
|
||||
api_remark = values(api_remark),
|
||||
|
@ -630,6 +643,7 @@ WHERE
|
|||
<if test="apiCode != null ">api_code = #{apiCode},</if>
|
||||
<if test="apiPath != null and apiPath != ''">api_path = #{apiPath},</if>
|
||||
<if test="appId != null and appId != ''">app_id = #{appId},</if>
|
||||
<if test="nifiApiId != null and nifiApiId != ''">nifi_api_id = #{nifiApiId},</if>
|
||||
<if test="catalogueId != null and catalogueId != ''">catalogue_id = #{catalogueId},</if>
|
||||
<if test="apiName != null and apiName != ''">api_name = #{apiName},</if>
|
||||
<if test="apiRemark != null and apiRemark != ''">api_remark = #{apiRemark},</if>
|
||||
|
@ -683,6 +697,7 @@ where id = #{id}
|
|||
<if test="apiCode != null ">and api_code = #{apiCode}</if>
|
||||
<if test="apiPath != null and apiPath != ''">and api_path = #{apiPath}</if>
|
||||
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
|
||||
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if>
|
||||
<if test="catalogueId != null and catalogueId != ''">and catalogue_id = #{catalogueId}</if>
|
||||
<if test="apiName != null and apiName != ''">and api_name = #{apiName}</if>
|
||||
<if test="apiRemark != null and apiRemark != ''">and api_remark = #{apiRemark}</if>
|
||||
|
@ -919,6 +934,7 @@ where id = #{id}
|
|||
select
|
||||
id
|
||||
,app_id
|
||||
,nifi_api_id
|
||||
,api_name
|
||||
from sys_application_api
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
|
@ -927,6 +943,7 @@ where id = #{id}
|
|||
<if test="apiCode != null ">and api_code = #{apiCode}</if>
|
||||
<if test="apiPath != null and apiPath != ''">and api_path = #{apiPath}</if>
|
||||
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
|
||||
<if test="nifiApiId != null and nifiApiId != ''">and nifi_api_id = #{nifiApiId}</if>
|
||||
<if test="catalogueId != null and catalogueId != ''">and catalogue_id = #{catalogueId}</if>
|
||||
<if test="apiName != null and apiName != ''">and api_name = #{apiName}</if>
|
||||
<if test="apiRemark != null and apiRemark != ''">and api_remark = #{apiRemark}</if>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.hzya.frame.sysnew.application.appAcount.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
/**
|
||||
* 应用账户表(SysApplicationAccount)实体类
|
||||
|
@ -132,6 +134,5 @@ public class SysApplicationAccountEntity extends BaseEntity {
|
|||
public void setAgentid(String agentid) {
|
||||
this.agentid = agentid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
,modify_time
|
||||
,sts
|
||||
,sorts
|
||||
,appId
|
||||
,app_id
|
||||
,name
|
||||
,ip_address
|
||||
,port
|
||||
|
@ -46,6 +46,14 @@
|
|||
,corpId
|
||||
,agentId
|
||||
</sql>
|
||||
|
||||
<select id="entity_get" parameterType="com.hzya.frame.sysnew.application.appAcount.entity.SysApplicationAccountEntity" resultMap="get-SysApplicationAccountEntity-result">
|
||||
select
|
||||
<include refid="SysApplicationAccountEntity_Base_Column_List"/>
|
||||
from sys_application_account
|
||||
where id = #{id}
|
||||
and sts = 'Y'
|
||||
</select>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysApplicationAccountEntity-result"
|
||||
parameterType="com.hzya.frame.sysnew.application.appAcount.entity.SysApplicationAccountEntity">
|
||||
|
@ -199,6 +207,7 @@
|
|||
<if test="appSecret != null and appSecret != ''">app_secret ,</if>
|
||||
<if test="corpid != null and corpid != ''">corpId ,</if>
|
||||
<if test="agentid != null and agentid != ''">agentId ,</if>
|
||||
<if test="appId != null and appId != ''">app_id ,</if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
|
@ -222,8 +231,10 @@
|
|||
<if test="appSecret != null and appSecret != ''">#{appSecret} ,</if>
|
||||
<if test="corpid != null and corpid != ''">#{corpid} ,</if>
|
||||
<if test="agentid != null and agentid != ''">#{agentid} ,</if>
|
||||
<if test="sorts == null ">COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_application_account a
|
||||
WHERE a.sts = 'Y' )1),
|
||||
<if test="appId != null and appId != ''">#{appId} ,</if>
|
||||
<if test="sorts == null ">
|
||||
COALESCE((select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_application_account a WHERE
|
||||
a.sts = 'Y' ),1),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
|
@ -284,6 +295,7 @@
|
|||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="dbType != null and dbType != ''">db_type = #{dbType},</if>
|
||||
<if test="appId != null and appId != ''">app_id = #{appId},</if>
|
||||
<if test="appKey != null and appKey != ''">app_key = #{appKey},</if>
|
||||
<if test="appSecret != null and appSecret != ''">app_secret = #{appSecret},</if>
|
||||
<if test="corpid != null and corpid != ''">corpId = #{corpid},</if>
|
||||
|
@ -318,6 +330,7 @@
|
|||
<if test="appKey != null and appKey != ''">and app_key = #{appKey}</if>
|
||||
<if test="appSecret != null and appSecret != ''">and app_secret = #{appSecret}</if>
|
||||
<if test="corpid != null and corpid != ''">and corpId = #{corpid}</if>
|
||||
<if test="appId != null and appId != ''">and app_id = #{appId}</if>
|
||||
<if test="agentid != null and agentid != ''">and agentId = #{agentid}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
|
|
|
@ -1,15 +1,21 @@
|
|||
package com.hzya.frame.sysnew.application.appAcount.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sysnew.application.appAcount.entity.SysApplicationAccountEntity;
|
||||
import com.hzya.frame.sysnew.application.appAcount.dao.ISysApplicationAccountDao;
|
||||
import com.hzya.frame.sysnew.application.appAcount.service.ISysApplicationAccountService;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 应用账户表(SysApplicationAccount)表服务实现类
|
||||
*
|
||||
|
@ -41,6 +47,11 @@ public class SysApplicationAccountServiceImpl extends BaseService<SysApplication
|
|||
}catch (Exception e){
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
//控制一下名字不能重复
|
||||
List<SysApplicationAccountEntity> queryList = queryByName(entity);
|
||||
if (CollectionUtils.isNotEmpty(queryList) && queryList.size() > 0){
|
||||
return BaseResult.getFailureMessageEntity(entity.getName()+"重复");
|
||||
}
|
||||
sysApplicationAccountDao.save(entity);
|
||||
return BaseResult.getSuccessMessageEntity("新增成功");
|
||||
}
|
||||
|
@ -53,7 +64,23 @@ public class SysApplicationAccountServiceImpl extends BaseService<SysApplication
|
|||
*/
|
||||
@Override
|
||||
public JsonResultEntity updateAccount(JSONObject object) {
|
||||
return null;
|
||||
SysApplicationAccountEntity entity = getData("jsonStr", object, SysApplicationAccountEntity.class);
|
||||
try {
|
||||
checkParam(entity,"update");
|
||||
}catch (Exception e){
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
//检查一下名字不能重复
|
||||
List<SysApplicationAccountEntity> queryList = queryByName(entity);
|
||||
if (CollectionUtils.isNotEmpty(queryList) && queryList.size() > 0){
|
||||
for (SysApplicationAccountEntity acc : queryList) {
|
||||
if (!acc.getId().equals(entity.getId())){
|
||||
return BaseResult.getFailureMessageEntity(entity.getName()+"重复");
|
||||
}
|
||||
}
|
||||
}
|
||||
sysApplicationAccountDao.update(entity);
|
||||
return BaseResult.getSuccessMessageEntity("更新成功");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -64,7 +91,14 @@ public class SysApplicationAccountServiceImpl extends BaseService<SysApplication
|
|||
*/
|
||||
@Override
|
||||
public JsonResultEntity deleteAccount(JSONObject object) {
|
||||
return null;
|
||||
SysApplicationAccountEntity entity = getData("jsonStr", object, SysApplicationAccountEntity.class);
|
||||
try {
|
||||
checkParam(entity,"delete");
|
||||
}catch (Exception e){
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
sysApplicationAccountDao.logicRemove(entity);
|
||||
return BaseResult.getSuccessMessageEntity("删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,7 +109,14 @@ public class SysApplicationAccountServiceImpl extends BaseService<SysApplication
|
|||
*/
|
||||
@Override
|
||||
public JsonResultEntity getAccount(JSONObject object) {
|
||||
return null;
|
||||
SysApplicationAccountEntity entity = getData("jsonStr", object, SysApplicationAccountEntity.class);
|
||||
try {
|
||||
checkParam(entity,"get");
|
||||
}catch (Exception e){
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
SysApplicationAccountEntity sysApplicationAccountEntity = sysApplicationAccountDao.get(entity.getId());
|
||||
return BaseResult.getSuccessMessageEntity("查询账户详情成功",sysApplicationAccountEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -86,7 +127,14 @@ public class SysApplicationAccountServiceImpl extends BaseService<SysApplication
|
|||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryAccountList(JSONObject object) {
|
||||
return null;
|
||||
SysApplicationAccountEntity entity = getData("jsonStr", object, SysApplicationAccountEntity.class);
|
||||
try {
|
||||
checkParam(entity,"queryList");
|
||||
}catch (Exception e){
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
List<SysApplicationAccountEntity> queryList = sysApplicationAccountDao.query(entity);
|
||||
return BaseResult.getSuccessMessageEntity("查询列表成功",queryList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -97,11 +145,43 @@ public class SysApplicationAccountServiceImpl extends BaseService<SysApplication
|
|||
*/
|
||||
@Override
|
||||
public JsonResultEntity queryAccountPaged(JSONObject object) {
|
||||
SysApplicationAccountEntity entity = getData("jsonStr", object, SysApplicationAccountEntity.class);
|
||||
try {
|
||||
checkParam(entity,"queryPaged");
|
||||
}catch (Exception e){
|
||||
return BaseResult.getFailureMessageEntity(e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
//根据账户名称查询
|
||||
private List<SysApplicationAccountEntity> queryByName(SysApplicationAccountEntity entity){
|
||||
if (StrUtil.isNotEmpty(entity.getName())){
|
||||
SysApplicationAccountEntity account = new SysApplicationAccountEntity();
|
||||
account.setName(entity.getName());
|
||||
List<SysApplicationAccountEntity> queryList = sysApplicationAccountDao.query(account);
|
||||
return queryList;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//数据检查
|
||||
private void checkParam(SysApplicationAccountEntity entity,String type){
|
||||
|
||||
Assert.notNull(entity,"参数不能为空");
|
||||
if ("save".equals(type)){
|
||||
Assert.notEmpty(entity.getAppId(),"appId不能为空");
|
||||
Assert.notEmpty(entity.getName(),"账户名称不能为空");
|
||||
}else if ("update".equals(type)){
|
||||
Assert.notEmpty(entity.getId(),"id不能为空");
|
||||
}else if ("delete".equals(type)){
|
||||
Assert.notEmpty(entity.getId(),"id不能为空");
|
||||
}else if ("get".equals(type)){
|
||||
Assert.notEmpty(entity.getId(),"id不能为空");
|
||||
}else if ("queryList".equals(type)){
|
||||
Assert.notEmpty(entity.getAppId(),"appId不能为空");
|
||||
}else if ("queryPaged".equals(type)){
|
||||
Assert.notNull(entity.getPageNum(),"pageNum不能为空");
|
||||
Assert.notNull(entity.getPageSize(),"pageSize不能为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.hzya.frame</groupId>
|
||||
<artifactId>kangarooDataCenterV3</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>fw-nifi</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>${revision}</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.hzya.frame</groupId>
|
||||
<artifactId>base-service</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>mysql</groupId>-->
|
||||
<!-- <artifactId>mysql-connector-java</artifactId>-->
|
||||
<!-- <version>${mysql-connector-java}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.ibm.jsonata4java</groupId>-->
|
||||
<!-- <artifactId>JSONata4Java</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<!-- <version>4.10.0</version>-->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<mainClass>none</mainClass> <!-- 取消查找本项目下的Main方法:为了解决Unable to find main class的问题 -->
|
||||
<classifier>execute</classifier> <!-- 为了解决依赖模块找不到此模块中的类或属性 -->
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -1,11 +0,0 @@
|
|||
//package com.hzya.frame.nifi;
|
||||
//
|
||||
//import org.springframework.boot.SpringApplication;
|
||||
//import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
//
|
||||
//@SpringBootApplication(scanBasePackages = "com.hzya.frame.nifi")
|
||||
//public class NifiApplication {
|
||||
// public static void main(String[] args) {
|
||||
// SpringApplication.run(NifiApplication.class, args);
|
||||
// }
|
||||
//}
|
|
@ -1,238 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.client;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.hzya.frame.nifiapi.config.NifiServiceConfig;
|
||||
import okhttp3.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/**
|
||||
* nifi客户端请求处理
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.client
|
||||
* @Project:fw-nifi
|
||||
* @name:NifiClient
|
||||
* @Date:2025/5/14 10:00
|
||||
* @Filename:NifiClient
|
||||
*/
|
||||
@Component
|
||||
public class NifiClient {
|
||||
|
||||
private final NifiServiceConfig config;
|
||||
private final OkHttpClient httpClient;
|
||||
private final ObjectMapper objectMapper;
|
||||
private final AtomicReference<String> accessToken = new AtomicReference<>();
|
||||
private volatile long tokenIssueTime; // Token 发行时间(毫秒)
|
||||
private volatile long tokenExpiration; // Token 过期时间(毫秒)
|
||||
Logger logger = LoggerFactory.getLogger(NifiClient.class);
|
||||
|
||||
@Autowired
|
||||
public NifiClient(NifiServiceConfig config, OkHttpClient httpClient, ObjectMapper objectMapper) {
|
||||
this.config = config;
|
||||
this.httpClient = httpClient;
|
||||
this.objectMapper = objectMapper;
|
||||
initializeToken();
|
||||
}
|
||||
|
||||
private void initializeToken() {
|
||||
try {
|
||||
accessToken.set(getAccessToken());
|
||||
tokenIssueTime = System.currentTimeMillis();
|
||||
tokenExpiration = tokenIssueTime + (12 * 60 * 60 * 1000); // 默认 12 小时
|
||||
logger.info("令牌已初始化,过期时间:" + new java.util.Date(tokenExpiration));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("初始化NiFi访问令牌失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public <T> T get(String path, Class<T> responseType) throws IOException {
|
||||
return executeRequestWithRetry(() -> {
|
||||
Request request = new Request.Builder().url(config.getApiUrl() + path).get().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||
return executeRequest(request, responseType);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取原始JSON响应字符串,不进行反序列化
|
||||
*/
|
||||
public String getRaw(String path) throws IOException {
|
||||
return executeRequestWithRetry(() -> {
|
||||
Request request = new Request.Builder().url(config.getApiUrl() + path).get().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||
try (Response response = httpClient.newCall(request).execute()) {
|
||||
if (!response.isSuccessful()) {
|
||||
throw new IOException("意外的响应码: " + response.code());
|
||||
}
|
||||
return response.body().string();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行GET请求并返回文件流,供调用者处理(如保存到文件或浏览器下载)
|
||||
*/
|
||||
public InputStream getAsStream(String path) throws IOException {
|
||||
return executeRequestWithRetry(() -> {
|
||||
Request request = new Request.Builder().url(config.getApiUrl() + path).get().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||
return executeStreamRequest(request);
|
||||
});
|
||||
}
|
||||
|
||||
public <T> T post(String path, Object requestBody, Class<T> responseType) throws IOException {
|
||||
String jsonBody = objectMapper.writeValueAsString(requestBody);
|
||||
RequestBody body = RequestBody.create(jsonBody, MediaType.get("application/json; charset=utf-8"));
|
||||
return executeRequestWithRetry(() -> {
|
||||
Request request = new Request.Builder().url(config.getApiUrl() + path).post(body).header("Authorization", "Bearer " + accessToken.get()).build();
|
||||
return executeRequest(request, responseType);
|
||||
});
|
||||
}
|
||||
|
||||
public <T> T delete(String path, Class<T> responseType) throws IOException {
|
||||
return executeRequestWithRetry(() -> {
|
||||
Request request = new Request.Builder().url(config.getApiUrl() + path).delete().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||
return executeRequest(request, responseType);
|
||||
});
|
||||
}
|
||||
|
||||
public <T> T delete(String path, Map<String, String> queryParams, Class<T> responseType) throws IOException {
|
||||
// 构建 URL 并添加查询参数
|
||||
HttpUrl.Builder urlBuilder = HttpUrl.parse(config.getApiUrl() + path).newBuilder();
|
||||
if (queryParams != null) {
|
||||
queryParams.forEach(urlBuilder::addQueryParameter);
|
||||
}
|
||||
String url = urlBuilder.build().toString();
|
||||
|
||||
return executeRequestWithRetry(() -> {
|
||||
Request request = new Request.Builder().url(url).delete().header("Authorization", "Bearer " + accessToken.get()).build();
|
||||
return executeRequest(request, responseType);
|
||||
});
|
||||
}
|
||||
|
||||
public <T> T put(String path, Object requestBody, Class<T> responseType) throws IOException {
|
||||
String jsonBody = objectMapper.writeValueAsString(requestBody);
|
||||
RequestBody body = RequestBody.create(jsonBody, MediaType.get("application/json; charset=utf-8"));
|
||||
return executeRequestWithRetry(() -> {
|
||||
Request request = new Request.Builder().url(config.getApiUrl() + path).put(body).header("Authorization", "Bearer " + accessToken.get()).build();
|
||||
return executeRequest(request, responseType);
|
||||
});
|
||||
}
|
||||
|
||||
private <T> T executeRequestWithRetry(IOExceptionRunnable<T> runnable) throws IOException {
|
||||
int maxRetries = 2;
|
||||
for (int attempt = 0; attempt < maxRetries; attempt++) {
|
||||
try {
|
||||
checkAndRefreshToken();
|
||||
return runnable.run();
|
||||
} catch (IOException e) {
|
||||
if (attempt == maxRetries - 1 || !isTokenExpiredError(e)) {
|
||||
throw e;
|
||||
}
|
||||
logger.info("令牌可能已过期,请刷新并重试...");
|
||||
try {
|
||||
accessToken.set(getAccessToken());
|
||||
tokenIssueTime = System.currentTimeMillis();
|
||||
tokenExpiration = tokenIssueTime + (12 * 60 * 60 * 1000); // 默认 12 小时
|
||||
} catch (Exception ex) {
|
||||
throw new IOException("刷新令牌失败: " + ex.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new IOException("已达到最大重试次数");
|
||||
}
|
||||
|
||||
private void checkAndRefreshToken() throws IOException {
|
||||
long currentTime = System.currentTimeMillis();
|
||||
if (currentTime > tokenExpiration - 300000) { // 提前 5 分钟刷新
|
||||
try {
|
||||
accessToken.set(getAccessToken());
|
||||
tokenIssueTime = System.currentTimeMillis();
|
||||
tokenExpiration = tokenIssueTime + (12 * 60 * 60 * 1000); // 默认 12 小时
|
||||
logger.info("令牌已刷新,到期时间: " + new java.util.Date(tokenExpiration));
|
||||
} catch (Exception e) {
|
||||
throw new IOException("刷新令牌失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isTokenExpiredError(IOException e) {
|
||||
// 判断是否为 401 错误(Token 过期)
|
||||
return e.getMessage().contains("401") || e.getMessage().contains("Unauthorized");
|
||||
}
|
||||
|
||||
private <T> T executeRequest(Request request, Class<T> responseType) throws IOException {
|
||||
try (Response response = httpClient.newCall(request).execute()) {
|
||||
String responseBody = response.body().string();
|
||||
logger.info("响应体:" + responseBody);
|
||||
if (!response.isSuccessful()) {
|
||||
throw new IOException(StrUtil.format("意外的响应码: {}", responseBody));
|
||||
}
|
||||
return objectMapper.readValue(responseBody, responseType);
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized String getAccessToken() throws Exception {
|
||||
// 创建信任所有证书的 OkHttpClient
|
||||
// OkHttpClient client = httpClient.newBuilder().sslSocketFactory(createTrustAllSslSocketFactory(), createTrustAllTrustManager()).hostnameVerifier((hostname, session) -> true).build();
|
||||
|
||||
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
|
||||
RequestBody body = RequestBody.create(mediaType, "username=" + config.getUsername() + "&password=" + config.getPassword());
|
||||
Request request = new Request.Builder().url(config.getApiUrl() + "/access/token").post(body).addHeader("Content-Type", "application/x-www-form-urlencoded").addHeader("Accept", "*/*").addHeader("User-Agent", "fw-nifi-client/1.0").addHeader("Connection", "keep-alive").build();
|
||||
|
||||
try (Response response = httpClient.newCall(request).execute()) {
|
||||
if (!response.isSuccessful()) {
|
||||
throw new IOException("获取访问令牌失败,响应码: " + response.code() + " - " + response.message());
|
||||
}
|
||||
byte[] bytes = response.body().bytes();
|
||||
String newToken = new String(bytes, StandardCharsets.UTF_8);
|
||||
return newToken;
|
||||
}
|
||||
}
|
||||
|
||||
// private SSLSocketFactory createTrustAllSslSocketFactory() throws Exception {
|
||||
// SSLContext sslContext = SSLContext.getInstance("SSL");
|
||||
// sslContext.init(null, new TrustManager[]{createTrustAllTrustManager()}, new SecureRandom());
|
||||
// return sslContext.getSocketFactory();
|
||||
// }
|
||||
|
||||
// private X509TrustManager createTrustAllTrustManager() {
|
||||
// return new X509TrustManager() {
|
||||
// @Override
|
||||
// public void checkClientTrusted(X509Certificate[] chain, String authType) {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void checkServerTrusted(X509Certificate[] chain, String authType) {
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public X509Certificate[] getAcceptedIssuers() {
|
||||
// return new X509Certificate[0];
|
||||
// }
|
||||
// };
|
||||
// }
|
||||
|
||||
private InputStream executeStreamRequest(Request request) throws IOException {
|
||||
Response response = httpClient.newCall(request).execute();
|
||||
if (!response.isSuccessful()) {
|
||||
String responseBody = response.body().string();
|
||||
response.close();
|
||||
throw new IOException("意外的响应码: " + responseBody);
|
||||
}
|
||||
return response.body().byteStream();
|
||||
}
|
||||
|
||||
// 功能接口,用于重试逻辑
|
||||
@FunctionalInterface
|
||||
private interface IOExceptionRunnable<T> {
|
||||
T run() throws IOException;
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.config;
|
||||
|
||||
import okhttp3.OkHttpClient;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* OkHttpClient配置类
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.config
|
||||
* @Project:fw-nifi
|
||||
* @name:HttpClientConfig
|
||||
* @Date:2025/5/14 11:45
|
||||
* @Filename:HttpClientConfig
|
||||
*/
|
||||
@Configuration
|
||||
public class HttpClientConfig {
|
||||
|
||||
@Bean
|
||||
public OkHttpClient okHttpClient() throws Exception {
|
||||
//调用nifi接口正常情况不会超过60秒的,目前遇到的接口1秒以内调用完毕
|
||||
return new OkHttpClient.Builder().sslSocketFactory(createTrustAllSslSocketFactory(), createTrustAllTrustManager()).hostnameVerifier((hostname, session) -> true).connectTimeout(60, TimeUnit.SECONDS) // 连接超时时间
|
||||
.readTimeout(60, TimeUnit.SECONDS) // 读取超时时间
|
||||
.writeTimeout(60, TimeUnit.SECONDS) // 写入超时时间
|
||||
.build();
|
||||
}
|
||||
|
||||
private SSLSocketFactory createTrustAllSslSocketFactory() throws Exception {
|
||||
SSLContext sslContext = SSLContext.getInstance("SSL");
|
||||
sslContext.init(null, new TrustManager[]{createTrustAllTrustManager()}, new SecureRandom());
|
||||
return sslContext.getSocketFactory();
|
||||
}
|
||||
|
||||
private X509TrustManager createTrustAllTrustManager() {
|
||||
return new X509TrustManager() {
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] chain, String authType) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] chain, String authType) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return new X509Certificate[0];
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.config;
|
||||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* jackson配置类
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.config
|
||||
* @Project:fw-nifi
|
||||
* @name:JacksonConfig
|
||||
* @Date:2025/5/14 11:54
|
||||
* @Filename:JacksonConfig
|
||||
*/
|
||||
@Configuration
|
||||
public class JacksonConfig {
|
||||
@Bean
|
||||
public ObjectMapper objectMapper() {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
// 自动注册模块
|
||||
objectMapper.findAndRegisterModules();
|
||||
// 忽略 JSON 中存在但实体类中缺少的字段
|
||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
return objectMapper;
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* nifi service配置类
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.config
|
||||
* @Project:fw-nifi
|
||||
* @name:NifiConfig
|
||||
* @Date:2025/5/14 09:59
|
||||
* @Filename:NifiConfig
|
||||
*/
|
||||
@Configuration
|
||||
@Data
|
||||
public class NifiServiceConfig {
|
||||
|
||||
@Value("${nifi.api.url:https://192.168.2.233:8443/nifi-api}")
|
||||
private String apiUrl;
|
||||
|
||||
@Value("${nifi.api.username:hzya}")
|
||||
private String username;
|
||||
|
||||
@Value("${nifi.api.password:hzya1314*nifi}")
|
||||
private String password;
|
||||
|
||||
@Value("${nifi.api.controllerModifymark:接口修改标记}")
|
||||
private String controllerModifyMark;
|
||||
|
||||
@Value("${nifi.api.relationshipMark:接口关系标记}")
|
||||
private String relationshipMark;
|
||||
|
||||
@Value("${nifi.api.relationshipMark:接口状态清理标记}")
|
||||
private String stateClearMark;
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.basemodel;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.joincreparamcontext.CreateParamContextJoin;
|
||||
import com.hzya.frame.nifiapi.model.joinfindneedmodifycontroller.FindNeedModifyController;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 基类封转创建应用操作公共的字段
|
||||
*
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joincreateoracleapp
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateOracleApp
|
||||
* @Date:2025/5/21 17:44
|
||||
* @Filename:CreateOracleApp
|
||||
*/
|
||||
@Data
|
||||
public class JoinBashModel {
|
||||
//实例化
|
||||
private String appProcessGroupId;
|
||||
private String parentProcessGroupId;
|
||||
private String copyTargetProcessGroupId;
|
||||
// private String copyTargetParentProcessGroupId;
|
||||
|
||||
//上下文
|
||||
private CreateParamContextJoin createParamContextJoin;
|
||||
|
||||
//控制器
|
||||
private FindNeedModifyController findNeedModifyController;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinbindparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2025-05-16 11:1:46
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class BindParameterContextsJoin11 {
|
||||
private Revision11 revision;
|
||||
private Component11 component;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinbindparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2025-05-16 11:1:46
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class Component11 {
|
||||
private String id;
|
||||
private ParameterContext11 parameterContext;
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinbindparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ParameterContext11 {
|
||||
private String id;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
/**
|
||||
* Copyright 2025 bejson.com
|
||||
*/
|
||||
package com.hzya.frame.nifiapi.model.joinbindparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2025-05-16 11:1:46
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class Revision11 {
|
||||
private String version;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincontrollerenabled;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincontrollerenabled
|
||||
* @Project:fw-nifi
|
||||
* @name:EnOrDiControllerServices
|
||||
* @Date:2025/5/16 16:54
|
||||
* @Filename:EnOrDiControllerServices
|
||||
*/
|
||||
@Data
|
||||
public class EnOrDiControllerServices12 {
|
||||
private String state;
|
||||
private Revision13 revision;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincontrollerenabled;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincontrollerenabled
|
||||
* @Project:fw-nifi
|
||||
* @name:ControllerServiceStatus
|
||||
* @Date:2025/5/16 16:54
|
||||
* @Filename:ControllerServiceStatus
|
||||
*/
|
||||
@Data
|
||||
public class Revision13 {
|
||||
private String version;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateconnection;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreateconnection
|
||||
* @Project:fw-nifi
|
||||
* @name:Component18
|
||||
* @Date:2025/5/19 15:39
|
||||
* @Filename:Component18
|
||||
*/
|
||||
@Data
|
||||
public class Component18 {
|
||||
private String id;
|
||||
private String parentGroupId;
|
||||
private String backPressureObjectThreshold;
|
||||
private String backPressureDataSizeThreshold;
|
||||
private String flowFileExpiration;
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateconnection;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreateconnection
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateConnection
|
||||
* @Date:2025/5/19 15:35
|
||||
* @Filename:CreateConnection
|
||||
*/
|
||||
@Data
|
||||
public class CreateConnection18 {
|
||||
private String id;
|
||||
private String sourceId;
|
||||
private String sourceGroupId;
|
||||
private String sourceType;
|
||||
private String destinationId;
|
||||
private String destinationGroupId;
|
||||
private String destinationType;
|
||||
private Revision18 revision;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateconnection;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreateconnection
|
||||
* @Project:fw-nifi
|
||||
* @name:Revision18
|
||||
* @Date:2025/5/19 15:36
|
||||
* @Filename:Revision18
|
||||
*/
|
||||
@Data
|
||||
public class Revision18 {
|
||||
private String version;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateconnections;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreateconnections
|
||||
* @Project:fw-nifi
|
||||
* @name:Component17
|
||||
* @Date:2025/5/19 11:58
|
||||
* @Filename:Component17
|
||||
*/
|
||||
@Data
|
||||
public class Component18 {
|
||||
private SourceOrDestination18 source;
|
||||
private SourceOrDestination18 destination;
|
||||
private List<String> selectedRelationships;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateconnections;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreateconnections
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateConnections
|
||||
* @Date:2025/5/19 11:56
|
||||
* @Filename:CreateConnections
|
||||
*/
|
||||
@Data
|
||||
public class CreateConnections18 {
|
||||
private Revision18 revision;
|
||||
private Component18 component;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateconnections;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreateconnections
|
||||
* @Project:fw-nifi
|
||||
* @name:Revision17
|
||||
* @Date:2025/5/19 11:56
|
||||
* @Filename:Revision17
|
||||
*/
|
||||
@Data
|
||||
public class Revision18 {
|
||||
private String version;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateconnections;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreateconnections
|
||||
* @Project:fw-nifi
|
||||
* @name:SourceOrDestination
|
||||
* @Date:2025/5/19 13:39
|
||||
* @Filename:SourceOrDestination
|
||||
*/
|
||||
@Data
|
||||
public class SourceOrDestination18 {
|
||||
private String id;
|
||||
private String groupId;
|
||||
private String type;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreatemysqlapp;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.basemodel.JoinBashModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joincreateoracleapp
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateOracleApp
|
||||
* @Date:2025/5/21 17:44
|
||||
* @Filename:CreateOracleApp
|
||||
*/
|
||||
@Data
|
||||
public class CreateMysqlApp extends JoinBashModel {
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateoracleapp;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.basemodel.JoinBashModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joincreateoracleapp
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateOracleApp
|
||||
* @Date:2025/5/21 17:44
|
||||
* @Filename:CreateOracleApp
|
||||
*/
|
||||
@Data
|
||||
public class CreateAppInstanceJoin extends JoinBashModel {
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateprocessconnection;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.joincreateconnections.CreateConnections18;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joincreateprocessconnection
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateProcessorConnections
|
||||
* @Date:2025/5/22 14:06
|
||||
* @Filename:CreateProcessorConnections
|
||||
*/
|
||||
@Data
|
||||
public class CreateProcessorConnections {
|
||||
private String processGroupsId;
|
||||
private List<CreateConnections18> createConnections18;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreateprocessorandupdateparam;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.resultprocessorsinfo.Component16;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joincerateprocessorandupdateparam
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateProcessorAndUpdateParam
|
||||
* @Date:2025/5/26 15:59
|
||||
* @Filename:CreateProcessorAndUpdateParam
|
||||
*/
|
||||
@Data
|
||||
public class CreateProcessorAndUpdateParamJoin {
|
||||
private String targetProcessorId;
|
||||
private String parentProcessGroupId;
|
||||
private String copyTargetProcessGroupId;
|
||||
private Component16 component;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreatetemp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joincreatetemp
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateTemplateJoin
|
||||
* @Date:2025/5/17 10:52
|
||||
* @Filename:CreateTemplateJoin
|
||||
*/
|
||||
@Data
|
||||
public class CreateTemplateJoin {
|
||||
private String name;
|
||||
private String description;
|
||||
private String snippetId;
|
||||
private String disconnectedNodeAcknowledged;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joincreparamcontext;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.joinparametercontexts.ParameterContextsJoin;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joincreparamcontext
|
||||
* @Project:fw-nifi
|
||||
* @name:CreateParamContextJoin
|
||||
* @Date:2025/5/22 08:58
|
||||
* @Filename:CreateParamContextJoin
|
||||
*/
|
||||
@Data
|
||||
public class CreateParamContextJoin {
|
||||
private ParameterContextsJoin parameterContextsJoin;
|
||||
private String processGroupsId;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinfindneedmodifycontroller;
|
||||
|
||||
import com.hzya.frame.nifiapi.model.joingetcontroller.ControllerService12;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joinfindneedmodifycontroller
|
||||
* @Project:fw-nifi
|
||||
* @name:FindNeedModifyController
|
||||
* @Date:2025/5/22 11:03
|
||||
* @Filename:FindNeedModifyController
|
||||
*/
|
||||
@Data
|
||||
public class FindNeedModifyController {
|
||||
private String processGroupId;
|
||||
private List<ControllerService12> needModifyController;
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joingetallcontrollerservice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joingetallcontrollerservice
|
||||
* @Project:fw-nifi
|
||||
* @name:Component19
|
||||
* @Date:2025/5/22 10:28
|
||||
* @Filename:Component19
|
||||
*/
|
||||
@Data
|
||||
public class Component19 {
|
||||
private String id;
|
||||
private String name;
|
||||
private String type;
|
||||
private String state;
|
||||
private String validationStatus;
|
||||
private String bulletinLevel;
|
||||
private String extensionMissing;
|
||||
private String comments;
|
||||
private Map<String, String> properties;
|
||||
private String persistsState;
|
||||
private String restricted;
|
||||
private String deprecated;
|
||||
private String multipleVersionsAvailable;
|
||||
private String supportsSensitiveDynamicProperties;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joingetallcontrollerservice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joingetallcontrollerservice
|
||||
* @Project:fw-nifi
|
||||
* @name:ControllerServices19
|
||||
* @Date:2025/5/22 10:15
|
||||
* @Filename:ControllerServices19
|
||||
*/
|
||||
@Data
|
||||
public class ControllerServices19 {
|
||||
private String id;
|
||||
private String uri;
|
||||
private Component19 component;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joingetallcontrollerservice;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author :liuyang
|
||||
* @Package :com.hzya.frame.nifiapi.model.joingetallcontrollerservice
|
||||
* @Project :fw-nifi
|
||||
* @name :GetAllController
|
||||
* @Date :2025/5/22 10:13
|
||||
* @Filename :GetAllController
|
||||
*/
|
||||
@Data
|
||||
public class GetAllController19 {
|
||||
private List<ControllerServices19> controllerServices;
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joingetcontroller;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joingetcontroller
|
||||
* @Project:fw-nifi
|
||||
* @name:Component11
|
||||
* @Date:2025/5/16 13:59
|
||||
* @Filename:Component11
|
||||
*/
|
||||
@Data
|
||||
public class Component12 {
|
||||
private String id;//随机字符串
|
||||
private String name;
|
||||
private String type;
|
||||
private String state;
|
||||
//每个不同类型的控制器服务对应的属性都不一样,这里就很坑
|
||||
private Map<String, String> properties;
|
||||
private String validationStatus;
|
||||
private String bulletinLevel;
|
||||
private String extensionMissing;
|
||||
private String comments;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joingetcontroller;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joingetcontroller
|
||||
* @Project:fw-nifi
|
||||
* @name:ControllerSerbices
|
||||
* @Date:2025/5/16 13:57
|
||||
* @Filename:ControllerSerbices
|
||||
*/
|
||||
@Data
|
||||
public class ControllerService12 {
|
||||
//控制器服务id
|
||||
private String id;
|
||||
private Revision12 revision;
|
||||
private Component12 component;
|
||||
//修改标记id
|
||||
private String modifyMarkId;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
//package com.hzya.frame.nifi.model.joingetcontroller;
|
||||
//
|
||||
//import lombok.Data;
|
||||
//
|
||||
///**
|
||||
// * @Author:liuyang
|
||||
// * @Package:com.hzya.frame.nifi.model.joingetcontroller
|
||||
// * @Project:fw-nifi
|
||||
// * @name:Properties11
|
||||
// * @Date:2025/5/16 14:00
|
||||
// * @Filename:Properties11
|
||||
// */
|
||||
//@Data
|
||||
//public class Properties11 {
|
||||
// private String databaseConnectionUrl;
|
||||
// private String databaseDriverClassName;
|
||||
// private String databaseDriverLocations;
|
||||
// private String databaseUser;
|
||||
// private String password;
|
||||
// private String maxWaitTime;
|
||||
// private String maxTotalConnections;
|
||||
// private String validationQuery;
|
||||
// private String dbcpMinIdleConns;
|
||||
//}
|
|
@ -1,16 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joingetcontroller;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joingetcontroller
|
||||
* @Project:fw-nifi
|
||||
* @name:Revision11
|
||||
* @Date:2025/5/16 13:58
|
||||
* @Filename:Revision11
|
||||
*/
|
||||
@Data
|
||||
public class Revision12 {
|
||||
private String version;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2025-05-14 18:33:21
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class Component3 {
|
||||
private String name;
|
||||
private List<Parameters2> parameters;
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Parameter2 {
|
||||
private String name;
|
||||
private String value;
|
||||
private boolean sensitive;
|
||||
private String description;
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ParameterContextsJoin {
|
||||
private Revision revision;
|
||||
private Component3 component;
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
/**
|
||||
* Copyright 2025 bejson.com
|
||||
*/
|
||||
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Parameters2 {
|
||||
private Parameter2 parameter;
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinparametercontexts;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Revision {
|
||||
private int version;
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Component7 {
|
||||
private String name;
|
||||
private Position7 position;
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifiapi.model.joinprocessgroups
|
||||
* @Project:fw-nifi
|
||||
* @name:Position7
|
||||
* @Date:2025/5/21 14:57
|
||||
* @Filename:Position7
|
||||
*/
|
||||
@Data
|
||||
public class Position7 {
|
||||
private String x;
|
||||
private String y;
|
||||
|
||||
public Position7() {
|
||||
}
|
||||
|
||||
public Position7(String x, String y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joinprocessgroups
|
||||
* @Project:fw-nifi
|
||||
* @name:ProcessGroupStatus
|
||||
* @Date:2025/5/15 10:43
|
||||
* @Filename:ProcessGroupStatus
|
||||
*/
|
||||
@Data
|
||||
public class ProcessGroupStatus {
|
||||
private String name;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joinprocessgroups
|
||||
* @Project:fw-nifi
|
||||
* @name:ProcessGroupsJoin
|
||||
* @Date:2025/5/15 10:43
|
||||
* @Filename:ProcessGroupsJoin
|
||||
*/
|
||||
@Data
|
||||
public class ProcessGroupsJoin {
|
||||
private Revision5 revision;
|
||||
// private ProcessGroupStatus status;
|
||||
private Component7 component;
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinprocessgroups;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Revision5 {
|
||||
private int version;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinsnippetinstance;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joinsnippetinstance
|
||||
* @Project:fw-nifi
|
||||
* @name:SnippetInstanceJoin
|
||||
* @Date:2025/5/17 14:21
|
||||
* @Filename:SnippetInstanceJoin
|
||||
*/
|
||||
@Data
|
||||
public class SnippetInstanceJoin {
|
||||
private String snippetId;
|
||||
private String originX;
|
||||
private String originY;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinsnippets;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joinsnippets
|
||||
* @Project:fw-nifi
|
||||
* @name:Snippet
|
||||
* @Date:2025/5/17 11:01
|
||||
* @Filename:Snippet
|
||||
*/
|
||||
@Data
|
||||
public class Snippet {
|
||||
private String parentGroupId;
|
||||
private Map<String, Map<String, String>> processGroups;
|
||||
private Map<String, Map<String, String>> processors;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinsnippets;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joinsnippets
|
||||
* @Project:fw-nifi
|
||||
* @name:SnippetsJoin
|
||||
* @Date:2025/5/17 11:00
|
||||
* @Filename:SnippetsJoin
|
||||
*/
|
||||
@Data
|
||||
public class SnippetsJoin {
|
||||
private Snippet snippet;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
/**
|
||||
* Copyright 2025 bejson.com
|
||||
*/
|
||||
package com.hzya.frame.nifiapi.model.joinstartorstopprocessgroup;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2025-05-16 10:47:3
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class Revision10 {
|
||||
private String version;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinstartorstopprocessgroup;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Auto-generated: 2025-05-16 10:47:3
|
||||
*
|
||||
* @author bejson.com (i@bejson.com)
|
||||
* @website http://www.bejson.com/java2pojo/
|
||||
*/
|
||||
@Data
|
||||
public class StartOrStopProcessGroupsInfoJoin10 {
|
||||
private String id;
|
||||
private String state;
|
||||
private Revision10 revision;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinupdateprocessor;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joinupdateprocessor
|
||||
* @Project:fw-nifi
|
||||
* @name:Revision17
|
||||
* @Date:2025/5/19 11:26
|
||||
* @Filename:Revision17
|
||||
*/
|
||||
@Data
|
||||
public class Revision17 {
|
||||
private String version;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.joinupdateprocessor;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.joinupdateprocessor
|
||||
* @Project:fw-nifi
|
||||
* @name:RunStatusOrStop
|
||||
* @Date:2025/5/19 11:25
|
||||
* @Filename:RunStatusOrStop
|
||||
*/
|
||||
@Data
|
||||
public class RunStatusOrStop17 {
|
||||
private String state;
|
||||
private Revision17 revision;
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.nifitemplates;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class NifiTemplates {
|
||||
private List<Templates> templates;
|
||||
private String generated;
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.nifitemplates;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Permissions {
|
||||
private String canRead;
|
||||
private String canWrite;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.nifitemplates;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Template {
|
||||
private String uri;
|
||||
private String id;
|
||||
private String groupId;
|
||||
private String name;
|
||||
private String description;
|
||||
private String timestamp;
|
||||
@JsonProperty("encoding-version")
|
||||
private String encodingVersion;
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.nifitemplates;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Templates {
|
||||
private String id;
|
||||
private Permissions permissions;
|
||||
private Template template;
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AggregateSnapshot {
|
||||
private String id;
|
||||
private String groupId;
|
||||
private String name;
|
||||
private String type;
|
||||
private String runStatus;
|
||||
private String executionNode;
|
||||
private String bytesRead;
|
||||
private String bytesWritten;
|
||||
private String read;
|
||||
private String written;
|
||||
private String flowFilesIn;
|
||||
private String bytesIn;
|
||||
private String input;
|
||||
private String flowFilesOut;
|
||||
private String bytesOut;
|
||||
private String output;
|
||||
private String taskCount;
|
||||
private String tasksDurationNanos;
|
||||
private String tasks;
|
||||
private String tasksDuration;
|
||||
private String activeThreadCount;
|
||||
private String terminatedThreadCount;
|
||||
private ProcessingPerformanceStatus processingPerformanceStatus;
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AllowableValue {
|
||||
private String displayName;
|
||||
private String value;
|
||||
private String description;
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AllowableValues {
|
||||
private AllowableValue allowableValue;
|
||||
private String canRead;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AttributesToIgnore {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AttributesToIgnoreRegex {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AttributesToLog {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AttributesToLogRegex {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String defaultValue;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Breadcrumb {
|
||||
private String id;
|
||||
private String name;
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Breadcrumb2 {
|
||||
private String id;
|
||||
private Permissions2 permissions;
|
||||
private Breadcrumb3 breadcrumb;
|
||||
private ParentBreadcrumb2 parentBreadcrumb;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:liuyang
|
||||
* @Package:com.hzya.frame.nifi.model.processgroupid
|
||||
* @Project:fw-nifi
|
||||
* @name:Breadcrumb3
|
||||
* @Date:2025/5/14 17:57
|
||||
* @Filename:Breadcrumb3
|
||||
*/
|
||||
@Data
|
||||
public class Breadcrumb3 {
|
||||
private String id;
|
||||
private String name;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Bulletin {
|
||||
private String id;
|
||||
private String category;
|
||||
private String groupId;
|
||||
private String sourceId;
|
||||
private String sourceName;
|
||||
private String level;
|
||||
private String message;
|
||||
private String timestamp;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Bulletins {
|
||||
private String id;
|
||||
private String groupId;
|
||||
private String sourceId;
|
||||
private String timestamp;
|
||||
private String canRead;
|
||||
private Bulletin bulletin;
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Bundle {
|
||||
private String group;
|
||||
private String artifact;
|
||||
private String version;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.hzya.frame.nifiapi.model.processgroupid;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class CharacterSet {
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String defaultValue;
|
||||
private String required;
|
||||
private String sensitive;
|
||||
private String dynamic;
|
||||
private String supportsEl;
|
||||
private String expressionLanguageScope;
|
||||
private List<String> dependencies;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue