Ver Fonte

调整 框架结构

guoenzhou há 2 anos atrás
pai
commit
07f1b352ce

+ 2 - 2
base-common/common-cloud-starter/pom.xml

@@ -3,8 +3,8 @@
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
-        <artifactId>ruoyi</artifactId>
         <groupId>com.ruoyi</groupId>
+        <artifactId>base-common</artifactId>
         <version>3.5.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
@@ -75,7 +75,7 @@
 
         <dependency>
             <groupId>com.ruoyi</groupId>
-            <artifactId>ruoyi-api-system</artifactId>
+            <artifactId>service-system-api</artifactId>
         </dependency>
 
         <!-- RuoYi Common Security-->

+ 1 - 1
base-common/ruoyi-common-core/pom.xml

@@ -4,7 +4,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>com.ruoyi</groupId>
-        <artifactId>ruoyi-common</artifactId>
+        <artifactId>base-common</artifactId>
         <version>3.5.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
base-common/ruoyi-common-datascope/pom.xml

@@ -4,7 +4,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>com.ruoyi</groupId>
-        <artifactId>ruoyi-common</artifactId>
+        <artifactId>base-common</artifactId>
         <version>3.5.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
base-common/ruoyi-common-datasource/pom.xml

@@ -4,7 +4,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>com.ruoyi</groupId>
-        <artifactId>ruoyi-common</artifactId>
+        <artifactId>base-common</artifactId>
         <version>3.5.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 2 - 3
base-common/ruoyi-common-log/pom.xml

@@ -4,7 +4,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>com.ruoyi</groupId>
-        <artifactId>ruoyi-common</artifactId>
+        <artifactId>base-common</artifactId>
         <version>3.5.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
@@ -12,11 +12,10 @@
     <artifactId>ruoyi-common-log</artifactId>
 	
     <description>
-        ruoyi-common-log日志记录
+        base-common-log日志记录
     </description>
 
     <dependencies>
-		
         <!-- RuoYi Common Security -->
         <dependency>
             <groupId>com.ruoyi</groupId>

+ 1 - 1
base-common/ruoyi-common-redis/pom.xml

@@ -4,7 +4,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>com.ruoyi</groupId>
-        <artifactId>ruoyi-common</artifactId>
+        <artifactId>base-common</artifactId>
         <version>3.5.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 3 - 3
base-common/ruoyi-common-security/pom.xml

@@ -3,7 +3,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>com.ruoyi</groupId>
-        <artifactId>ruoyi-common</artifactId>
+        <artifactId>base-common</artifactId>
         <version>3.5.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
@@ -11,7 +11,7 @@
     <artifactId>ruoyi-common-security</artifactId>
 
     <description>
-        ruoyi-common-security安全模块
+        common-security安全模块
     </description>
 
     <dependencies>
@@ -25,7 +25,7 @@
         <!-- RuoYi Api System -->
         <dependency>
             <groupId>com.ruoyi</groupId>
-            <artifactId>ruoyi-api-system</artifactId>
+            <artifactId>service-system-api</artifactId>
         </dependency>
 
         <!-- RuoYi Common Redis-->

+ 1 - 1
base-common/ruoyi-common-swagger/pom.xml

@@ -4,7 +4,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>com.ruoyi</groupId>
-        <artifactId>ruoyi-common</artifactId>
+        <artifactId>base-common</artifactId>
         <version>3.5.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 1
base-components/gateway/pom.xml

@@ -3,7 +3,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>com.ruoyi</groupId>
-        <artifactId>ruoyi</artifactId>
+        <artifactId>base-components</artifactId>
         <version>3.5.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 3 - 2
base-components/gateway/src/main/java/com/ruoyi/gateway/filter/ValidateCodeFilter.java

@@ -3,6 +3,9 @@ package com.ruoyi.gateway.filter;
 import java.nio.CharBuffer;
 import java.nio.charset.StandardCharsets;
 import java.util.concurrent.atomic.AtomicReference;
+
+import com.ruoyi.common.core.utils.ServletUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cloud.gateway.filter.GatewayFilter;
 import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
@@ -11,8 +14,6 @@ import org.springframework.core.io.buffer.DataBufferUtils;
 import org.springframework.http.server.reactive.ServerHttpRequest;
 import org.springframework.stereotype.Component;
 import com.alibaba.fastjson.JSONObject;
-import com.ruoyi.common.core.utils.ServletUtils;
-import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.gateway.config.properties.CaptchaProperties;
 import com.ruoyi.gateway.service.ValidateCodeService;
 import reactor.core.publisher.Flux;

+ 2 - 2
base-components/monitor/pom.xml

@@ -3,11 +3,11 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>com.ruoyi</groupId>
-        <artifactId>ruoyi-visual</artifactId>
+        <artifactId>base-components</artifactId>
         <version>3.5.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-	
+
     <artifactId>monitor</artifactId>
 
     <description>

+ 1 - 1
base-modules/service-file/pom.xml

@@ -57,7 +57,7 @@
         <!-- RuoYi Api System -->
         <dependency>
             <groupId>com.ruoyi</groupId>
-            <artifactId>ruoyi-api-system</artifactId>
+            <artifactId>service-system-api</artifactId>
         </dependency>
         
         <!-- RuoYi Common Swagger -->

+ 1 - 1
base-modules/service-system/pom.xml

@@ -3,7 +3,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>com.ruoyi</groupId>
-        <artifactId>ruoyi</artifactId>
+        <artifactId>base-modules</artifactId>
         <version>3.5.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>

+ 1 - 2
base-modules/service-system/service-system-api/pom.xml

@@ -4,7 +4,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>com.ruoyi</groupId>
-        <artifactId>ruoyi-api</artifactId>
+        <artifactId>service-system</artifactId>
         <version>3.5.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
@@ -16,7 +16,6 @@
     </description>
 
     <dependencies>
-		
         <!-- RuoYi Common Core-->
         <dependency>
             <groupId>com.ruoyi</groupId>

+ 0 - 1
base-modules/service-system/service-system-biz/pom.xml

@@ -22,7 +22,6 @@
             <groupId>com.ruoyi</groupId>
             <artifactId>common-cloud-starter</artifactId>
         </dependency>
-
     </dependencies>
 
     <build>

+ 3 - 3
base-modules/service-system/service-system-biz/src/main/java/com/ruoyi/system/RuoYiSystemApplication.java

@@ -1,12 +1,12 @@
 package com.ruoyi.system;
 
+import com.ruoyi.common.security.annotation.EnableCustomConfig;
+import com.ruoyi.common.security.annotation.EnableRyFeignClients;
+import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import com.ruoyi.common.security.annotation.EnableCustomConfig;
-import com.ruoyi.common.security.annotation.EnableRyFeignClients;
-import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.core.env.Environment;
 

+ 4 - 3
base-modules/service-system/service-system-biz/src/main/resources/bootstrap.yml

@@ -1,15 +1,16 @@
 # Tomcat
 server:
   port: 9201
-
 # Spring
 spring: 
   application:
     # 应用名称
-    name: service-system
+#    name: @project.artifactId@
+     name: service-system
   profiles:
     # 环境配置
-    active: dev
+#    active: @profiles.active@
+     active: dev
   cloud:
     nacos:
       discovery:

+ 49 - 34
base-modules/service-system/service-system-biz/src/main/resources/logback.xml

@@ -1,31 +1,33 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="60 seconds" debug="false">
     <!-- 日志存放路径 -->
-	<property name="log.path" value="/var/log/uskycloud/system" />
-   <!-- 日志输出格式 -->
-	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
-
+    <property name="log.path" value="/var/log/uskycloud/service-system" />
+    <property name="sql.package" value="com.ruoyi.system.mapper" />
+    <!-- 日志输出格式 -->
+    <!--	<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />-->
+    <property name="console.pattern" value="%gray(%d{MM-dd HH:mm:ss.SSS}) %highlight(%-5level) -- [%gray(%thread)] %cyan(%logger{26}:%line): %msg%n"/>
+    <property name="log.pattern" value="%d{MM-dd HH:mm:ss.SSS} %-5level -- [%thread] %logger{26}:%line: %msg%n"/>
     <!-- 控制台输出 -->
-	<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
-		<encoder>
-			<pattern>${log.pattern}</pattern>
-		</encoder>
-	</appender>
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>${console.pattern}</pattern>
+        </encoder>
+    </appender>
 
     <!-- 系统日志输出 -->
-	<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
-	    <file>${log.path}/info.log</file>
+    <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <file>${log.path}/info.log</file>
         <!-- 循环政策:基于时间创建日志文件 -->
-		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
             <!-- 日志文件名格式 -->
-			<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
-			<!-- 日志最大的历史 60天 -->
-			<maxHistory>60</maxHistory>
-		</rollingPolicy>
-		<encoder>
-			<pattern>${log.pattern}</pattern>
-		</encoder>
-		<filter class="ch.qos.logback.classic.filter.LevelFilter">
+            <fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>60</maxHistory>
+        </rollingPolicy>
+        <encoder>
+            <pattern>${log.pattern}</pattern>
+        </encoder>
+        <filter class="ch.qos.logback.classic.filter.LevelFilter">
             <!-- 过滤的级别 -->
             <level>INFO</level>
             <!-- 匹配时的操作:接收(记录) -->
@@ -33,16 +35,16 @@
             <!-- 不匹配时的操作:拒绝(不记录) -->
             <onMismatch>DENY</onMismatch>
         </filter>
-	</appender>
+    </appender>
 
     <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
-	    <file>${log.path}/error.log</file>
+        <file>${log.path}/error.log</file>
         <!-- 循环政策:基于时间创建日志文件 -->
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
             <!-- 日志文件名格式 -->
             <fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
-			<!-- 日志最大的历史 60天 -->
-			<maxHistory>60</maxHistory>
+            <!-- 日志最大的历史 60天 -->
+            <maxHistory>10</maxHistory>
         </rollingPolicy>
         <encoder>
             <pattern>${log.pattern}</pattern>
@@ -50,24 +52,37 @@
         <filter class="ch.qos.logback.classic.filter.LevelFilter">
             <!-- 过滤的级别 -->
             <level>ERROR</level>
-			<!-- 匹配时的操作:接收(记录) -->
+            <!-- 匹配时的操作:接收(记录) -->
             <onMatch>ACCEPT</onMatch>
-			<!-- 不匹配时的操作:拒绝(不记录) -->
+            <!-- 不匹配时的操作:拒绝(不记录) -->
             <onMismatch>DENY</onMismatch>
         </filter>
     </appender>
 
+    <appender name="sql" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <encoder>
+            <pattern>${log.path}/error.log</pattern>
+        </encoder>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>${log.path}/sql.%d{yyyy-MM-dd}.log</fileNamePattern>
+            <!-- 保留 10天数据,默认无限-->
+            <MaxHistory>10</MaxHistory>
+        </rollingPolicy>
+    </appender>
+
     <!-- 系统模块日志级别控制  -->
-	<logger name="com.ruoyi" level="info" />
-	<!-- Spring日志级别控制  -->
-	<logger name="org.springframework" level="warn" />
+    <!--	<logger name="com.usky" level="info" />-->
+    <!-- Spring日志级别控制  -->
+    <!--	<logger name="org.springframework" level="warn" />-->
+    <logger name="${sql.package}" additivity="false" level="DEBUG">
+        <appender-ref ref="console"/>
+        <appender-ref ref="sql"/>
+    </logger>
+
 
-	<root level="info">
-		<appender-ref ref="console" />
-	</root>
-	
-	<!--系统操作日志-->
+    <!--系统操作日志-->
     <root level="info">
+        <appender-ref ref="console" />
         <appender-ref ref="file_info" />
         <appender-ref ref="file_error" />
     </root>

+ 60 - 7
pom.xml

@@ -3,15 +3,31 @@
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
-
     <groupId>com.ruoyi</groupId>
     <artifactId>ruoyi</artifactId>
     <version>3.5.0</version>
 
-    <name>uskycloud</name>
-    <url></url>
+<!--    <parent>-->
+<!--        <groupId>org.springframework.boot</groupId>-->
+<!--        <artifactId>spring-boot-starter-parent</artifactId>-->
+<!--        <version>2.1.3.RELEASE</version>-->
+<!--        <relativePath/>-->
+<!--    </parent>-->
+
     <description>微服务系统</description>
 
+
+    <repositories>
+        <repository>
+            <id>aliyun</id>
+            <name>aliyun Repository</name>
+            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+    </repositories>
+
     <properties>
         <ruoyi.version>3.5.0</ruoyi.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -155,9 +171,9 @@
             </dependency>
 
             <!-- Collection 增强Java集合框架 -->
-            <dependency> 
-                <groupId>commons-collections</groupId> 
-                <artifactId>commons-collections</artifactId> 
+            <dependency>
+                <groupId>commons-collections</groupId>
+                <artifactId>commons-collections</artifactId>
                 <version>${commons-collections.version}</version>
             </dependency>
 
@@ -234,7 +250,7 @@
             <!-- 系统接口 -->
             <dependency>
                 <groupId>com.ruoyi</groupId>
-                <artifactId>ruoyi-api-system</artifactId>
+                <artifactId>service-system-api</artifactId>
                 <version>${ruoyi.version}</version>
             </dependency>
 
@@ -274,7 +290,44 @@
                     <encoding>${project.build.sourceEncoding}</encoding>
                 </configuration>
             </plugin>
+<!--            <plugin>-->
+<!--                <groupId>org.apache.maven.plugins</groupId>-->
+<!--                <artifactId>maven-resources-plugin</artifactId>-->
+<!--                <configuration>-->
+<!--                    <delimiters>-->
+<!--                        <delimiter>@</delimiter>-->
+<!--                    </delimiters>-->
+<!--                    <useDefaultDelimiters>false</useDefaultDelimiters>-->
+<!--                </configuration>-->
+<!--            </plugin>-->
         </plugins>
+<!--        <resources>-->
+<!--            <resource>-->
+<!--                <directory>src/main/resources</directory>-->
+<!--                <filtering>true</filtering>-->
+<!--            </resource>-->
+<!--        </resources>-->
     </build>
+<!--    <profiles>-->
+<!--        <profile>-->
+<!--            <id>dev</id>-->
+<!--            <activation>-->
+<!--                &lt;!&ndash; 是否默认 true表示默认&ndash;&gt;-->
+<!--                <activeByDefault>true</activeByDefault>-->
+<!--            </activation>-->
+<!--            <properties>-->
+<!--                &lt;!&ndash; 配置文件名字后缀 &ndash;&gt;-->
+<!--                <profiles.active>dev</profiles.active>-->
+<!--            </properties>-->
+<!--        </profile>-->
+
+<!--        &lt;!&ndash; 生产环境 &ndash;&gt;-->
+<!--        <profile>-->
+<!--            <id>prod</id>-->
+<!--            <properties>-->
+<!--                <profiles.active>prod</profiles.active>-->
+<!--            </properties>-->
+<!--        </profile>-->
+<!--    </profiles>-->
 
 </project>