Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Kwan的解忧杂货铺@新空间代码工作室
SpringBoot-kwan
提交
b9c4636a
S
SpringBoot-kwan
项目概览
Kwan的解忧杂货铺@新空间代码工作室
/
SpringBoot-kwan
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SpringBoot-kwan
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b9c4636a
编写于
12月 09, 2022
作者:
Q
qinyingjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Initial commit
上级
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
227 addition
and
0 deletion
+227
-0
.gitignore
.gitignore
+33
-0
pom.xml
pom.xml
+94
-0
src/main/java/com/kwan/springbootkwan/SpringBootKwanApplication.java
...va/com/kwan/springbootkwan/SpringBootKwanApplication.java
+13
-0
src/main/java/com/kwan/springbootkwan/config/Swagger2.java
src/main/java/com/kwan/springbootkwan/config/Swagger2.java
+58
-0
src/main/resources/application.yaml
src/main/resources/application.yaml
+16
-0
src/test/java/com/kwan/springbootkwan/SpringBootKwanApplicationTests.java
...m/kwan/springbootkwan/SpringBootKwanApplicationTests.java
+13
-0
未找到文件。
.gitignore
0 → 100644
浏览文件 @
b9c4636a
READ.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/
pom.xml
0 → 100644
浏览文件 @
b9c4636a
<?xml version="1.0" encoding="UTF-8"?>
<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 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>
2.7.3
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<groupId>
com.kwan
</groupId>
<artifactId>
SpringBoot-kwan
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<name>
SpringBoot-kwan
</name>
<description>
Demo project for Spring Boot
</description>
<properties>
<java.version>
1.8
</java.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
8.0.21
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
<version>
1.2.3
</version>
</dependency>
<!-- junit -->
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.12
</version>
<scope>
test
</scope>
</dependency>
<!-- 引入swagger2包 -->
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
2.9.2
</version>
</dependency>
<!-- 引入自带UI,可选-->
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.9.2
</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
src/main/java/com/kwan/springbootkwan/SpringBootKwanApplication.java
0 → 100644
浏览文件 @
b9c4636a
package
com.kwan.springbootkwan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
SpringBootKwanApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
SpringBootKwanApplication
.
class
,
args
);
}
}
src/main/java/com/kwan/springbootkwan/config/Swagger2.java
0 → 100644
浏览文件 @
b9c4636a
package
com.kwan.springbootkwan.config
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.service.Contact
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
/**
* Swagger2配置
*
* @author : qinyingjie
* @version : 2.2.0
* @date : 2022/12/9 11:33
*/
@Configuration
@EnableSwagger2
@ConfigurationProperties
(
prefix
=
"swagger"
)
public
class
Swagger2
{
private
static
final
String
BASE_PACKAGE
=
"com.kwan.springbootkwan"
;
@Value
(
"${swagger.enable}"
)
private
boolean
enableSwagger
;
@Bean
public
Docket
helloDocket
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
//用于分组功能,也可以不配置
.
groupName
(
"admin"
)
//注册整体api信息
.
apiInfo
(
apiInfo
())
//swagger功能是否启用,可以通过配置设置,也可以先写死
.
enable
(
enableSwagger
)
.
select
()
//指定扫描的包
.
apis
(
RequestHandlerSelectors
.
basePackage
(
BASE_PACKAGE
))
//设置此组只匹配admin/**的请求
.
paths
(
PathSelectors
.
ant
(
"/admin/**"
))
.
build
();
}
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
().
title
(
"后台管理项目"
)
.
description
(
"通用的CRUD"
)
.
contact
(
new
Contact
(
"Van"
,
""
,
""
))
.
version
(
"1.0.0"
)
.
build
();
}
}
\ No newline at end of file
src/main/resources/application.yaml
0 → 100644
浏览文件 @
b9c4636a
server
:
port
:
8761
spring
:
application
:
name
:
eureka-server
#eureka的配置分为3类,server client 实例的 eureka-server既是服务端又是客户端
eureka
:
server
:
eviction-interval-timer-in-ms
:
1000
#服务端间隔多少毫秒做定期删除的操作
renewal-percent-threshold
:
0.85
#续约百分比,超过85%的应用没有和你续约,那么eureka会保护服务,不会提出任何一个
instance
:
#实例的配置
instance-id
:
${eureka.instance.hostname}:${spring.application.name}:${server.port}
#主机名称:应用名称:端口号
hostname
:
localhost
#主机名称或则服务的ip
prefer-ip-address
:
true
#以ip的形式显示具体的服务信息
lease-renewal-interval-in-seconds
:
5
#服务实例的续约时间间隔
\ No newline at end of file
src/test/java/com/kwan/springbootkwan/SpringBootKwanApplicationTests.java
0 → 100644
浏览文件 @
b9c4636a
package
com.kwan.springbootkwan
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.context.SpringBootTest
;
@SpringBootTest
class
SpringBootKwanApplicationTests
{
@Test
void
contextLoads
()
{
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录