✨ init
This commit is contained in:
commit
72ff5d0d8d
|
@ -0,0 +1,33 @@
|
||||||
|
HELP.md
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
|
@ -0,0 +1,28 @@
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>common</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>common-utils</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>common-utils</name>
|
||||||
|
<url>https://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,21 @@
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>java-template</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<artifactId>common</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<name>common Maven Webapp</name>
|
||||||
|
<url>https://maven.apache.org</url>
|
||||||
|
<modules>
|
||||||
|
<module>service-utils</module>
|
||||||
|
<module>common-utils</module>
|
||||||
|
<module>spring-security</module>
|
||||||
|
</modules>
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,55 @@
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>common</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>service-utils</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>service-utils</name>
|
||||||
|
<url>https://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>model</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- redis -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- redisson 分布式锁-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.redisson</groupId>
|
||||||
|
<artifactId>redisson</artifactId>
|
||||||
|
<version>3.26.1</version>
|
||||||
|
</dependency>
|
||||||
|
<!--mysql-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!--mybatis-plus-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- mysql连接池 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zaxxer</groupId>
|
||||||
|
<artifactId>HikariCP</artifactId>
|
||||||
|
<version>5.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,33 @@
|
||||||
|
package cn.bunny.common.service.config;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.DbType;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
|
@EnableTransactionManagement
|
||||||
|
@MapperScan("cn.bunny.service.mapper")
|
||||||
|
@Configuration
|
||||||
|
@Slf4j
|
||||||
|
public class MybatisPlusConfig {
|
||||||
|
@Bean
|
||||||
|
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||||
|
log.info("注入Mybatis-Plus配置...");
|
||||||
|
|
||||||
|
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||||
|
// 分页插件
|
||||||
|
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
|
||||||
|
// 乐观锁
|
||||||
|
interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
|
||||||
|
// 防止全表删除
|
||||||
|
interceptor.addInnerInterceptor(new BlockAttackInnerInterceptor());
|
||||||
|
|
||||||
|
return interceptor;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>common</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>spring-security</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>spring-security</name>
|
||||||
|
<url>https://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,19 @@
|
||||||
|
22:13:48:146 INFO 6108 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Starting ServiceApplication using Java 21.0.2 with PID 6108 (G:\web项目\Bunny-Cli\Java\java-template\service\target\classes started by 13199 in G:\web项目\Bunny-Cli\Java\java-template)
|
||||||
|
22:13:48:146 INFO 6108 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : The following 1 profile is active: "dev"
|
||||||
|
22:13:48:409 INFO 6108 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode
|
||||||
|
22:13:48:410 INFO 6108 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
|
||||||
|
22:13:48:423 INFO 6108 --- [bunny-service] [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 5 ms. Found 0 Redis repository interfaces.
|
||||||
|
22:13:48:630 INFO 6108 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8800 (http)
|
||||||
|
22:13:48:635 INFO 6108 --- [bunny-service] [main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
|
||||||
|
22:13:48:635 INFO 6108 --- [bunny-service] [main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.20]
|
||||||
|
22:13:48:664 INFO 6108 --- [bunny-service] [main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
|
||||||
|
22:13:48:664 INFO 6108 --- [bunny-service] [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 497 ms
|
||||||
|
22:13:49:073 WARN 6108 --- [bunny-service] [main] .s.s.UserDetailsServiceAutoConfiguration :
|
||||||
|
|
||||||
|
Using generated security password: 8d911c70-0398-4b8f-b5e7-b50ff6bc614e
|
||||||
|
|
||||||
|
This generated password is for development use only. Your security configuration must be updated before running your application in production.
|
||||||
|
|
||||||
|
22:13:49:116 INFO 6108 --- [bunny-service] [main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@2acb1264, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@30a01dd8, org.springframework.security.web.context.SecurityContextHolderFilter@1c8e8fed, org.springframework.security.web.header.HeaderWriterFilter@17df689e, org.springframework.web.filter.CorsFilter@1f68e4e8, org.springframework.security.web.csrf.CsrfFilter@78f5cbc5, org.springframework.security.web.authentication.logout.LogoutFilter@3cad24ae, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@2f6e92ca, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@1e8bccfb, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@47b4ac83, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@56299b0e, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@713e7d9a, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@681d704e, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@351ede23, org.springframework.security.web.access.ExceptionTranslationFilter@5d58dc61, org.springframework.security.web.access.intercept.AuthorizationFilter@6b7c4734]
|
||||||
|
22:13:49:145 INFO 6108 --- [bunny-service] [main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port 8800 (http) with context path ''
|
||||||
|
22:13:49:149 INFO 6108 --- [bunny-service] [main] cn.bunny.service.ServiceApplication : Started ServiceApplication in 1.229 seconds (process running for 1.545)
|
|
@ -0,0 +1,44 @@
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>java-template</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>model</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>model</name>
|
||||||
|
<url>https://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.fastjson2</groupId>
|
||||||
|
<artifactId>fastjson2</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.security</groupId>
|
||||||
|
<artifactId>spring-security-test</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,84 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>3.2.5</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>java-template</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<name>java-template</name>
|
||||||
|
<description>java-template</description>
|
||||||
|
|
||||||
|
<modules>
|
||||||
|
<module>common</module>
|
||||||
|
<module>model</module>
|
||||||
|
<module>service</module>
|
||||||
|
</modules>
|
||||||
|
<properties>
|
||||||
|
<java.version>21</java.version>
|
||||||
|
<mybatis-plus.version>3.5.6</mybatis-plus.version>
|
||||||
|
<mysql.version>8.0.33</mysql.version>
|
||||||
|
<knife4j.version>3.0.3</knife4j.version>
|
||||||
|
<fastjson2.version>2.0.47</fastjson2.version>
|
||||||
|
<minio.version>8.4.3</minio.version>
|
||||||
|
<lombok.version>1.18.32</lombok.version>
|
||||||
|
<easyexcel.version>3.3.3</easyexcel.version>
|
||||||
|
<jodatime.version>2.10.1</jodatime.version>
|
||||||
|
</properties>
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<!-- mybatis-plus -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
<version>${mybatis-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- mysql -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>${mysql.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- knife4j -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||||
|
<version>${knife4j.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- fastjson2 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.fastjson2</groupId>
|
||||||
|
<artifactId>fastjson2</artifactId>
|
||||||
|
<version>${fastjson2.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- minio -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.minio</groupId>
|
||||||
|
<artifactId>minio</artifactId>
|
||||||
|
<version>${minio.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- lombok -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>${lombok.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>easyexcel</artifactId>
|
||||||
|
<version>${easyexcel.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>joda-time</groupId>
|
||||||
|
<artifactId>joda-time</artifactId>
|
||||||
|
<version>${jodatime.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
</project>
|
|
@ -0,0 +1,21 @@
|
||||||
|
FROM openjdk:21
|
||||||
|
MAINTAINER bunny
|
||||||
|
|
||||||
|
#系统编码
|
||||||
|
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
|
||||||
|
|
||||||
|
# 设置时区,构建镜像时执行的命令
|
||||||
|
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||||
|
RUN echo "Asia/Shanghai" > /etc/timezone
|
||||||
|
|
||||||
|
# 设定工作目录
|
||||||
|
WORKDIR /home/bunny
|
||||||
|
|
||||||
|
# 复制jar包
|
||||||
|
COPY target/*.jar /home/bunny/app.jar
|
||||||
|
|
||||||
|
#启动容器时的进程
|
||||||
|
ENTRYPOINT ["java","-jar","/home/bunny/app.jar"]
|
||||||
|
|
||||||
|
#暴露 8800 端口
|
||||||
|
EXPOSE 8800
|
|
@ -0,0 +1,102 @@
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>java-template</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>service</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>service</name>
|
||||||
|
<url>https://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<docker.repostory>192.168.3.98:1100</docker.repostory>
|
||||||
|
<docker.host>192.168.3.98:2375</docker.host>
|
||||||
|
<docker.registry.name>bunny-service</docker.registry.name>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- 数据载体 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>model</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- service-utils -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>service-utils</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 单元测试 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- spring-test -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- knife4j -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.spotify</groupId>
|
||||||
|
<artifactId>docker-maven-plugin</artifactId>
|
||||||
|
<version>1.2.2</version>
|
||||||
|
<!--将插件绑定在某个phase执行-->
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>build-image</id>
|
||||||
|
<!--将插件绑定在package这个phase(阶段)上。也就是说,用户只需执行mvn package,就会自动执行mvn docker:build-->
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>build</goal>
|
||||||
|
<goal>push</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<serverId>harbor</serverId>
|
||||||
|
<registryUrl>http://${docker.repostory}</registryUrl>
|
||||||
|
<!-- 配置docker主机地址 -->
|
||||||
|
<dockerHost>http://${docker.host}</dockerHost>
|
||||||
|
<!--指定生成的镜像名-->
|
||||||
|
<imageName>
|
||||||
|
${docker.repostory}/${docker.registry.name}/${project.artifactId}:${project.version}
|
||||||
|
</imageName>
|
||||||
|
<!-- 指定 dockerfile 路径-->
|
||||||
|
<dockerDirectory>${project.basedir}</dockerDirectory>
|
||||||
|
<!-- 是否跳过docker构建 -->
|
||||||
|
<skipDockerBuild>false</skipDockerBuild>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
|
@ -0,0 +1,11 @@
|
||||||
|
package cn.bunny.service;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
public class ServiceApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(ServiceApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
bunny:
|
||||||
|
datasource:
|
||||||
|
host: 106.15.251.123
|
||||||
|
port: 3305
|
||||||
|
sqlData: guigu-oa
|
||||||
|
username: root
|
||||||
|
password: "02120212"
|
||||||
|
|
||||||
|
redis:
|
||||||
|
host: 47.120.65.66
|
||||||
|
port: 6379
|
||||||
|
database: 3
|
||||||
|
password: "02120212"
|
|
@ -0,0 +1,42 @@
|
||||||
|
server:
|
||||||
|
port: 8800
|
||||||
|
|
||||||
|
spring:
|
||||||
|
profiles:
|
||||||
|
active: dev
|
||||||
|
application:
|
||||||
|
name: bunny-service
|
||||||
|
|
||||||
|
datasource:
|
||||||
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://${bunny.datasource.host}:${bunny.datasource.port}/${bunny.datasource.sqlData}?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true
|
||||||
|
username: ${bunny.datasource.username}
|
||||||
|
password: ${bunny.datasource.password}
|
||||||
|
|
||||||
|
data:
|
||||||
|
redis:
|
||||||
|
host: ${bunny.redis.host}
|
||||||
|
port: ${bunny.redis.port}
|
||||||
|
database: ${bunny.redis.database}
|
||||||
|
password: ${bunny.redis.password}
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
max-active: 20 #最大连接数
|
||||||
|
max-wait: -1 #最大阻塞等待时间(负数表示没限制)
|
||||||
|
max-idle: 5 #最大空闲
|
||||||
|
min-idle: 0 #最小空闲
|
||||||
|
|
||||||
|
jackson:
|
||||||
|
date-format: yyyy-MM-dd HH:mm:ss
|
||||||
|
time-zone: GMT+8
|
||||||
|
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
cn.bunny.service.mapper: debug
|
||||||
|
cn.bunny.service.controller: info
|
||||||
|
cn.bunny.service.service: info
|
||||||
|
pattern:
|
||||||
|
dateformat: HH:mm:ss:SSS
|
||||||
|
file:
|
||||||
|
path: "logs/${spring.application.name}"
|
|
@ -0,0 +1,16 @@
|
||||||
|
-----------------▄██-█▄---------
|
||||||
|
-----------------███▄██▄--------
|
||||||
|
-----------------███████--------
|
||||||
|
-----------------▀███████-------
|
||||||
|
-------------------██████▄▄-----
|
||||||
|
-------------------█████████▄---
|
||||||
|
-------------------██████▄████--
|
||||||
|
-------▄███████████████████████-
|
||||||
|
-----▄███████████████████████▀--
|
||||||
|
---▄██████████████████████------
|
||||||
|
---███████████████████████------
|
||||||
|
---███████████████████████------
|
||||||
|
-▄▄██████████████████████▀------
|
||||||
|
-█████████████████▀█████--------
|
||||||
|
-▀██████████████▀▀-▀█████▄------
|
||||||
|
-------▀▀▀▀▀▀▀▀▀------▀▀▀▀------
|
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
|
@ -0,0 +1,38 @@
|
||||||
|
package cn.bunny;
|
||||||
|
|
||||||
|
import junit.framework.Test;
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unit test for simple App.
|
||||||
|
*/
|
||||||
|
public class AppTest
|
||||||
|
extends TestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create the test case
|
||||||
|
*
|
||||||
|
* @param testName name of the test case
|
||||||
|
*/
|
||||||
|
public AppTest( String testName )
|
||||||
|
{
|
||||||
|
super( testName );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the suite of tests being tested
|
||||||
|
*/
|
||||||
|
public static Test suite()
|
||||||
|
{
|
||||||
|
return new TestSuite( AppTest.class );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rigourous Test :-)
|
||||||
|
*/
|
||||||
|
public void testApp()
|
||||||
|
{
|
||||||
|
assertTrue( true );
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue