Skip to content

Commit e1edb68

Browse files
author
litongjava
committed
change name to handler
1 parent 987748f commit e1edb68

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/MainApp.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import com.litongjava.tio.http.server.config.EhCachePluginConfig;
66
import com.litongjava.tio.http.server.config.EnjoyEngineConfig;
77
import com.litongjava.tio.http.server.config.MysqlDbConfig;
8-
import com.litongjava.tio.http.server.controller.CacheController;
9-
import com.litongjava.tio.http.server.controller.DbController;
10-
import com.litongjava.tio.http.server.controller.IndexController;
8+
import com.litongjava.tio.http.server.handler.CacheHandler;
9+
import com.litongjava.tio.http.server.handler.DbHandler;
1110
import com.litongjava.tio.http.server.handler.DefaultHttpRequestDispatcher;
11+
import com.litongjava.tio.http.server.handler.IndexHandler;
1212
import com.litongjava.tio.http.server.router.DefaultHttpRequestRouter;
1313
import com.litongjava.tio.http.server.router.HttpRequestRouter;
1414
import com.litongjava.tio.server.ServerTioConfig;
@@ -21,20 +21,20 @@ public static void main(String[] args) {
2121
EnvUtils.buildCmdArgsMap(args);
2222
EnvUtils.load();
2323
// add route
24-
IndexController controller = new IndexController();
24+
IndexHandler controller = new IndexHandler();
2525

2626
HttpRequestRouter simpleHttpRoutes = new DefaultHttpRequestRouter();
2727
simpleHttpRoutes.add("/", controller::index);
2828
simpleHttpRoutes.add("/plaintext", controller::plaintext);
2929
simpleHttpRoutes.add("/json", controller::json);
3030

31-
DbController dbQueryController = new DbController();
31+
DbHandler dbQueryController = new DbHandler();
3232
simpleHttpRoutes.add("/db", dbQueryController::db);
3333
simpleHttpRoutes.add("/queries", dbQueryController::queries);
3434
simpleHttpRoutes.add("/updates", dbQueryController::updates);
3535
simpleHttpRoutes.add("/fortunes", dbQueryController::fortunes);
3636

37-
CacheController cacheController = new CacheController();
37+
CacheHandler cacheController = new CacheHandler();
3838
simpleHttpRoutes.add("/cachedQuery", cacheController::cachedQuery);
3939

4040
// config server
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.litongjava.tio.http.server.controller;
1+
package com.litongjava.tio.http.server.handler;
22

33
import java.util.List;
44
import java.util.Map;
@@ -14,7 +14,7 @@
1414
import com.litongjava.tio.http.common.HttpResponse;
1515
import com.litongjava.tio.http.server.utils.RandomUtils;
1616

17-
public class CacheController {
17+
public class CacheHandler {
1818
// private Logger log = LoggerFactory.getLogger(this.getClass());
1919

2020
public HttpResponse cachedQuery(HttpRequest request) {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.litongjava.tio.http.server.controller;
1+
package com.litongjava.tio.http.server.handler;
22

33
import java.util.ArrayList;
44
import java.util.Comparator;
@@ -22,7 +22,7 @@
2222
import com.litongjava.tio.http.server.util.Resps;
2323
import com.litongjava.tio.http.server.utils.RandomUtils;
2424

25-
public class DbController {
25+
public class DbHandler {
2626

2727
public HttpResponse db(HttpRequest request) {
2828
Integer id = request.getInt("id");
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.litongjava.tio.http.server.controller;
1+
package com.litongjava.tio.http.server.handler;
22

33
import com.alibaba.fastjson2.JSON;
44
import com.litongjava.tio.http.common.HeaderName;
@@ -12,7 +12,7 @@
1212
* ab -k -n1000000 -c10 http://127.0.0.1:8080/json
1313
* ab -k -n1000000 -c10 http://127.0.0.1:8080/plaintext
1414
*/
15-
public class IndexController {
15+
public class IndexHandler {
1616
private static final String HELLO_WORLD = "Hello, World!";
1717

1818
private static final byte[] HELLO_WORLD_BYTES = HELLO_WORLD.getBytes();

0 commit comments

Comments
 (0)