Browse Source

默认显示Sql监控

pull/77/head
RuoYi 6 years ago
parent
commit
a9f378218b
  1. 5
      ruoyi-admin/src/main/resources/application-druid.yml
  2. 4
      ruoyi-generator/src/main/resources/vm/java/Controller.java.vm
  3. 2
      ruoyi-generator/src/main/resources/vm/java/domain.java.vm

5
ruoyi-admin/src/main/resources/application-druid.yml

@ -34,7 +34,9 @@ spring:
validationQuery: SELECT 1 FROM DUAL validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true testWhileIdle: true
testOnBorrow: false testOnBorrow: false
testOnReturn: false testOnReturn: false
webStatFilter:
enabled: true
statViewServlet: statViewServlet:
enabled: true enabled: true
# 设置白名单,不填则允许所有访问 # 设置白名单,不填则允许所有访问
@ -42,6 +44,7 @@ spring:
url-pattern: /monitor/druid/* url-pattern: /monitor/druid/*
filter: filter:
stat: stat:
enabled: true
# 慢SQL记录 # 慢SQL记录
log-slow-sql: true log-slow-sql: true
slow-sql-millis: 1000 slow-sql-millis: 1000

4
ruoyi-generator/src/main/resources/vm/java/Controller.java.vm

@ -14,9 +14,9 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import ${package}.domain.${className}; import ${package}.domain.${className};
import ${package}.service.I${className}Service; import ${package}.service.I${className}Service;
import com.ruoyi.framework.web.base.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.page.TableDataInfo; import com.ruoyi.common.page.TableDataInfo;
import com.ruoyi.common.base.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
/** /**

2
ruoyi-generator/src/main/resources/vm/java/domain.java.vm

@ -2,7 +2,7 @@ package ${package}.domain;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.base.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
#foreach ($column in $columns) #foreach ($column in $columns)
#if($column.attrType == 'Date') #if($column.attrType == 'Date')
import java.util.Date; import java.util.Date;

Loading…
Cancel
Save