-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
bonjour520
committed
Dec 4, 2018
1 parent
72b3398
commit 06d185a
Showing
7 changed files
with
167 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/com/lanceyi/small/dto/response/TestResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.lanceyi.small.dto.response; | ||
|
||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Data; | ||
|
||
/** | ||
* @author Lance YI | ||
* @date 2018/12/4 16:58 | ||
*/ | ||
@Data | ||
public class TestResponse { | ||
@ApiModelProperty("姓") | ||
private String firstName; | ||
|
||
@ApiModelProperty("名") | ||
private String lastName; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
server: | ||
port: 8080 | ||
|
||
spring: | ||
datasource: | ||
druid: | ||
# jdbc | ||
url: jdbc:mysql://192.168.1.8:3306/runmin?useUnicode=true&characterEncoding=utf8 | ||
username: root | ||
password: s123456 | ||
driver-class-name: com.mysql.jdbc.Driver | ||
# 连接池 | ||
# 初始化连接数 | ||
initial-size: 1 | ||
# 最大连接数量 | ||
max-active: 3000 | ||
# 最小空闲数量 | ||
min-idle: 5 | ||
# 最大连接等待超时时长 | ||
max-wait: 70000 | ||
# 检测配置 | ||
validation-query: select 1 | ||
validation-query-timeout: 20 | ||
test-while-idle: true | ||
test-on-borrow: false | ||
test-on-return: false | ||
|
||
redis: | ||
host: 192.168.1.3 | ||
password: s123456 | ||
jedis: | ||
pool: | ||
max-active: 100 | ||
max-idle: 10 | ||
min-idle: 1 | ||
|
||
mvc: | ||
# 404 抛出错误 | ||
throw-exception-if-no-handler-found: true | ||
|
||
mybatis: | ||
# 实体对象所在的包 | ||
typeAliasesPackage: com.lanceyi.small.model | ||
# mapper所在的位置 | ||
mapper-locations: classpath:mappers/*.xml | ||
#驼峰映射 | ||
configuration: | ||
mapUnderscoreToCamelCase: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- 日志配置 参考:https://springframework.guru/using-logback-spring-boot/ --> | ||
<configuration> | ||
|
||
<!-- 引用spring boot 默认配置,主要是用默认的控制台输出配置--> | ||
<include resource="org/springframework/boot/logging/logback/base.xml"/> | ||
|
||
<!-- 读取spring属性 --> | ||
<springProperty scope="context" name="appName" source="spring.application.name"/> | ||
|
||
<!-- 每天产生一个日志文件,超过大小自动分割 --> | ||
<appender name="all_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | ||
<level>INFO</level> | ||
</filter> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
|
||
<FileNamePattern>/logs/${appName}/all-info-%d{yyyy-MM-dd}-%i.log</FileNamePattern> | ||
<MaxHistory>30</MaxHistory> | ||
|
||
<!-- 按时间回滚的同时,按文件大小来回滚 --> | ||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
<maxFileSize>100MB</maxFileSize> | ||
</timeBasedFileNamingAndTriggeringPolicy> | ||
|
||
</rollingPolicy> | ||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | ||
<pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} %-5level %-4L--- [%15.15t] %-50.50logger : %msg%n</pattern> | ||
</encoder> | ||
|
||
</appender> | ||
|
||
<appender name="all_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
<level>ERROR</level> | ||
<onMatch>ACCEPT</onMatch> | ||
<onMismatch>DENY</onMismatch> | ||
</filter> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
<FileNamePattern>/logs/${appName}/error-%d{yyyy-MM-dd}-%i.log</FileNamePattern> | ||
<!--日志文件保留天数--> | ||
<MaxHistory>30</MaxHistory> | ||
<TimeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
<MaxFileSize>100MB</MaxFileSize> | ||
</TimeBasedFileNamingAndTriggeringPolicy> | ||
</rollingPolicy> | ||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | ||
<pattern>%date{yyyy-MM-dd HH:mm:ss.SSS} %-5level %-4L--- [%15.15t] %-50.50logger : %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
|
||
<springProfile name="dev"> | ||
<root level="INFO"> | ||
<appender-ref ref="CONSOLE"/> | ||
<appender-ref ref="all_info"/> | ||
<appender-ref ref="all_error"/> | ||
</root> | ||
</springProfile> | ||
|
||
<springProfile name="test"> | ||
<root level="INFO"> | ||
<appender-ref ref="all_info"/> | ||
<appender-ref ref="all_error"/> | ||
</root> | ||
</springProfile> | ||
|
||
<springProfile name="prod"> | ||
<root level="INFO"> | ||
<appender-ref ref="all_info"/> | ||
<appender-ref ref="all_error"/> | ||
</root> | ||
</springProfile> | ||
|
||
|
||
</configuration> | ||
|