Skip to content

Commit 10c2716

Browse files
author
kaiqin
committed
初始化代码
0 parents  commit 10c2716

File tree

10 files changed

+577
-0
lines changed

10 files changed

+577
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/.idea/*
2+
*.iml
3+
/target/*
4+
rebel.xml
5+
*.log

pom.xml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xmlns="http://maven.apache.org/POM/4.0.0"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
6+
<groupId>ooo176.github.io</groupId>
7+
<artifactId>spring-boot-starter-dm</artifactId>
8+
<version>1.0-SNAPSHOT</version>
9+
<modelVersion>4.0.0</modelVersion>
10+
<properties>
11+
<!--项目permission所有依赖版本-->
12+
<permission-lib.version>3.1.4</permission-lib.version>
13+
14+
<!--log4j最新版本,修改log4j漏洞,验证分保-->
15+
<log4j.version>2.17.2</log4j.version>
16+
<elasticsearch.version>5.6.10</elasticsearch.version>
17+
<java.version>1.8</java.version>
18+
<spring.boot.version>2.3.6.RELEASE</spring.boot.version>
19+
<spring.cloud.version>Hoxton.SR9</spring.cloud.version>
20+
<spring-cloud-alibaba-dependencies.version>2.2.3.RELEASE</spring-cloud-alibaba-dependencies.version>
21+
<nacos.version>1.4.0</nacos.version>
22+
<spring-boot-admin.version>2.3.1</spring-boot-admin.version>
23+
<druid.version>1.2.3</druid.version>
24+
<mysql.version>8.0.22</mysql.version>
25+
<mybatis.version>3.5.6</mybatis.version>
26+
<mybatis-spring.version>2.0.6</mybatis-spring.version>
27+
<mybatis.typehandlers.version>1.0.2</mybatis.typehandlers.version>
28+
<mybatisplus.version>3.4.1</mybatisplus.version>
29+
<jasypt.version>2.1.0</jasypt.version>
30+
<p6spy.version>3.9.1</p6spy.version>
31+
<fastjson.version>1.2.75</fastjson.version>
32+
<transmittable-thread-local.version>2.12.0</transmittable-thread-local.version>
33+
<knife4j.version>2.0.8</knife4j.version>
34+
<springfox.version>2.10.5</springfox.version>
35+
<swagger-models.version>1.5.22</swagger-models.version>
36+
<dozer.version>6.5.0</dozer.version>
37+
<easy-captcha.version>1.6.2</easy-captcha.version>
38+
<easypoi.version>4.2.0</easypoi.version>
39+
<poi.version>4.1.1</poi.version>
40+
<guava.version>22.0</guava.version>
41+
<commons-exec.version>1.3</commons-exec.version>
42+
<commons-email.version>1.5</commons-email.version>
43+
<commons.collections4.version>4.4</commons.collections4.version>
44+
<commons.collections.version>3.2.2</commons.collections.version>
45+
<commons-lang.version>2.6</commons-lang.version>
46+
<commons-io.version>2.8.0</commons-io.version>
47+
<asm.version>5.0.4</asm.version>
48+
<jjwt.version>0.11.2</jjwt.version>
49+
<tobato-fastdfs-client.version>1.27.2</tobato-fastdfs-client.version>
50+
<qcloudsms.version>1.1.0</qcloudsms.version>
51+
<apache.xmlgraphics.version>1.7</apache.xmlgraphics.version>
52+
<lombok.version>1.18.16</lombok.version>
53+
<slf4j.version>1.7.30</slf4j.version>
54+
<hutool.version>5.5.2</hutool.version>
55+
<antisamy.version>1.5.10</antisamy.version>
56+
<caffeine.version>2.8.6</caffeine.version>
57+
<ip2region.version>1.7.2</ip2region.version>
58+
<bitwalker.version>1.21</bitwalker.version>
59+
<gson.version>2.8.2</gson.version>
60+
<jsoup.version>1.11.3</jsoup.version>
61+
62+
<JustAuth.version>1.13.2</JustAuth.version>
63+
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
64+
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
65+
<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
66+
<maven-javadoc-plugin.version>3.0.0</maven-javadoc-plugin.version>
67+
<dockerfile-maven-plugin.version>1.4.12</dockerfile-maven-plugin.version>
68+
<spring-boot-maven-plugin.version>2.2.6.RELEASE</spring-boot-maven-plugin.version>
69+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
70+
71+
<minio.version>6.0.11</minio.version>
72+
<google.http-client.version>1.24.1</google.http-client.version>
73+
<dm.version>1.8.0</dm.version>
74+
</properties>
75+
76+
<dependencies>
77+
<dependency>
78+
<groupId>org.springframework.boot</groupId>
79+
<artifactId>spring-boot-actuator-autoconfigure</artifactId>
80+
<version>${spring.boot.version}</version>
81+
</dependency>
82+
<dependency>
83+
<groupId>org.springframework.boot</groupId>
84+
<artifactId>spring-boot-configuration-processor</artifactId>
85+
<optional>true</optional>
86+
<version>${spring.boot.version}</version>
87+
</dependency>
88+
<dependency>
89+
<groupId>org.mybatis</groupId>
90+
<artifactId>mybatis</artifactId>
91+
<version>${mybatis.version}</version>
92+
</dependency>
93+
<dependency>
94+
<groupId>com.baomidou</groupId>
95+
<artifactId>mybatis-plus-boot-starter</artifactId>
96+
<version>${mybatisplus.version}</version>
97+
</dependency>
98+
<dependency>
99+
<groupId>org.projectlombok</groupId>
100+
<artifactId>lombok</artifactId>
101+
<version>${lombok.version}</version>
102+
</dependency>
103+
104+
<dependency>
105+
<groupId>com.dm</groupId>
106+
<artifactId>DmJdbcDriver</artifactId>
107+
<version>${dm.version}</version>
108+
</dependency>
109+
</dependencies>
110+
111+
<build>
112+
<plugins>
113+
<plugin>
114+
<groupId>org.apache.maven.plugins</groupId>
115+
<artifactId>maven-compiler-plugin</artifactId>
116+
<version>${maven-compiler-plugin.version}</version>
117+
<configuration>
118+
<source>${java.version}</source>
119+
<target>${java.version}</target>
120+
<encoding>${project.build.sourceEncoding}</encoding>
121+
</configuration>
122+
</plugin>
123+
<plugin>
124+
<groupId>org.apache.maven.plugins</groupId>
125+
<artifactId>maven-source-plugin</artifactId>
126+
<version>3.0.0</version>
127+
<configuration>
128+
<attach>true</attach>
129+
</configuration>
130+
<executions>
131+
<execution>
132+
<phase>compile</phase>
133+
<goals>
134+
<goal>jar</goal>
135+
</goals>
136+
</execution>
137+
</executions>
138+
</plugin>
139+
<plugin>
140+
<groupId>org.apache.maven.plugins</groupId>
141+
<artifactId>maven-deploy-plugin</artifactId>
142+
<configuration>
143+
<skip>true</skip>
144+
</configuration>
145+
</plugin>
146+
</plugins>
147+
</build>
148+
</project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package ooo.github.io.dm;
2+
3+
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
4+
import org.springframework.context.annotation.ComponentScan;
5+
import org.springframework.context.annotation.Configuration;
6+
7+
8+
/**
9+
* 达梦自动装配类
10+
*
11+
* @author qinkai
12+
*/
13+
@Configuration
14+
@ConditionalOnExpression("#{'${db.type}'.equals('dm') or '${db.type}'.equals('dm')}")
15+
@ComponentScan("ooo.github.io")
16+
public class DmAutoConfiguration {
17+
18+
19+
}
20+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package ooo.github.io.dm.convert;
2+
3+
import org.apache.ibatis.session.SqlSessionFactory;
4+
import org.apache.ibatis.type.TypeHandlerRegistry;
5+
import org.springframework.beans.BeansException;
6+
import org.springframework.context.ApplicationContext;
7+
import org.springframework.context.ApplicationContextAware;
8+
import org.springframework.stereotype.Component;
9+
10+
import java.time.LocalDate;
11+
import java.time.LocalDateTime;
12+
13+
/**
14+
* 达梦数据库兼容LocalDateTime
15+
* <p>
16+
* https://blog.csdn.net/imyc7/article/details/118824310
17+
*
18+
* @author kaiqin
19+
*/
20+
@Component
21+
public class CustomTypeHandlerParser implements ApplicationContextAware {
22+
23+
@Override
24+
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
25+
//从spring容器获取sqlSessionFactory
26+
SqlSessionFactory sqlSessionFactory = applicationContext.getBean(SqlSessionFactory.class);
27+
//获取typeHandler注册器
28+
TypeHandlerRegistry typeHandlerRegistry = sqlSessionFactory.getConfiguration().getTypeHandlerRegistry();
29+
//注册typeHandler
30+
typeHandlerRegistry.register(LocalDateTime.class, LocalDateTimeTypeHandler.class);
31+
typeHandlerRegistry.register(LocalDate.class, LocalDateTypeHandler.class);
32+
}
33+
}
34+

0 commit comments

Comments
 (0)