diff --git a/pom.xml b/pom.xml
index b51ffe4..c345ba1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,12 +6,12 @@
org.springframework.boot
spring-boot-starter-parent
2.1.2.RELEASE
-
+
com.cm
system-city
1.0.0.RELEASE
- servicecity
+ systemcity
城市管理系统
@@ -157,6 +157,12 @@
poi-ooxml
4.1.0
+
+
+ junit
+ junit
+ test
+
diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml
index b60acfe..121f4da 100755
--- a/src/main/resources/application-test.yml
+++ b/src/main/resources/application-test.yml
@@ -24,11 +24,14 @@ spring:
max-request-size: 1GB
datasource:
druid:
- url: jdbc:mysql://49.233.36.36:6688/db_cloud_city?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false
+# url: jdbc:mysql://49.233.36.36:6688/db_cloud_city?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false
+ url: jdbc:mysql://127.0.0.1:3306/db_cloud_v2_city?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false
db-type: mysql
driver-class-name: com.mysql.jdbc.Driver
- username: wanggeng
- password: WenG>2132997
+# username: wanggeng
+ username: root
+# password: WenG>2132997
+ password: root
initial-size: 2
min-idle: 2
max-active: 10
@@ -70,7 +73,7 @@ swagger:
# 文件
file:
- uploadPath: /Users/wanggeng/Desktop/UploadFiles/
+ uploadPath: C:\Users\wenc0\Desktop\UploadFiles\
imageTypes: png,jpg,jpeg,gif,blob
videoTypes: mp4,rmvb
audioTypes: mp3,wmv,wav
diff --git a/src/test/java/com/cm/systemcity/SystemCityApplicationTests.java b/src/test/java/com/cm/systemcity/SystemCityApplicationTests.java
index fa20fac..1765222 100644
--- a/src/test/java/com/cm/systemcity/SystemCityApplicationTests.java
+++ b/src/test/java/com/cm/systemcity/SystemCityApplicationTests.java
@@ -1,13 +1,396 @@
package com.cm.systemcity;
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import com.cm.common.utils.UUIDUtil;
+import com.cm.common.utils.jdbc.JdbcUtil;
+import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.security.core.parameters.P;
-@SpringBootTest
-class SystemCityApplicationTests {
+import java.io.File;
+import java.sql.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+//@SpringBootTest
+public class SystemCityApplicationTests {
@Test
- void contextLoads() {
+ public void importCommunityBoss() throws SQLException, ClassNotFoundException {
+ Class.forName("com.mysql.jdbc.Driver");
+ Connection connection = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/db_cloud_v2_city?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false", "root", "root");
+ // 所有用户
+ String sql = "SELECT * FROM sys_user WHERE is_delete = '0'";
+ PreparedStatement preparedStatement = connection.prepareStatement(sql);
+ ResultSet resultSet = preparedStatement.executeQuery();
+ List