Skip to content

Commit

Permalink
Merge pull request #3 from lazycece/dev_java17_springboot3.x
Browse files Browse the repository at this point in the history
Dev java17 springboot3.x
  • Loading branch information
lazycece authored Nov 19, 2023
2 parents 7fd1091 + 54cb943 commit 68c5ccd
Show file tree
Hide file tree
Showing 33 changed files with 98 additions and 115 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

## Rapidf 是做什么的?

Rapidf (`Rapi`d `D`evelopment `F`ramework ) 是一个快速开发框架,其构思是将我们日常开发工作中业务低耦合相关的代码抽取并形成可复用、可迁移的组件资产。Rapidf 目前有如下组件:
Rapidf (`Rapi`d `D`evelopment `F`ramework ) 是一个快速开发框架,致力于将日常开发工作中业务低耦合相关代码抽取并形成可迁移的组件资产,以解决应用架构的规范性与易治理性。

Rapidf 目前有如下组件:

- rapidf-auapi:基于rapidf组件集成[AuApi](https://github.com/lazycece/au-api-spring-boot) 框架,开箱即用
- rapidf-dispatcher:基于应用六边形架构思想,实现入站适配器框架,支持服务处理器和门面服务两种模式
Expand All @@ -19,6 +21,15 @@ Rapidf (`Rapi`d `D`evelopment `F`ramework ) 是一个快速开发框架,其构
- rapidf-validation:hibernate-validation的扩展


## 环境依赖

Rapidf 环境依赖如下:

|Rapidf|Java|Spring Boot|
|---|---|---|
|1.x|1.8+|2.x|
|2.x|17+|3.x|

## 快速开始

完整的示例可以看 [rapidf-samples](https://github.com/lazycece/rapidf/tree/main/rapidf-samples).
Expand Down
15 changes: 13 additions & 2 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

## What does it do ?

Rapidf (`Rapi`d `D`development `F`ramework ) is a development framework. Its idea is to extract the code related to business
low coupling in our daily development work and form reusable and portable component assets. Rapidf currently has the following components:
Rapidf (`Rapi`d `D`development `F`ramework ) is a development framework. Committed to extracting business low-coupling related codes in daily development work and forming portable component assets to solve the standardization and manageability of application architecture.

Rapidf currently has the following components:

- rapidf-auapi: Based on rapidf component integration [AuApi](https://github.com/lazycece/au-api-spring-boot) framework, out of the box
- rapidf-dispatcher:Based on the application of the hexagonal architecture idea, the inbound adapter framework is implemented, and two modes of service handler and facade service are supported
Expand All @@ -20,6 +21,16 @@ low coupling in our daily development work and form reusable and portable compon
- rapidf-validation: Extension of hibernate-validation


## Environment

Rapidf environment dependency as follow::

|Rapidf|Java|Spring Boot|
|---|---|---|
|1.x|1.8+|2.x|
|2.x|17+|3.x|


## Quick Start

Complete example can view [rapidf-samples](https://github.com/lazycece/rapidf/tree/main/rapidf-samples).
Expand Down
51 changes: 15 additions & 36 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

<properties>
<!-- Project revision -->
<revision>1.4.0</revision>
<revision>2.0.0</revision>
<!-- Encoding -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand All @@ -65,50 +65,25 @@
<maven.deploy.skip>false</maven.deploy.skip>
<maven.javadoc.skip>false</maven.javadoc.skip>
<!-- Compiler settings properties -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<!-- Maven plugin -->
<maven.compiler.plugin.version>3.6.2</maven.compiler.plugin.version>
<maven.surefire.plugin.version>2.22.1</maven.surefire.plugin.version>
<maven.source.plugin.version>3.0.1</maven.source.plugin.version>
<maven.deploy.plugin.version>2.8.2</maven.deploy.plugin.version>
<maven.javadoc.plugin.version>2.10.4</maven.javadoc.plugin.version>
<maven.javadoc.plugin.version>3.5.0</maven.javadoc.plugin.version>
<maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
<flatten.maven.plugin.version>1.2.7</flatten.maven.plugin.version>
</properties>

<profiles>
<profile>
<id>jdk1.8</id>
<id>jdk17</id>
<activation>
<jdk>[1.8,)</jdk>
<jdk>[17,)</jdk>
<activeByDefault>true</activeByDefault>
</activation>
<!-- Disable doclint under JDK 8 -->
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.plugin.version}</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</plugins>
</reporting>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.plugin.version}</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release</id>
Expand Down Expand Up @@ -182,12 +157,16 @@
<version>${maven.javadoc.plugin.version}</version>
<configuration>
<skip>${maven.javadoc.skip}</skip>
<tags>
<tag>
<name>date</name>
</tag>
</tags>
<additionalJOption>-tag date</additionalJOption>
<locale>en_US</locale>
<charset>UTF-8</charset>
<encoding>UTF-8</encoding>
<docencoding>UTF-8</docencoding>
<source>${maven.compiler.source}</source>
<links>
<link>http://docs.oracle.com/javase/17/docs/api</link>
</links>
<doclint>none</doclint>
</configuration>
<executions>
<execution>
Expand Down
19 changes: 15 additions & 4 deletions rapidf-components/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@

<properties>
<slf4j.version>2.0.5</slf4j.version>
<spring.boot.version>2.5.6</spring.boot.version>
<spring.version>5.3.12</spring.version>
<hibernate-validator.version>6.2.0.Final</hibernate-validator.version>
<validation-api.version>2.0.2</validation-api.version>
<spring.boot.version>3.1.5</spring.boot.version>
<spring.version>6.0.13</spring.version>
<hibernate-validator.version>8.0.1.Final</hibernate-validator.version>
<validation-api.version>3.0.2</validation-api.version>
<servlet.api.version>5.0.0</servlet.api.version>
</properties>

<dependencyManagement>
Expand All @@ -56,6 +57,11 @@
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
Expand All @@ -66,6 +72,11 @@
<artifactId>jakarta.validation-api</artifactId>
<version>${validation-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${servlet.api.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
8 changes: 3 additions & 5 deletions rapidf-components/rapidf-auapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
<description>${project.name}</description>

<properties>
<au-api-spring-boot.version>1.0.2</au-api-spring-boot.version>
<servlet.api.version>3.1.0</servlet.api.version>
<au-api-spring-boot.version>2.0.0</au-api-spring-boot.version>
</properties>

<dependencies>
Expand All @@ -57,9 +56,8 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet.api.version}</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.lazycece.rapidf.auapi.configuration.AuApiConfiguration
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import com.lazycece.rapidf.dispatcher.core.service.Handler;
import com.lazycece.rapidf.dispatcher.core.service.QueryHandler;
import com.lazycece.rapidf.dispatcher.exception.DispatchException;
import sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl;

import java.lang.reflect.ParameterizedType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -51,9 +51,9 @@ public static boolean isExpectedServiceHandler(Class<?> clazz) {

public static Class<?> getRequestClass(Class<?> clazz) {
String className = Arrays.stream(clazz.getGenericInterfaces())
.filter(type -> type instanceof ParameterizedTypeImpl)
.map(type -> (ParameterizedTypeImpl) type)
.filter(parameterizedType -> SERVICE_SPEC_INTERFACES.contains(parameterizedType.getRawType()))
.filter(type -> type instanceof ParameterizedType)
.map(type -> (ParameterizedType) type)
.filter(parameterizedType -> SERVICE_SPEC_INTERFACES.contains((Class<?>) parameterizedType.getRawType()))
.map(parameterizedType -> parameterizedType.getActualTypeArguments()[1].getTypeName())
.findFirst()
.orElseThrow(() -> new DispatchException("There is no request class."));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package com.lazycece.rapidf.dispatcher.helper;

import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.ValidationException;
import javax.validation.Validator;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validation;
import jakarta.validation.ValidationException;
import jakarta.validation.Validator;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.lazycece.rapidf.dispatcher.configuration.DispatcherAutoConfiguration

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.lazycece.rapidf.domain.configuration.DomainAutoConfiguration
5 changes: 0 additions & 5 deletions rapidf-components/rapidf-logger/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
<name>Rapidf Logger</name>
<description>${project.name}</description>

<properties>
<spring.aop>5.3.13</spring.aop>
</properties>

<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -43,7 +39,6 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.aop}</version>
<optional>true</optional>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ExceptionHandler;

import javax.validation.ValidationException;
import jakarta.validation.ValidationException;

import java.util.List;
import java.util.stream.Collectors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ExceptionHandler;

import javax.validation.ValidationException;
import jakarta.validation.ValidationException;

import java.util.List;
import java.util.stream.Collectors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import com.lazycece.rapidf.validation.validator.EnumValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@

import com.lazycece.rapidf.validation.constraints.Enum;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

import java.lang.reflect.Method;

/**
Expand Down
2 changes: 1 addition & 1 deletion rapidf-samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.5.6</version>
<version>3.1.5</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;

/**
* @author lazycece
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotBlank;

/**
* @author lazycece
Expand Down
5 changes: 0 additions & 5 deletions rapidf-samples/rapidf-dispatcher-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

/**
* @author lazycece
* @date 2023/7/17
*/
@SpringBootApplication
//@ComponentScan(basePackages = "com.lazycece.rapidf.dispatcher")
public class RapidfDispatcherSampleApplication {
public static void main(String[] args) {
SpringApplication.run(RapidfDispatcherSampleApplication.class, args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotBlank;

/**
* @author lazycece
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotBlank;

/**
* @author lazycece
Expand Down
Loading

0 comments on commit 68c5ccd

Please sign in to comment.