Browse Source

更新 如何修改为Tomcat相关注释配置与说明

疯狂的狮子li 4 năm trước cách đây
mục cha
commit
5a62019cdd
3 tập tin đã thay đổi với 22 bổ sung1 xóa
  1. 4 0
      README.md
  2. 9 0
      ruoyi-admin/src/main/resources/application.yml
  3. 9 1
      ruoyi-framework/pom.xml

+ 4 - 0
README.md

@@ -5,6 +5,10 @@
 * 禁止 父方法使用 @Transactional 创建事务 子方法使用 @DataSource 切换数据源
 * 正确用法: 子方法单独创建事务 或 父方法使用 @Transactional(propagation = Propagation.REQUIRES_NEW) 为所有子方法创建新事务
 
+关于如何使用Tomcat
+* 查看ruoyi-framework模块的pom.xml文件,根据注释更改依赖
+* 查看ruoyi-admin模块中的application.yml文件,根据注释更改配置
+
 ## 修改RuoYi功能
 
 * ORM框架 使用 Mybatis-Plus 简化CRUD

+ 9 - 0
ruoyi-admin/src/main/resources/application.yml

@@ -22,6 +22,7 @@ server:
   servlet:
     # 应用的访问路径
     context-path: /
+  # undertow 配置
   undertow:
     # HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的
     max-http-post-size: -1
@@ -34,6 +35,14 @@ server:
     worker-threads: 256
     # 是否分配的直接内存
     direct-buffers: true
+#  # tomcat 配置
+#  tomcat:
+#    # tomcat的URI编码
+#    uri-encoding: UTF-8
+#    # tomcat最大线程数,默认为200
+#    max-threads: 500
+#    # Tomcat启动初始化的线程数,默认值25
+#    min-spare-threads: 30
 
 # 日志配置
 logging:

+ 9 - 1
ruoyi-framework/pom.xml

@@ -17,6 +17,7 @@
 
     <dependencies>
 
+        <!-- BEGIN 如果想使用 Tomcat 注释掉以下代码 -->
         <!-- SpringBoot Web容器 -->
          <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -28,12 +29,19 @@
                  </exclusion>
              </exclusions>
         </dependency>
-
         <!-- web 容器使用 undertow 性能更强 -->
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-undertow</artifactId>
         </dependency>
+        <!-- END -->
+
+        <!-- BEGIN 如果想使用 Tomcat 解除以下代码注释 -->
+<!--        <dependency>-->
+<!--            <groupId>org.springframework.boot</groupId>-->
+<!--            <artifactId>spring-boot-starter-web</artifactId>-->
+<!--        </dependency>-->
+        <!-- END -->
 
         <!-- SpringBoot 拦截器 -->
         <dependency>