1
0

增加配置文件

This commit is contained in:
2025-01-03 11:57:30 +08:00
parent 53ab0d731c
commit eff6d6be02
9 changed files with 99 additions and 27 deletions

View File

@@ -23,6 +23,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>

View File

@@ -0,0 +1,18 @@
package com.lanyuanxiaoyao.flowable.jpa;
import com.lanyuanxiaoyao.flowable.core.manager.FlowableConfiguration;
import lombok.ToString;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
/**
* 配置类
*
* @author lanyuanxiaoyao
* @version 20250103
*/
@ToString(callSuper = true)
@Configuration
@ConfigurationProperties("flowable")
public class SpringFlowableConfiguration extends FlowableConfiguration {
}

View File

@@ -1,5 +1,6 @@
package com.lanyuanxiaoyao.flowable.jpa;
import com.lanyuanxiaoyao.flowable.core.manager.FlowableConfiguration;
import com.lanyuanxiaoyao.flowable.core.manager.FlowableManager;
import com.lanyuanxiaoyao.flowable.core.repository.FlowableRepository;
import java.util.UUID;
@@ -17,8 +18,9 @@ import org.springframework.stereotype.Service;
public class SpringFlowableManager extends FlowableManager {
private final ApplicationContext applicationContext;
public SpringFlowableManager(FlowableRepository flowableRepository, ApplicationContext applicationContext) {
super(flowableRepository, () -> UUID.randomUUID().toString());
public SpringFlowableManager(FlowableConfiguration configuration, FlowableRepository repository, ApplicationContext applicationContext) {
super(configuration, repository);
log.info("Configuration: {}", configuration);
this.applicationContext = applicationContext;
}
@@ -38,4 +40,9 @@ public class SpringFlowableManager extends FlowableManager {
}
return targetObject;
}
@Override
protected String createId() {
return UUID.randomUUID().toString();
}
}