Quellcode durchsuchen

1.修改client代码bug,修改打包为jar+lib

wangtao vor 3 Jahren
Ursprung
Commit
f117402a9c

+ 13 - 0
ipfcst-client/focus-client.yml

@@ -0,0 +1,13 @@
+#青海client小程序使用jar包外配置文件
+remote:
+  ip: 192.168.26.32
+  port: 22
+  user: root
+  pwd: Syjy*3377
+  path: /home/syjy/ipfcstV3/downLoadFile/
+  dcUrl: http://cloud.jiayuepowertech.com:9001/qinghaiComeBackApi/datas
+v3cloud:
+  filelogUrl: https://117.78.19.70:9010/client/getDownLoadFileAll/
+  fileDownUrl: https://117.78.19.70:9010/client/getFileById?id=
+local:
+  downFilePath: /home/syjy/ipfcstV3/downLoadFile/

+ 161 - 0
ipfcst-client/pom.xml

@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.5.4</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.jiayue</groupId>
+    <artifactId>ipfcst-client</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>ipfcst-client</name>
+    <description>ipfcst-client</description>
+    <properties>
+        <java.version>1.8</java.version>
+        <spring-boot-admin.version>2.4.3</spring-boot-admin.version>
+        <hutool.version>5.7.13</hutool.version>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-jdbc</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-quartz</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>de.codecentric</groupId>
+            <artifactId>spring-boot-admin-starter-client</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!--hutool-->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>${hutool.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>ch.ethz.ganymed</groupId>
+            <artifactId>ganymed-ssh2</artifactId>
+            <version>build210</version>
+        </dependency>
+    </dependencies>
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>de.codecentric</groupId>
+                <artifactId>spring-boot-admin-dependencies</artifactId>
+                <version>${spring-boot-admin.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <build>
+        <finalName>focus-client</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.9.1</version>
+                <executions>
+                    <execution>
+                        <id>timestamp-property</id>
+                        <goals>
+                            <goal>timestamp-property</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <name>current.time</name>
+                    <pattern>yyyy-MM-dd HH:mm:ss</pattern>
+                    <timeZone>GMT+8</timeZone>
+                </configuration>
+            </plugin>
+            <!-- jar运行配置 -->
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <!-- main 入口 -->
+                    <mainClass>com.jiayue.client.IpfcstClientApplication</mainClass>
+                    <!-- 设置为ZIP,此模式下spring-boot-maven-plugin会将Manifest.MF文件中的Main-Class设置为org.springframework.boot.loader.PropertiesLauncher -->
+                    <layout>ZIP</layout>
+                    <!-- 需要包含的jar包 -->
+                    <includes>
+                        <!-- 不包含任何jar包 -->
+                        <include>
+                            <groupId>nothing</groupId>
+                            <artifactId>nothing</artifactId>
+                        </include>
+                    </includes>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>build-info</goal>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- third-party jar into lib directory -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-dependencies</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
+                            <!-- 需要排除的jar的 groupId
+                            <excludeGroupIds>
+                                com.bdfint.logistics
+                            </excludeGroupIds>-->
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 17 - 0
ipfcst-client/src/main/java/com/jiayue/client/IpfcstClientApplication.java

@@ -0,0 +1,17 @@
+package com.jiayue.client;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+@SpringBootApplication
+@EnableScheduling
+@Slf4j
+public class IpfcstClientApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(IpfcstClientApplication.class, args);
+    }
+
+}

+ 42 - 0
ipfcst-client/src/main/resources/application.yml

@@ -0,0 +1,42 @@
+server:
+  port: 81
+spring:
+  thymeleaf:
+    mode: HTML5
+    encoding: UTF-8
+    servlet:
+      content-type: text/html
+    cache: false
+    tomcat:
+      uri-encoding: UTF-8
+      max-connections: 200000
+      max-http-form-post-size: 9000000
+      threads:
+        max: 128
+        min-spare: 5
+    #mysql
+  datasource:
+    url: jdbc:mysql://192.168.35.43:3306/focus?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&autoReconnect=true&rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai
+    username: root
+    password: '!QAZ2root'
+logging:
+  config: classpath:logback-spring.xml
+
+management:
+  endpoints:
+    web:
+      exposure:
+        include: [ "health", "logfile","info" ]
+      base-path: /ipfcst-client
+  endpoint:
+    logfile:
+      enabled: true
+      external-file: logs/client-debug.log
+    health:
+      show-details: always
+info:
+  app.name: qinghai-client
+  app.time: @current.time@
+  app.version: v1
+
+