Commit 9bc76098 authored by 赵啸非's avatar 赵啸非

修改构建api文档

parent d9fabd6f
No related merge requests found
...@@ -55,6 +55,12 @@ ...@@ -55,6 +55,12 @@
<artifactId>jjwt</artifactId> <artifactId>jjwt</artifactId>
</dependency> </dependency>
<dependency>
<groupId>p6spy</groupId>
<artifactId>p6spy</artifactId>
<version>3.9.1</version>
</dependency>
<dependency> <dependency>
<groupId>com.github.shalousun</groupId> <groupId>com.github.shalousun</groupId>
<artifactId>smart-doc</artifactId> <artifactId>smart-doc</artifactId>
......
package com.mortals.xhx.base.framework.config;
import com.mortals.framework.util.DateUtils;
import com.p6spy.engine.spy.appender.MessageFormattingStrategy;
import org.apache.commons.lang3.StringUtils;
/**
* 自定义 p6spy sql输出格式
*
*/
public class P6spySqlFormatConfig implements MessageFormattingStrategy {
/**
* 过滤掉定时任务的 SQL
*/
@Override
public String formatMessage(int connectionId, String now, long elapsed, String category, String prepared, String sql, String url) {
return StringUtils.isNotBlank(sql) ? DateUtils.getCurrStrDateTime()
+ " | 耗时 " + elapsed + " ms | SQL 语句:" + StringUtils.LF + sql.replaceAll("[\\s]+", StringUtils.SPACE) + ";" : "";
}
}
...@@ -33,7 +33,8 @@ spring: ...@@ -33,7 +33,8 @@ spring:
max-wait: 1000 max-wait: 1000
datasource: datasource:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.p6spy.engine.spy.P6SpyDriver
#driver-class-name: com.mysql.cj.jdbc.Driver
url: @profiles.datasource.uri@ url: @profiles.datasource.uri@
username: @profiles.datasource.username@ username: @profiles.datasource.username@
password: @profiles.datasource.password@ password: @profiles.datasource.password@
......
module.log=com.p6spy.engine.logging.P6LogFactory,com.p6spy.engine.outage.P6OutageFactory
# 自定义日志打印
logMessageFormat=com.mortals.xhx.base.framework.config.P6spySqlFormatConfig
#customLogMessageFormat=%(currentTime) | SQL耗时: %(executionTime) ms | 连接信息: %(category)-%(connectionId) | 执行语句: %(sql)
# 使用控制台记录sql
appender=com.p6spy.engine.spy.appender.StdoutLogger
## 配置记录Log例外
excludecategories=info,debug,result,batc,resultset
# 设置使用p6spy driver来做代理
deregisterdrivers=true
# 日期格式
dateformat=yyyy-MM-dd HH:mm:ss
# 实际驱动
driverlist=com.mysql.cj.jdbc.Driver
# 是否开启慢SQL记录
outagedetection=true
# 慢SQL记录标准 秒
outagedetectioninterval=2
\ No newline at end of file
...@@ -34,7 +34,7 @@ GET {{baseUrl}}/site/business/info?id={{SiteBusiness_id}} ...@@ -34,7 +34,7 @@ GET {{baseUrl}}/site/business/info?id={{SiteBusiness_id}}
Accept: application/json Accept: application/json
###站点业务编辑 ###站点业务编辑
GET {{baseUrl}}/site/business/edit?id={{SiteBusiness_id}} GET {{baseUrl}}/site/business/edit?id=679
Accept: application/json Accept: application/json
......
...@@ -14,7 +14,7 @@ POST {{baseUrl}}/site/model/save ...@@ -14,7 +14,7 @@ POST {{baseUrl}}/site/model/save
Content-Type: application/json Content-Type: application/json
{ {
"siteId":2566, "siteId":2562,
"siteName":"rhbfop", "siteName":"rhbfop",
"modelId":1041, "modelId":1041,
"modelName":"dapxrp" "modelName":"dapxrp"
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<profiles.active>develop</profiles.active> <profiles.active>develop</profiles.active>
<profiles.server.port>17311</profiles.server.port> <profiles.server.port>17311</profiles.server.port>
<profiles.datasource.uri> <profiles.datasource.uri>
<![CDATA[jdbc:mysql://localhost:3306/base?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong]]></profiles.datasource.uri> <![CDATA[jdbc:p6spy:mysql://localhost:3306/base?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong]]></profiles.datasource.uri>
<profiles.datasource.username>root</profiles.datasource.username> <profiles.datasource.username>root</profiles.datasource.username>
<profiles.datasource.password>12345678</profiles.datasource.password> <profiles.datasource.password>12345678</profiles.datasource.password>
<profiles.redis.uri>127.0.0.1</profiles.redis.uri> <profiles.redis.uri>127.0.0.1</profiles.redis.uri>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<profiles.active>test</profiles.active> <profiles.active>test</profiles.active>
<profiles.server.port>17211</profiles.server.port> <profiles.server.port>17211</profiles.server.port>
<profiles.datasource.uri> <profiles.datasource.uri>
<![CDATA[jdbc:mysql://192.168.0.98:3306/base-platform?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong]]></profiles.datasource.uri> <![CDATA[jdbc:p6spy:mysql://192.168.0.98:3306/base-platform?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong]]></profiles.datasource.uri>
<profiles.datasource.username>root</profiles.datasource.username> <profiles.datasource.username>root</profiles.datasource.username>
<profiles.datasource.password>nacos@2020</profiles.datasource.password> <profiles.datasource.password>nacos@2020</profiles.datasource.password>
<profiles.redis.uri>192.168.0.252</profiles.redis.uri> <profiles.redis.uri>192.168.0.252</profiles.redis.uri>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment