♻️ Decouple project from Spring and MyBatis frameworks for imp… #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
概述
改动点:新增turbo-mybatis-plus、turbo-spring-boot-starter模块,将turbo中spring、mybatis等依赖解偶掉。spring、mybatis等依赖作为可选实现供用户引入。用户也可以根据实际情况做不同的实现,例如:solon、jpa等。同时移除掉部分非必需的依赖(例如多数据源依赖)。减轻了项目依赖,模块化的实现便于后续升级java以及底层组件版本(turbo中spring bot版本还是1.5...)
必要性: turbo定位为轻量级的Java实现的流程引擎,通过内嵌的形式提供给用户使用,通常情况下用户都会与现有的系统进行集成,但是turbo现有实现中强耦合了spring以及mybatis,导致用户在使用过程中出现与现有系统不兼容的情况,例如:
期待一个脱离Springboot框架的完全独立的,可用在其他框架上的turbo、
turbo是否只支持mysql 、
高度偶和的架构实现带来了众多问题,例如底层组件升级上的困难,例如:
JDK17不兼容报错、
目前不支持springboot3、
请求支持JDK 17,或者提供在JDK 17中运行的替代方案、
是否经过测试:本地jdk8环境经过完整测试。
以下是github copilot生成的变更描述,仅供参考:
This pull request includes various changes across multiple files to improve the configuration, dependencies, and code structure of the project. The most important changes include the use of placeholders for versioning, updates to dependency imports, and modifications to the database configuration.
Dependency and Configuration Updates:
demo/pom.xml
: Replaced hardcoded version numbers with${revision}
placeholders for better version management. Updated theturbo.engine.version
property and added new dependencies.engine/pom.xml
: Replaced hardcoded version numbers with${revision}
placeholders and updated dependencies, including removal of several Spring Boot dependencies and addition ofcommons-beanutils
.Code Refactoring and Imports:
demo/src/main/java/com/didiglobal/turbo/demo/DemoApplication.java
: Changed import fromcom.didiglobal.turbo.engine.annotation.EnableTurboEngine
tocom.didiglobal.turbo.spring.annotation.EnableTurboEngine
.demo/src/main/java/com/didiglobal/turbo/demo/service/FlowServiceImpl.java
: Updated imports and replaced DAO and entity classes with theirmybatis
equivalents. [1] [2] [3] [4] [5]Database Configuration Changes:
demo/src/main/resources/application.properties
: Simplified the database configuration by removing dynamic datasource settings and updating the MySQL driver class name.demo/src/test/resources/application.properties
: Removed H2 database configuration and related properties.Test Enhancements:
demo/src/test/java/com/didiglobal/turbo/demo/FlowControllerTest.java
: Added method calls to ensure proper flow creation, saving, and deployment in the test methods. [1] [2] [3] [4]Code Cleanup:
engine/src/main/java/com/didiglobal/turbo/engine/common/RedisConstants.java
: Removed theRedisConstants
class as it was no longer needed.engine/src/main/java/com/didiglobal/turbo/engine/config/BusinessConfig.java
: RefactoredBusinessConfig
from a class to an interface and updated the method signature. [1] [2]