File tree Expand file tree Collapse file tree 6 files changed +28
-5
lines changed
src/main/java/com/codingapi/springboot/framework/convert
springboot-starter-data-permission
springboot-starter-security-jwt Expand file tree Collapse file tree 6 files changed +28
-5
lines changed Original file line number Diff line number Diff line change 11
11
12
12
<groupId >com.codingapi.springboot</groupId >
13
13
<artifactId >springboot-parent</artifactId >
14
- <version >1.1.0 </version >
14
+ <version >1.1.1 </version >
15
15
16
16
<url >https://github.com/codingapi/springboot-framewrok</url >
17
17
<name >springboot-parent</name >
Original file line number Diff line number Diff line change 4
4
<parent >
5
5
<groupId >com.codingapi.springboot</groupId >
6
6
<artifactId >springboot-parent</artifactId >
7
- <version >1.1.0 </version >
7
+ <version >1.1.1 </version >
8
8
</parent >
9
9
<artifactId >springboot-example</artifactId >
10
10
Original file line number Diff line number Diff line change 6
6
<parent >
7
7
<artifactId >springboot-parent</artifactId >
8
8
<groupId >com.codingapi.springboot</groupId >
9
- <version >1.1.0 </version >
9
+ <version >1.1.1 </version >
10
10
</parent >
11
11
12
12
Original file line number Diff line number Diff line change 6
6
<parent >
7
7
<artifactId >springboot-parent</artifactId >
8
8
<groupId >com.codingapi.springboot</groupId >
9
- <version >1.1.0 </version >
9
+ <version >1.1.1 </version >
10
10
</parent >
11
11
12
12
<artifactId >springboot-starter-security-jwt</artifactId >
Original file line number Diff line number Diff line change 4
4
<parent >
5
5
<groupId >com.codingapi.springboot</groupId >
6
6
<artifactId >springboot-parent</artifactId >
7
- <version >1.1.0 </version >
7
+ <version >1.1.1 </version >
8
8
</parent >
9
9
<artifactId >springboot-starter</artifactId >
10
10
Original file line number Diff line number Diff line change
1
+ package com .codingapi .springboot .framework .convert ;
2
+
3
+ import org .springframework .beans .BeanUtils ;
4
+
5
+ import java .lang .reflect .InvocationTargetException ;
6
+
7
+ public class BeanConvertor {
8
+
9
+ public static <T ,S > T convert (S source , Class <T > clazz ){
10
+ if (source ==null ){
11
+ return null ;
12
+ }
13
+ T target = null ;
14
+ try {
15
+ target = clazz .getDeclaredConstructor ().newInstance ();
16
+ } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e ) {
17
+ return null ;
18
+ }
19
+ BeanUtils .copyProperties (source ,target );
20
+ return target ;
21
+ }
22
+
23
+ }
You can’t perform that action at this time.
0 commit comments