E1ED922C1E9526DD63272D7EC5C6CB77
2021-02-07 46911b2d954fb8952cc178aa388d977d52d69927
添加通用文件上传
12个文件已添加
4个文件已修改
221 ■■■■■ 已修改文件
.idea/inspectionProfiles/Project_Default.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__com_dtflys_forest_forest_core_1_5_0_RC2.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__com_dtflys_forest_forest_spring_1_5_0_RC2.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__com_dtflys_forest_spring_boot_starter_forest_1_5_0_RC2.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__com_google_code_findbugs_jsr305_3_0_1.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__com_googlecode_juniversalchardet_juniversalchardet_1_0_3.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__com_squareup_okhttp3_okhttp_3_14_9.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__com_squareup_okio_okio_1_17_2.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__org_apache_httpcomponents_httpasyncclient_4_1_4.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__org_apache_httpcomponents_httpclient_cache_4_5_12.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__org_apache_httpcomponents_httpcore_nio_4_4_13.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__org_apache_httpcomponents_httpmime_4_5_12.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/libraries/Maven__org_springframework_boot_spring_boot_configuration_processor_2_0_5_RELEASE.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hx-common.iml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/hx/util/HttpUtil.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.idea/inspectionProfiles/Project_Default.xml
@@ -3,7 +3,7 @@
    <option name="myName" value="Project Default" />
    <inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
      <Languages>
        <language minSize="146" name="Java" />
        <language minSize="158" name="Java" />
      </Languages>
    </inspection_tool>
  </profile>
.idea/libraries/Maven__com_dtflys_forest_forest_core_1_5_0_RC2.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: com.dtflys.forest:forest-core:1.5.0-RC2">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/com/dtflys/forest/forest-core/1.5.0-RC2/forest-core-1.5.0-RC2.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/com/dtflys/forest/forest-core/1.5.0-RC2/forest-core-1.5.0-RC2-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/com/dtflys/forest/forest-core/1.5.0-RC2/forest-core-1.5.0-RC2-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__com_dtflys_forest_forest_spring_1_5_0_RC2.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: com.dtflys.forest:forest-spring:1.5.0-RC2">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/com/dtflys/forest/forest-spring/1.5.0-RC2/forest-spring-1.5.0-RC2.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/com/dtflys/forest/forest-spring/1.5.0-RC2/forest-spring-1.5.0-RC2-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/com/dtflys/forest/forest-spring/1.5.0-RC2/forest-spring-1.5.0-RC2-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__com_dtflys_forest_spring_boot_starter_forest_1_5_0_RC2.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: com.dtflys.forest:spring-boot-starter-forest:1.5.0-RC2">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/com/dtflys/forest/spring-boot-starter-forest/1.5.0-RC2/spring-boot-starter-forest-1.5.0-RC2.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/com/dtflys/forest/spring-boot-starter-forest/1.5.0-RC2/spring-boot-starter-forest-1.5.0-RC2-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/com/dtflys/forest/spring-boot-starter-forest/1.5.0-RC2/spring-boot-starter-forest-1.5.0-RC2-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__com_google_code_findbugs_jsr305_3_0_1.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: com.google.code.findbugs:jsr305:3.0.1">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__com_googlecode_juniversalchardet_juniversalchardet_1_0_3.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: com.googlecode.juniversalchardet:juniversalchardet:1.0.3">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/com/googlecode/juniversalchardet/juniversalchardet/1.0.3/juniversalchardet-1.0.3.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/com/googlecode/juniversalchardet/juniversalchardet/1.0.3/juniversalchardet-1.0.3-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/com/googlecode/juniversalchardet/juniversalchardet/1.0.3/juniversalchardet-1.0.3-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__com_squareup_okhttp3_okhttp_3_14_9.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: com.squareup.okhttp3:okhttp:3.14.9">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/com/squareup/okhttp3/okhttp/3.14.9/okhttp-3.14.9.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/com/squareup/okhttp3/okhttp/3.14.9/okhttp-3.14.9-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/com/squareup/okhttp3/okhttp/3.14.9/okhttp-3.14.9-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__com_squareup_okio_okio_1_17_2.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: com.squareup.okio:okio:1.17.2">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/com/squareup/okio/okio/1.17.2/okio-1.17.2.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/com/squareup/okio/okio/1.17.2/okio-1.17.2-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/com/squareup/okio/okio/1.17.2/okio-1.17.2-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__org_apache_httpcomponents_httpasyncclient_4_1_4.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.4">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpasyncclient/4.1.4/httpasyncclient-4.1.4.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpasyncclient/4.1.4/httpasyncclient-4.1.4-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpasyncclient/4.1.4/httpasyncclient-4.1.4-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__org_apache_httpcomponents_httpclient_cache_4_5_12.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: org.apache.httpcomponents:httpclient-cache:4.5.12">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpclient-cache/4.5.12/httpclient-cache-4.5.12.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpclient-cache/4.5.12/httpclient-cache-4.5.12-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpclient-cache/4.5.12/httpclient-cache-4.5.12-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__org_apache_httpcomponents_httpcore_nio_4_4_13.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.13">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpcore-nio/4.4.13/httpcore-nio-4.4.13.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpcore-nio/4.4.13/httpcore-nio-4.4.13-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpcore-nio/4.4.13/httpcore-nio-4.4.13-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__org_apache_httpcomponents_httpmime_4_5_12.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: org.apache.httpcomponents:httpmime:4.5.12">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpmime/4.5.12/httpmime-4.5.12.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpmime/4.5.12/httpmime-4.5.12-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/httpcomponents/httpmime/4.5.12/httpmime-4.5.12-sources.jar!/" />
    </SOURCES>
  </library>
</component>
.idea/libraries/Maven__org_springframework_boot_spring_boot_configuration_processor_2_0_5_RELEASE.xml
New file
@@ -0,0 +1,13 @@
<component name="libraryTable">
  <library name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.0.5.RELEASE">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/2.0.5.RELEASE/spring-boot-configuration-processor-2.0.5.RELEASE.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/2.0.5.RELEASE/spring-boot-configuration-processor-2.0.5.RELEASE-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-configuration-processor/2.0.5.RELEASE/spring-boot-configuration-processor-2.0.5.RELEASE-sources.jar!/" />
    </SOURCES>
  </library>
</component>
hx-common.iml
@@ -20,12 +20,12 @@
    <orderEntry type="inheritedJdk" />
    <orderEntry type="sourceFolder" forTests="false" />
    <orderEntry type="library" name="Maven: com.qcloud:cos_api:5.6.32" level="project" />
    <orderEntry type="library" name="Maven: com.qcloud:cos_api:5.6.24" level="project" />
    <orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
    <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
    <orderEntry type="library" name="Maven: joda-time:joda-time:2.9.9" level="project" />
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.6" level="project" />
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.6" level="project" />
    <orderEntry type="library" name="Maven: com.sun.mail:javax.mail:1.6.2" level="project" />
    <orderEntry type="library" name="Maven: javax.activation:activation:1.1" level="project" />
    <orderEntry type="library" name="Maven: org.apache.commons:commons-csv:1.6" level="project" />
@@ -107,5 +107,18 @@
    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
    <orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.11" level="project" />
    <orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:2.0" level="project" />
    <orderEntry type="library" name="Maven: com.dtflys.forest:spring-boot-starter-forest:1.5.0-RC2" level="project" />
    <orderEntry type="library" name="Maven: com.dtflys.forest:forest-core:1.5.0-RC2" level="project" />
    <orderEntry type="library" name="Maven: com.googlecode.juniversalchardet:juniversalchardet:1.0.3" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient-cache:4.5.12" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.12" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore-nio:4.4.13" level="project" />
    <orderEntry type="library" name="Maven: org.apache.httpcomponents:httpasyncclient:4.1.4" level="project" />
    <orderEntry type="library" name="Maven: com.squareup.okhttp3:okhttp:3.14.9" level="project" />
    <orderEntry type="library" name="Maven: com.squareup.okio:okio:1.17.2" level="project" />
    <orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.1" level="project" />
    <orderEntry type="library" name="Maven: com.dtflys.forest:forest-spring:1.5.0-RC2" level="project" />
    <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.0.5.RELEASE" level="project" />
    <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.6" level="project" />
  </component>
</module>
pom.xml
@@ -249,6 +249,12 @@
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper</artifactId>
        </dependency>
        <dependency>
            <groupId>com.dtflys.forest</groupId>
            <artifactId>spring-boot-starter-forest</artifactId>
            <version>1.5.0-RC2</version>
        </dependency>
    </dependencies>
    <build>
src/main/java/com/hx/util/HttpUtil.java
@@ -162,6 +162,48 @@
        return result;
    }
    /**
     * 带header的get请求
     * @param generalUrl
     * @param header
     * @return
     * @throws Exception
     */
    public static String get(String generalUrl, Map<String, String> header)
            throws Exception {
        URL url = new URL(generalUrl);
        // 打开和URL之间的连接
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        // 设置通用的请求属性
        connection.setRequestProperty("Connection", "Keep-Alive");
        if(header != null)
        {
            for(String key : header.keySet())
            {
                connection.setRequestProperty(key, header.get(key));
            }
        }
        connection.setUseCaches(false);
        connection.setDoOutput(true);
        connection.setDoInput(true);
        // 建立实际的连接
        connection.connect();
        // 定义 BufferedReader输入流来读取URL的响应
        BufferedReader in = null;
        in = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
        String result = "";
        String getLine;
        while ((getLine = in.readLine()) != null) {
            result += getLine;
        }
        in.close();
        return result;
    }
    /** 请求http协议 获取信息工具 **/
    public static JSONObject HttpURLUtil(String url, String data) {
        HttpURLConnection con = null;