Browse Source

依赖优化等

hdc 1 year ago
parent
commit
81f7607b37

+ 2 - 57
collect-fees/collect-fees-api/pom.xml

@@ -92,9 +92,9 @@
             <version>1.1.16</version>
         </dependency>
         <dependency>
-            <groupId>com.oracle</groupId>
+            <groupId>com.oracle.database.jdbc</groupId>
             <artifactId>ojdbc6</artifactId>
-            <version>${oracle.version}</version>
+            <version>11.2.0.4</version>
         </dependency>
         <!--使用Apache Commons Net库来创建FTP业务接口并上传图片文件 -->
         <dependency>
@@ -102,60 +102,11 @@
             <artifactId>commons-net</artifactId>
             <version>3.6</version>
         </dependency>
-        <dependency>
-            <groupId>com.tofly</groupId>
-            <artifactId>common-log</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>com.alibaba.cloud</groupId>
-                    <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>com.alibaba.cloud</groupId>
-                    <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.springframework.cloud</groupId>
-                    <artifactId>spring-cloud-starter-config</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.springframework.cloud</groupId>
-                    <artifactId>spring-cloud-starter-openfeign</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>com.github.ulisesbocchio</groupId>
-                    <artifactId>jasypt-spring-boot-starter</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>com.alibaba</groupId>
-                    <artifactId>fastjson</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>com.tofly</groupId>
-                    <artifactId>common-oauth</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>com.tofly</groupId>
-                    <artifactId>common-web</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>com.tofly</groupId>
-                    <artifactId>common-entity</artifactId>
-                </exclusion>
-            </exclusions>
-            <version>1.0.3</version>
-        </dependency>
         <dependency>
             <groupId>com.tofly.base</groupId>
             <artifactId>base-api</artifactId>
             <version>1.0-SNAPSHOT</version>
         </dependency>
-        <dependency>
-            <groupId>com.tofly</groupId>
-            <artifactId>common-oauth</artifactId>
-            <version>1.0.3</version>
-            <scope>compile</scope>
-        </dependency>
         <!--自定义-->
         <dependency>
             <groupId>cn.hutool</groupId>
@@ -185,12 +136,6 @@
             <version>1.9.4</version>
             <scope>compile</scope>
         </dependency>
-        <!--<dependency>
-            <groupId>com.tofly</groupId>
-            <artifactId>collect-fees-service</artifactId>
-            <version>1.0.0</version>
-            <scope>compile</scope>
-        </dependency>-->
     </dependencies>
     <build>
         <plugins>

+ 5 - 0
collect-fees/collect-fees-api/src/main/java/com/tofly/common/log/annotation/ToFlyAppLog.java

@@ -0,0 +1,5 @@
+package com.tofly.common.log.annotation;
+
+public @interface ToFlyAppLog {
+    String title();
+}

+ 2 - 2
collect-fees/collect-fees-api/src/main/java/com/tofly/feesapi/feesapiApplication.java

@@ -12,9 +12,9 @@ import org.springframework.context.annotation.Bean;
 
 @EnableDiscoveryClient
 @SpringBootApplication(exclude = {ManagementWebSecurityAutoConfiguration.class, SecurityAutoConfiguration.class})
-public class feesapiApplication {
+public class FeesApiApplication {
     public static void main(String[] args) {
-        SpringApplication.run(feesapiApplication.class, args);
+        SpringApplication.run(FeesApiApplication.class, args);
 
 
     }

+ 12 - 12
collect-fees/collect-fees-api/src/main/resources/bootstrap.yml

@@ -27,18 +27,18 @@ spring:
   application:
     # 该应用在nacos配置中的名称
     name: tofly-fees-api
-logging:
-  level:
-    root: debug
-    sql_api: debug
-    feign: debug
-    org:
-      springframework:
-        boot: debug
-    com:
-      tofly:
-        fees: debug
-    com.alibaba.nacos.client.config.impl: WARN
+#logging:
+#  level:
+#    root: debug
+#    sql_api: debug
+#    feign: debug
+#    org:
+#      springframework:
+#        boot: debug
+#    com:
+#      tofly:
+#        feesapi: debug
+#    com.alibaba.nacos.client.config.impl: WARN
 # DEV配置 为这个服务配置服务清单,可以是一个或N个
 tofly-base.ribbon.listOfServers: http://localhost:10102
 tofly-auth.ribbon.listOfServers: http://localhost:10101

+ 28 - 17
collect-fees/collect-fees-api/src/main/resources/logback.xml

@@ -1,29 +1,40 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<configuration debug="false" scan="true" scanPeriod="1 seconds">
+<configuration debug="false" scan="true" scanPeriod="60 seconds">
 
-    <contextName>logback</contextName>
-    <property name="log.path" value="./log/base.log"/>
-
-    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+    <!--<contextName>fees-api</contextName>-->
+    <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
+    <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
+    <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
+    <property name="log.filePath" value="./log"/>
+    <!-- 0:不限制 -->
+    <property name="log.maxHistory" value="60"/>
+    <property name="appName" value="fees-api"/>
+    <property name="logPattern" value="${CONSOLE_LOG_PATTERN:-%clr([%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}]){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
         <encoder>
-            <pattern>%d{HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n</pattern>
+            <pattern>${logPattern}</pattern>
+            <!--<pattern>${CONSOLE_LOG_PATTERN:-%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}) %m%n}</pattern>-->
         </encoder>
     </appender>
-
-    <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>${log.path}</file>
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>${log.path}.%d{yyyy-MM-dd}.zip</fileNamePattern>
+    <appender name="ROLLING_LOG"  class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.filePath}${file.separator}${appName}.log</file>
+        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+            <FileNamePattern>
+                ${log.filePath}${file.separator}%d{yyyy,aux}${file.separator}%d{yyyy-MM,aux}${file.separator}${appName}_%d{yyyyMMdd}_%i.log
+            </FileNamePattern>
+            <!--日志文件最大的保存历史数量,只有当每天生成且只生成一个文件时才表示保留天数-->
+            <maxHistory>${log.maxHistory}</maxHistory>
+            <maxFileSize>10MB</maxFileSize>
+            <totalSizeCap>500MB</totalSizeCap>
         </rollingPolicy>
         <encoder>
-            <pattern>%date %level [%thread] %logger{36} [%file : %line] %msg%n
-            </pattern>
+            <pattern>${logPattern}</pattern>
         </encoder>
     </appender>
-
-    <root level="info">
-        <appender-ref ref="console"/>
-        <appender-ref ref="file"/>
+    <logger name="com.tofly.feesapi" level="DEBUG"/>
+    <root level="warn">
+        <appender-ref ref="STDOUT"/>
+        <appender-ref ref="ROLLING_LOG"/>
     </root>
 
 </configuration>