Browse Source

Upgrade hserver Framework version and optimize configuration (#7564)

* hserver framework submit

* hserver framework submit

* lowercase fix

* Required response header missing: Date fix

* Date format fix

* update hserver version

* update hserver threadPool

* update hserver

* update hserver

* update hserver query

* update hserver query

* Update README.md

* update hserver query

* update hserver query

* update hserver query

* update hserver query

* update hserver query

* update hserver query

* Optimal configuration of hserver framework

* Optimal configuration of hserver framework

* Optimal configuration of hserver framework

* Upgrade hserver Framework version and optimize configuration

* Upgrade hserver Framework version and optimize configuration

* Upgrade hserver Framework version and optimize configuration

* Upgrade hserver Framework version and optimize configuration

* Upgrade hserver Framework version and optimize configuration

* Upgrade hserver Framework version and optimize configuration

* Upgrade hserver Framework version and optimize configuration

* Upgrade hserver Framework version and optimize configuration

* Upgrade hserver Framework version and optimize configuration

* Upgrade hserver Framework version and optimize configuration

* Upgrade hserver Framework version and optimize configuration

* Upgrade hserver Framework version and optimize configuration

* Upgrade hserver Framework version and optimize configuration

* Upgrade hserver Framework version and optimize configuration

Co-authored-by: 黑小马 <[email protected]>
黑小马 3 years ago
parent
commit
38292cdc7f

+ 17 - 24
frameworks/Java/hserver/pom.xml

@@ -7,18 +7,28 @@
     <groupId>com.test.hserver</groupId>
     <artifactId>hserver</artifactId>
     <version>1.0</version>
+
+    <parent>
+        <artifactId>hserver-parent</artifactId>
+        <groupId>cn.hserver</groupId>
+        <version>3.0.0</version>
+    </parent>
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <version.hikaricp>3.3.1</version.hikaricp>
-        <version.postgres>42.4.1</version.postgres>
-        <version.hserver>2.9.90</version.hserver>
+        <version.postgres>42.3.3</version.postgres>
     </properties>
 
     <dependencies>
+        <!--    核心依赖-->
+        <dependency>
+            <artifactId>hserver</artifactId>
+            <groupId>cn.hserver</groupId>
+        </dependency>
+        <!--    web框架 -->
         <dependency>
-            <groupId>top.hserver</groupId>
-            <artifactId>HServer</artifactId>
-            <version>${version.hserver}</version>
+            <artifactId>hserver-plugin-web</artifactId>
+            <groupId>cn.hserver</groupId>
         </dependency>
         <dependency>
             <groupId>com.zaxxer</groupId>
@@ -34,25 +44,8 @@
     <build>
         <plugins>
             <plugin>
-                <groupId>net.hserver.plugins.maven</groupId>
-                <artifactId>hserver-maven-plugin</artifactId>
-                <version>3.0</version>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>8</source>
-                    <target>8</target>
-                </configuration>
+                <artifactId>hserver-plugin-maven</artifactId>
+                <groupId>cn.hserver</groupId>
             </plugin>
         </plugins>
     </build>

+ 3 - 3
frameworks/Java/hserver/src/main/java/com/test/hserver/StartApp.java

@@ -1,8 +1,8 @@
 package com.test.hserver;
 
-import top.hserver.HServerApplication;
-import top.hserver.core.ioc.annotation.HServerBoot;
-import top.hserver.core.server.context.ConstConfig;
+
+import cn.hserver.HServerApplication;
+import cn.hserver.core.ioc.annotation.HServerBoot;
 
 /**
  * @author hxm

+ 2 - 2
frameworks/Java/hserver/src/main/java/com/test/hserver/bean/World.java

@@ -1,9 +1,9 @@
 package com.test.hserver.bean;
 
 public class World implements Comparable<World> {
-  private int id;
+  private final int id;
 
-  private int randomNumber;
+  private final int randomNumber;
 
   public World(int id, int randomNumber) {
     this.id = id;

+ 4 - 4
frameworks/Java/hserver/src/main/java/com/test/hserver/controller/TestController.java

@@ -1,13 +1,13 @@
 package com.test.hserver.controller;
 
+import cn.hserver.core.ioc.annotation.Autowired;
+import cn.hserver.plugin.web.annotation.Controller;
+import cn.hserver.plugin.web.annotation.GET;
+import cn.hserver.plugin.web.interfaces.HttpResponse;
 import com.test.hserver.bean.Fortune;
 import com.test.hserver.bean.Message;
 import com.test.hserver.bean.World;
 import com.test.hserver.util.DateUtil;
-import top.hserver.core.interfaces.HttpResponse;
-import top.hserver.core.ioc.annotation.Autowired;
-import top.hserver.core.ioc.annotation.Controller;
-import top.hserver.core.ioc.annotation.GET;
 
 import javax.sql.DataSource;
 import java.sql.Connection;

+ 3 - 3
frameworks/Java/hserver/src/main/java/com/test/hserver/db/DataSourceConfig.java

@@ -1,9 +1,9 @@
 package com.test.hserver.db;
 
+import cn.hserver.core.ioc.annotation.Autowired;
+import cn.hserver.core.ioc.annotation.Bean;
+import cn.hserver.core.ioc.annotation.Configuration;
 import com.zaxxer.hikari.HikariDataSource;
-import top.hserver.core.ioc.annotation.Autowired;
-import top.hserver.core.ioc.annotation.Bean;
-import top.hserver.core.ioc.annotation.Configuration;
 
 import javax.sql.DataSource;
 

+ 2 - 1
frameworks/Java/hserver/src/main/java/com/test/hserver/db/PostgresConfig.java

@@ -1,6 +1,7 @@
 package com.test.hserver.db;
 
-import top.hserver.core.ioc.annotation.ConfigurationProperties;
+
+import cn.hserver.core.ioc.annotation.ConfigurationProperties;
 
 @ConfigurationProperties
 public class PostgresConfig {

+ 2 - 2
frameworks/Java/hserver/src/main/java/com/test/hserver/task/TimeAdd.java

@@ -1,8 +1,8 @@
 package com.test.hserver.task;
 
+import cn.hserver.core.ioc.annotation.Bean;
+import cn.hserver.core.ioc.annotation.Task;
 import com.test.hserver.util.DateUtil;
-import top.hserver.core.ioc.annotation.Bean;
-import top.hserver.core.ioc.annotation.Task;
 
 @Bean
 public class TimeAdd {

+ 3 - 3
frameworks/Java/hserver/src/main/resources/app.properties

@@ -2,7 +2,7 @@ jdbcUrl= jdbc:postgresql://tfb-database:5432/hello_world
 username= benchmarkdbuser
 password= benchmarkdbpass
 maximumPoolSize= 256
+
 level=info
-businessPool=-1
-bossPool=2
-workerPool=4
+#业务线程池
+web.businessPool=-1