From 69b9a4db2b76d201f92c2f98114fd13cf6ef4e71 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期六, 15 五月 2021 14:27:29 +0800
Subject: [PATCH] update 通用Service接口 增加自定义vo转换函数
---
ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java | 154 +++++++++++++++++++++++++-------------------------
1 files changed, 77 insertions(+), 77 deletions(-)
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java
index ae6e02f..84f7e00 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java
@@ -1,77 +1,77 @@
-package com.ruoyi.framework.config.properties;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Configuration;
-import com.alibaba.druid.pool.DruidDataSource;
-
-/**
- * druid 閰嶇疆灞炴��
- *
- * @author ruoyi
- */
-@Configuration
-public class DruidProperties
-{
- @Value("${spring.datasource.druid.initialSize}")
- private int initialSize;
-
- @Value("${spring.datasource.druid.minIdle}")
- private int minIdle;
-
- @Value("${spring.datasource.druid.maxActive}")
- private int maxActive;
-
- @Value("${spring.datasource.druid.maxWait}")
- private int maxWait;
-
- @Value("${spring.datasource.druid.timeBetweenEvictionRunsMillis}")
- private int timeBetweenEvictionRunsMillis;
-
- @Value("${spring.datasource.druid.minEvictableIdleTimeMillis}")
- private int minEvictableIdleTimeMillis;
-
- @Value("${spring.datasource.druid.maxEvictableIdleTimeMillis}")
- private int maxEvictableIdleTimeMillis;
-
- @Value("${spring.datasource.druid.validationQuery}")
- private String validationQuery;
-
- @Value("${spring.datasource.druid.testWhileIdle}")
- private boolean testWhileIdle;
-
- @Value("${spring.datasource.druid.testOnBorrow}")
- private boolean testOnBorrow;
-
- @Value("${spring.datasource.druid.testOnReturn}")
- private boolean testOnReturn;
-
- public DruidDataSource dataSource(DruidDataSource datasource)
- {
- /** 閰嶇疆鍒濆鍖栧ぇ灏忋�佹渶灏忋�佹渶澶� */
- datasource.setInitialSize(initialSize);
- datasource.setMaxActive(maxActive);
- datasource.setMinIdle(minIdle);
-
- /** 閰嶇疆鑾峰彇杩炴帴绛夊緟瓒呮椂鐨勬椂闂� */
- datasource.setMaxWait(maxWait);
-
- /** 閰嶇疆闂撮殧澶氫箙鎵嶈繘琛屼竴娆℃娴嬶紝妫�娴嬮渶瑕佸叧闂殑绌洪棽杩炴帴锛屽崟浣嶆槸姣 */
- datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
-
- /** 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�灏忋�佹渶澶х敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣 */
- datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
- datasource.setMaxEvictableIdleTimeMillis(maxEvictableIdleTimeMillis);
-
- /**
- * 鐢ㄦ潵妫�娴嬭繛鎺ユ槸鍚︽湁鏁堢殑sql锛岃姹傛槸涓�涓煡璇㈣鍙ワ紝甯哥敤select 'x'銆傚鏋渧alidationQuery涓簄ull锛宼estOnBorrow銆乼estOnReturn銆乼estWhileIdle閮戒笉浼氳捣浣滅敤銆�
- */
- datasource.setValidationQuery(validationQuery);
- /** 寤鸿閰嶇疆涓簍rue锛屼笉褰卞搷鎬ц兘锛屽苟涓斾繚璇佸畨鍏ㄦ�с�傜敵璇疯繛鎺ョ殑鏃跺�欐娴嬶紝濡傛灉绌洪棽鏃堕棿澶т簬timeBetweenEvictionRunsMillis锛屾墽琛寁alidationQuery妫�娴嬭繛鎺ユ槸鍚︽湁鏁堛�� */
- datasource.setTestWhileIdle(testWhileIdle);
- /** 鐢宠杩炴帴鏃舵墽琛寁alidationQuery妫�娴嬭繛鎺ユ槸鍚︽湁鏁堬紝鍋氫簡杩欎釜閰嶇疆浼氶檷浣庢�ц兘銆� */
- datasource.setTestOnBorrow(testOnBorrow);
- /** 褰掕繕杩炴帴鏃舵墽琛寁alidationQuery妫�娴嬭繛鎺ユ槸鍚︽湁鏁堬紝鍋氫簡杩欎釜閰嶇疆浼氶檷浣庢�ц兘銆� */
- datasource.setTestOnReturn(testOnReturn);
- return datasource;
- }
-}
+package com.ruoyi.framework.config.properties;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+import com.alibaba.druid.pool.DruidDataSource;
+
+/**
+ * druid 閰嶇疆灞炴��
+ *
+ * @author ruoyi
+ */
+@Configuration
+public class DruidProperties
+{
+ @Value("${spring.datasource.druid.initialSize}")
+ private int initialSize;
+
+ @Value("${spring.datasource.druid.minIdle}")
+ private int minIdle;
+
+ @Value("${spring.datasource.druid.maxActive}")
+ private int maxActive;
+
+ @Value("${spring.datasource.druid.maxWait}")
+ private int maxWait;
+
+ @Value("${spring.datasource.druid.timeBetweenEvictionRunsMillis}")
+ private int timeBetweenEvictionRunsMillis;
+
+ @Value("${spring.datasource.druid.minEvictableIdleTimeMillis}")
+ private int minEvictableIdleTimeMillis;
+
+ @Value("${spring.datasource.druid.maxEvictableIdleTimeMillis}")
+ private int maxEvictableIdleTimeMillis;
+
+ @Value("${spring.datasource.druid.validationQuery}")
+ private String validationQuery;
+
+ @Value("${spring.datasource.druid.testWhileIdle}")
+ private boolean testWhileIdle;
+
+ @Value("${spring.datasource.druid.testOnBorrow}")
+ private boolean testOnBorrow;
+
+ @Value("${spring.datasource.druid.testOnReturn}")
+ private boolean testOnReturn;
+
+ public DruidDataSource dataSource(DruidDataSource datasource)
+ {
+ /** 閰嶇疆鍒濆鍖栧ぇ灏忋�佹渶灏忋�佹渶澶� */
+ datasource.setInitialSize(initialSize);
+ datasource.setMaxActive(maxActive);
+ datasource.setMinIdle(minIdle);
+
+ /** 閰嶇疆鑾峰彇杩炴帴绛夊緟瓒呮椂鐨勬椂闂� */
+ datasource.setMaxWait(maxWait);
+
+ /** 閰嶇疆闂撮殧澶氫箙鎵嶈繘琛屼竴娆℃娴嬶紝妫�娴嬮渶瑕佸叧闂殑绌洪棽杩炴帴锛屽崟浣嶆槸姣 */
+ datasource.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
+
+ /** 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�灏忋�佹渶澶х敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣 */
+ datasource.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
+ datasource.setMaxEvictableIdleTimeMillis(maxEvictableIdleTimeMillis);
+
+ /**
+ * 鐢ㄦ潵妫�娴嬭繛鎺ユ槸鍚︽湁鏁堢殑sql锛岃姹傛槸涓�涓煡璇㈣鍙ワ紝甯哥敤select 'x'銆傚鏋渧alidationQuery涓簄ull锛宼estOnBorrow銆乼estOnReturn銆乼estWhileIdle閮戒笉浼氳捣浣滅敤銆�
+ */
+ datasource.setValidationQuery(validationQuery);
+ /** 寤鸿閰嶇疆涓簍rue锛屼笉褰卞搷鎬ц兘锛屽苟涓斾繚璇佸畨鍏ㄦ�с�傜敵璇疯繛鎺ョ殑鏃跺�欐娴嬶紝濡傛灉绌洪棽鏃堕棿澶т簬timeBetweenEvictionRunsMillis锛屾墽琛寁alidationQuery妫�娴嬭繛鎺ユ槸鍚︽湁鏁堛�� */
+ datasource.setTestWhileIdle(testWhileIdle);
+ /** 鐢宠杩炴帴鏃舵墽琛寁alidationQuery妫�娴嬭繛鎺ユ槸鍚︽湁鏁堬紝鍋氫簡杩欎釜閰嶇疆浼氶檷浣庢�ц兘銆� */
+ datasource.setTestOnBorrow(testOnBorrow);
+ /** 褰掕繕杩炴帴鏃舵墽琛寁alidationQuery妫�娴嬭繛鎺ユ槸鍚︽湁鏁堬紝鍋氫簡杩欎釜閰嶇疆浼氶檷浣庢�ц兘銆� */
+ datasource.setTestOnReturn(testOnReturn);
+ return datasource;
+ }
+}
--
Gitblit v1.9.3