From effc5e90ce480a4cfded796d021d384b034448d0 Mon Sep 17 00:00:00 2001 From: WilliamSESE <87509674+WilliamSESE@users.noreply.github.com> Date: Thu, 12 Aug 2021 20:13:45 +0800 Subject: [PATCH 001/129] =?UTF-8?q?=E5=B0=86=E6=B3=A8=E8=A7=A3=E7=94=B1@Co?= =?UTF-8?q?mponent=E6=94=B9=E4=B8=BA@Service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 该类在系统中处于服务层,所以使用@Service注解更合适 --- .../java/com/bage/study/springboot/aop/AsyncService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/study-spring-boot/src/main/java/com/bage/study/springboot/aop/AsyncService.java b/study-spring-boot/src/main/java/com/bage/study/springboot/aop/AsyncService.java index c00ac6bdf..1a84d86d4 100644 --- a/study-spring-boot/src/main/java/com/bage/study/springboot/aop/AsyncService.java +++ b/study-spring-boot/src/main/java/com/bage/study/springboot/aop/AsyncService.java @@ -1,9 +1,9 @@ package com.bage.study.springboot.aop; import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; -@Component +@Service public class AsyncService { public void async1() { @@ -14,4 +14,4 @@ public void async1() { public void async2() { System.out.println("2:" + Thread.currentThread().getName()); } -} \ No newline at end of file +} From d2d33efd16c15c2b1a395032339a412cc28dc77a Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Tue, 24 Aug 2021 23:54:42 +0800 Subject: [PATCH 002/129] index --- study-summary/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/study-summary/README.md b/study-summary/README.md index 94c481bff..c655b5aaf 100644 --- a/study-summary/README.md +++ b/study-summary/README.md @@ -66,6 +66,10 @@ JDK各个版本特性; 数据库索引; +数据库读取,按页读取 + +各种索引对比 + 索引结构原理; innerDB等; From 6071fd006bdb09c7f6e06db6020b22191bc9fe1c Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Sun, 29 Aug 2021 23:56:42 +0800 Subject: [PATCH 003/129] event --- study-flutter/lib/component/event/BaseEvent.dart | 3 +++ study-flutter/lib/component/event/EventBus.dart | 3 +-- study-flutter/lib/component/event/EventListener.dart | 4 +--- study-flutter/lib/startup/Application.dart | 2 -- study-flutter/lib/view/settings/FeedbackUpdateEvent.dart | 3 +-- study-flutter/lib/view/settings/Feedbacks.dart | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-) create mode 100644 study-flutter/lib/component/event/BaseEvent.dart diff --git a/study-flutter/lib/component/event/BaseEvent.dart b/study-flutter/lib/component/event/BaseEvent.dart new file mode 100644 index 000000000..4e53e9c0b --- /dev/null +++ b/study-flutter/lib/component/event/BaseEvent.dart @@ -0,0 +1,3 @@ + + +class BaseEvent {} diff --git a/study-flutter/lib/component/event/EventBus.dart b/study-flutter/lib/component/event/EventBus.dart index bd06cc88e..dae9116c1 100644 --- a/study-flutter/lib/component/event/EventBus.dart +++ b/study-flutter/lib/component/event/EventBus.dart @@ -1,7 +1,6 @@ +import 'package:app_lu_lu/component/event/BaseEvent.dart'; import 'package:event_bus/event_bus.dart' as marcojakob; -import 'EventListener.dart'; - class EventBus { static marcojakob.EventBus _eventBus = marcojakob.EventBus(); diff --git a/study-flutter/lib/component/event/EventListener.dart b/study-flutter/lib/component/event/EventListener.dart index 20c54a8c5..48fec26f0 100644 --- a/study-flutter/lib/component/event/EventListener.dart +++ b/study-flutter/lib/component/event/EventListener.dart @@ -1,7 +1,5 @@ abstract class EventListener { - dynamic data; - void consume(dynamic data); -} +} \ No newline at end of file diff --git a/study-flutter/lib/startup/Application.dart b/study-flutter/lib/startup/Application.dart index a6d7dc46b..21d52db2b 100644 --- a/study-flutter/lib/startup/Application.dart +++ b/study-flutter/lib/startup/Application.dart @@ -1,7 +1,6 @@ import 'package:app_lu_lu/component/cache/HttpRequestCaches.dart'; import 'package:app_lu_lu/component/cache/TvCaches.dart'; import 'package:app_lu_lu/component/cache/UserCaches.dart'; -import 'package:app_lu_lu/component/event/EventBus.dart'; import 'package:app_lu_lu/component/http/HttpRequests.dart'; import 'package:app_lu_lu/utils/AppUtils.dart'; import 'package:flutter/cupertino.dart'; @@ -16,6 +15,5 @@ class Application { AppUtils.getDeviceId() .then((deviceId) => {UserCaches.setUserId(deviceId.hashCode)}); HttpRequests.init(); - EventBus.initConsumers(); } } diff --git a/study-flutter/lib/view/settings/FeedbackUpdateEvent.dart b/study-flutter/lib/view/settings/FeedbackUpdateEvent.dart index 24ea24280..ee9bd41a3 100644 --- a/study-flutter/lib/view/settings/FeedbackUpdateEvent.dart +++ b/study-flutter/lib/view/settings/FeedbackUpdateEvent.dart @@ -1,7 +1,6 @@ -import 'package:app_lu_lu/component/event/EventListener.dart'; import 'package:app_lu_lu/component/log/Logs.dart'; -class FeedbackUpdateEvent implements BaseEvent { +class FeedbackUpdateEvent { @override var data; diff --git a/study-flutter/lib/view/settings/Feedbacks.dart b/study-flutter/lib/view/settings/Feedbacks.dart index c81e8ea23..721a7510f 100644 --- a/study-flutter/lib/view/settings/Feedbacks.dart +++ b/study-flutter/lib/view/settings/Feedbacks.dart @@ -43,7 +43,7 @@ class _Feedbacks extends State with SingleTickerProviderStateMixin { Logs.info('_insertFeedback responseBody=' + (result?.responseBody ?? "")); setState(() { FeedbackUpdateEvent event = FeedbackUpdateEvent(); - event.data = 1234; + event.data = 1; EventBus.publish(event); }); }).catchError((error) { From 4482d52d68787237750ddea991dae84adaebe637 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Mon, 30 Aug 2021 00:16:07 +0800 Subject: [PATCH 004/129] event bus test case --- study-flutter/lib/component/event/EventBus.dart | 9 +++++---- .../lib/component/event/EventListener.dart | 5 ----- .../lib/view/settings/FeedbackTabView.dart | 9 +++++++++ .../lib/view/settings/FeedbackUpdateEvent.dart | 13 +++---------- study-flutter/lib/view/settings/Feedbacks.dart | 2 +- 5 files changed, 18 insertions(+), 20 deletions(-) delete mode 100644 study-flutter/lib/component/event/EventListener.dart diff --git a/study-flutter/lib/component/event/EventBus.dart b/study-flutter/lib/component/event/EventBus.dart index dae9116c1..4db7757de 100644 --- a/study-flutter/lib/component/event/EventBus.dart +++ b/study-flutter/lib/component/event/EventBus.dart @@ -1,6 +1,7 @@ -import 'package:app_lu_lu/component/event/BaseEvent.dart'; import 'package:event_bus/event_bus.dart' as marcojakob; +typedef EventCallback = void Function(dynamic event); + class EventBus { static marcojakob.EventBus _eventBus = marcojakob.EventBus(); @@ -8,10 +9,10 @@ class EventBus { _eventBus.fire(event); } - static void initConsumers() { - _eventBus.on().listen((event) { + static void consume(EventCallback callback) { + _eventBus.on().listen((event) { // All events are of type UserLoggedInEvent (or subtypes of it). - event.consume(event.data); + callback(event); }); } } diff --git a/study-flutter/lib/component/event/EventListener.dart b/study-flutter/lib/component/event/EventListener.dart deleted file mode 100644 index 48fec26f0..000000000 --- a/study-flutter/lib/component/event/EventListener.dart +++ /dev/null @@ -1,5 +0,0 @@ -abstract class EventListener { - - void consume(dynamic data); - -} \ No newline at end of file diff --git a/study-flutter/lib/view/settings/FeedbackTabView.dart b/study-flutter/lib/view/settings/FeedbackTabView.dart index c91aab981..ca9b12d31 100644 --- a/study-flutter/lib/view/settings/FeedbackTabView.dart +++ b/study-flutter/lib/view/settings/FeedbackTabView.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:app_lu_lu/component/cache/UserCaches.dart'; import 'package:app_lu_lu/component/dialog/Dialogs.dart'; +import 'package:app_lu_lu/component/event/EventBus.dart'; import 'package:app_lu_lu/component/http/HttpRequests.dart'; import 'package:app_lu_lu/component/log/Logs.dart'; import 'package:app_lu_lu/constant/HttpConstant.dart'; @@ -11,6 +12,7 @@ import 'package:app_lu_lu/locale/Translations.dart'; import 'package:app_lu_lu/model/AboutAuthorTab.dart'; import 'package:app_lu_lu/model/AppFeedback.dart'; import 'package:app_lu_lu/model/FeedbackQueryResult.dart'; +import 'package:app_lu_lu/view/settings/FeedbackUpdateEvent.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -67,6 +69,10 @@ class _FeedbackTabState extends State<_FeedbackTabView> { void initState() { showLoading(); _onRefresh(); + EventBus.consume((event) { + Logs.info('event = ${event.toString()}'); + _onRefresh(); + }); } @override @@ -270,6 +276,9 @@ class _FeedbackTabState extends State<_FeedbackTabView> { } Future _onRefresh() async { + if (!mounted) { + return ; + } Map paramJson = new HashMap(); paramJson.putIfAbsent("targetPage", () => 1); paramJson.putIfAbsent("pageSize", () => 100); diff --git a/study-flutter/lib/view/settings/FeedbackUpdateEvent.dart b/study-flutter/lib/view/settings/FeedbackUpdateEvent.dart index ee9bd41a3..234b3c842 100644 --- a/study-flutter/lib/view/settings/FeedbackUpdateEvent.dart +++ b/study-flutter/lib/view/settings/FeedbackUpdateEvent.dart @@ -1,12 +1,5 @@ -import 'package:app_lu_lu/component/log/Logs.dart'; +import 'package:app_lu_lu/component/event/BaseEvent.dart'; -class FeedbackUpdateEvent { - @override - var data; - - @override - void consume(data) { - Logs.info("FeedbackUpdateEvent --- "); - Logs.info(data.toString()); - } +class FeedbackUpdateEvent extends BaseEvent { + String data = "hello world"; } diff --git a/study-flutter/lib/view/settings/Feedbacks.dart b/study-flutter/lib/view/settings/Feedbacks.dart index 721a7510f..0aa79d716 100644 --- a/study-flutter/lib/view/settings/Feedbacks.dart +++ b/study-flutter/lib/view/settings/Feedbacks.dart @@ -43,7 +43,7 @@ class _Feedbacks extends State with SingleTickerProviderStateMixin { Logs.info('_insertFeedback responseBody=' + (result?.responseBody ?? "")); setState(() { FeedbackUpdateEvent event = FeedbackUpdateEvent(); - event.data = 1; + event.data = "hhh"; EventBus.publish(event); }); }).catchError((error) { From a958e344608aff9f39a8cda185af1b620062adfd Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Tue, 31 Aug 2021 00:35:11 +0800 Subject: [PATCH 005/129] Update README.md --- study-flutter/README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/study-flutter/README.md b/study-flutter/README.md index 4a3739342..1c8822fb8 100644 --- a/study-flutter/README.md +++ b/study-flutter/README.md @@ -19,11 +19,9 @@ https://fluttergems.dev/ ### TODO -发布线上 +版本信息的日期 -用户评价 - -版本信息 +用户头像 网络提示,请先连接网络 From e532cc0ee2edf7d3bd0d68560a4e2e4e17612b92 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Wed, 1 Sep 2021 00:54:17 +0800 Subject: [PATCH 006/129] Update README.md --- study-flutter/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/study-flutter/README.md b/study-flutter/README.md index 1c8822fb8..dab377ec6 100644 --- a/study-flutter/README.md +++ b/study-flutter/README.md @@ -19,7 +19,7 @@ https://fluttergems.dev/ ### TODO -版本信息的日期 +发布上线:版本日期、用户头像 用户头像 From e3d77a05049241d5fef3b1b99df8dd670d60537a Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Thu, 2 Sep 2021 00:36:50 +0800 Subject: [PATCH 007/129] Update README.md --- study-flutter/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/study-flutter/README.md b/study-flutter/README.md index dab377ec6..e1ae919db 100644 --- a/study-flutter/README.md +++ b/study-flutter/README.md @@ -21,6 +21,8 @@ https://fluttergems.dev/ 发布上线:版本日期、用户头像 +权限控制问题处理 + 用户头像 网络提示,请先连接网络 From fd18e902cac3208f2f4c380ab98666617d021627 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Sat, 4 Sep 2021 16:00:14 +0800 Subject: [PATCH 008/129] Update README.md --- study-flutter/README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/study-flutter/README.md b/study-flutter/README.md index e1ae919db..9e7a521e6 100644 --- a/study-flutter/README.md +++ b/study-flutter/README.md @@ -19,9 +19,7 @@ https://fluttergems.dev/ ### TODO -发布上线:版本日期、用户头像 - -权限控制问题处理 +权限控制问题 用户头像 From b46fbb51bd5f349fc9565a68772a785a67646f10 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Mon, 13 Sep 2021 13:44:29 +0800 Subject: [PATCH 009/129] drawio images --- study-draw-io/readme.MD | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 study-draw-io/readme.MD diff --git a/study-draw-io/readme.MD b/study-draw-io/readme.MD new file mode 100644 index 000000000..30d82be33 --- /dev/null +++ b/study-draw-io/readme.MD @@ -0,0 +1,3 @@ + +Draw IO ļ + From dd7273b93ed0aab9699a9d2a971518b67a92a55b Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Mon, 13 Sep 2021 13:45:46 +0800 Subject: [PATCH 010/129] db-settlement --- study-draw-io/Untitled Diagram.drawio | 1 + 1 file changed, 1 insertion(+) create mode 100644 study-draw-io/Untitled Diagram.drawio diff --git a/study-draw-io/Untitled Diagram.drawio b/study-draw-io/Untitled Diagram.drawio new file mode 100644 index 000000000..04fb8f3b8 --- /dev/null +++ b/study-draw-io/Untitled Diagram.drawio @@ -0,0 +1 @@ +7Zhdb9owFIZ/TS434bgBektgm1QqVbB1HzeVG5vEkrEjxxTYr99x4hAgiwTiW62EUPz6+MQ+j/0K7OFwuviqSZo8KsqE57fowsN9z/c7XR++rbAshDu/XQix5rSQUCWM+V/mxJZTZ5yybCPQKCUMTzfFSEnJIrOhEa3VfDNsosTmW1MSs5owjoioqz85NUmhdv1OpX9jPE7KN6P2fdEzJWWwW0mWEKrmaxIeeDjUSpniaboImbC1K+tSjPvS0LuamGbS7DJA9/rRr6d41H9+zH4/oweOf/z55LK8ETFzC1aaMv1iNJEZiQxX8oXLiXJLMMuyLrCa1D4a8mqlXmaINg4fboEAQAzhkmkQUN4WgqQZz8MLJeGCDslSzUyZqGz1JnzB6KigZ2MB5BCS2aZNPoHkYzcZ200EjyU8R1AL+8aeZhnMZUgy4yLcOpk2bNFYQLTCAtuZqSkzegkhbgAu96Tbyqjj2vNqY6Cu05L1TdF2InGbMV7lrnjBg0O2Bz6/hq8RFKzTcCJGcEiIjHNmm0hsXalW6XeiY2ackCpuKzp4gxqtis+FCJVQlqxU0mYyKnWdgk3Ksa/KGDUtAbpyrJLmpQh68IHihK3PgRfAdENoo6oNHxuuTahkBnuS56QYYJ0zi3Y3rM07v87ascU7osWnIotrZJ8e9mOb+yGp2O6NrbWFbfvQKSj7ROSWlnBKmTyIh/9/HmsA8Dnrf1erP4Rftv6lyRWxvSwlEZfxsBjZ3gIUnAvQwms8MME5gQU3YYXbTG/ACtuXtsL2gWSPfhAZ5WW+4/tgcF0+2KkVH36VgYCu3QzPQuVazK/7YX6nMb/7S5vf/bsyv+51mV/5h6/mfpeGcGb3a8ByLe6H6rcYH/Z3FPtD/qX9Dx16xXFbBogaeFzMAev3EIUD4vflgE1cTm+B0KzuiPO+tYt2PPgH \ No newline at end of file From b089040437987367456faec2af73791b86db51d2 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Mon, 13 Sep 2021 13:46:40 +0800 Subject: [PATCH 011/129] db-settlement --- study-draw-io/Untitled Diagram.drawio | 89 ++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 1 deletion(-) diff --git a/study-draw-io/Untitled Diagram.drawio b/study-draw-io/Untitled Diagram.drawio index 04fb8f3b8..a433d0ad4 100644 --- a/study-draw-io/Untitled Diagram.drawio +++ b/study-draw-io/Untitled Diagram.drawio @@ -1 +1,88 @@ -7Zhdb9owFIZ/TS434bgBektgm1QqVbB1HzeVG5vEkrEjxxTYr99x4hAgiwTiW62EUPz6+MQ+j/0K7OFwuviqSZo8KsqE57fowsN9z/c7XR++rbAshDu/XQix5rSQUCWM+V/mxJZTZ5yybCPQKCUMTzfFSEnJIrOhEa3VfDNsosTmW1MSs5owjoioqz85NUmhdv1OpX9jPE7KN6P2fdEzJWWwW0mWEKrmaxIeeDjUSpniaboImbC1K+tSjPvS0LuamGbS7DJA9/rRr6d41H9+zH4/oweOf/z55LK8ETFzC1aaMv1iNJEZiQxX8oXLiXJLMMuyLrCa1D4a8mqlXmaINg4fboEAQAzhkmkQUN4WgqQZz8MLJeGCDslSzUyZqGz1JnzB6KigZ2MB5BCS2aZNPoHkYzcZ200EjyU8R1AL+8aeZhnMZUgy4yLcOpk2bNFYQLTCAtuZqSkzegkhbgAu96Tbyqjj2vNqY6Cu05L1TdF2InGbMV7lrnjBg0O2Bz6/hq8RFKzTcCJGcEiIjHNmm0hsXalW6XeiY2ackCpuKzp4gxqtis+FCJVQlqxU0mYyKnWdgk3Ksa/KGDUtAbpyrJLmpQh68IHihK3PgRfAdENoo6oNHxuuTahkBnuS56QYYJ0zi3Y3rM07v87ascU7osWnIotrZJ8e9mOb+yGp2O6NrbWFbfvQKSj7ROSWlnBKmTyIh/9/HmsA8Dnrf1erP4Rftv6lyRWxvSwlEZfxsBjZ3gIUnAvQwms8MME5gQU3YYXbTG/ACtuXtsL2gWSPfhAZ5WW+4/tgcF0+2KkVH36VgYCu3QzPQuVazK/7YX6nMb/7S5vf/bsyv+51mV/5h6/mfpeGcGb3a8ByLe6H6rcYH/Z3FPtD/qX9Dx16xXFbBogaeFzMAev3EIUD4vflgE1cTm+B0KzuiPO+tYt2PPgH \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From f394821f34674ad980eac04997d3a26b8e9047d5 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Mon, 13 Sep 2021 13:52:15 +0800 Subject: [PATCH 012/129] =?UTF-8?q?Revert=20"=E5=B0=86=E6=B3=A8=E8=A7=A3?= =?UTF-8?q?=E7=94=B1@Component=E6=94=B9=E4=B8=BA@Service"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bage/study/springboot/aop/AsyncService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/study-spring-boot/src/main/java/com/bage/study/springboot/aop/AsyncService.java b/study-spring-boot/src/main/java/com/bage/study/springboot/aop/AsyncService.java index 1a84d86d4..c00ac6bdf 100644 --- a/study-spring-boot/src/main/java/com/bage/study/springboot/aop/AsyncService.java +++ b/study-spring-boot/src/main/java/com/bage/study/springboot/aop/AsyncService.java @@ -1,9 +1,9 @@ package com.bage.study.springboot.aop; import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; +import org.springframework.stereotype.Component; -@Service +@Component public class AsyncService { public void async1() { @@ -14,4 +14,4 @@ public void async1() { public void async2() { System.out.println("2:" + Thread.currentThread().getName()); } -} +} \ No newline at end of file From 123bfb03630c9d70a8564c6707805b5f275f5eec Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Tue, 14 Sep 2021 23:03:49 +0800 Subject: [PATCH 013/129] Update README.md --- study-flutter/README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/study-flutter/README.md b/study-flutter/README.md index 9e7a521e6..be77c5278 100644 --- a/study-flutter/README.md +++ b/study-flutter/README.md @@ -19,14 +19,10 @@ https://fluttergems.dev/ ### TODO -权限控制问题 - -用户头像 - 网络提示,请先连接网络 同意提示,多语言问题 -下载进度条(参考https://github.com/rhymelph/r_upgrade/blob/v0.3.2/README_CN.md) +下载进度条(参考 https://github.com/rhymelph/r_upgrade/blob/v0.3.2/README_CN.md) 分享 From 7a74e37cb53f186a95f5c05a549c201fc4e71d2c Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Wed, 15 Sep 2021 00:00:39 +0800 Subject: [PATCH 014/129] tomcat --- study-redis/README.md | 35 +++++++- study-summary/README.md | 2 +- study-tomcat/README.md | 181 +++++++++++++++++++++++++++++++++++++++ study-tomcat/readme.docx | Bin 21199 -> 0 bytes 4 files changed, 213 insertions(+), 5 deletions(-) create mode 100644 study-tomcat/README.md delete mode 100644 study-tomcat/readme.docx diff --git a/study-redis/README.md b/study-redis/README.md index 628d476a4..e7beef239 100644 --- a/study-redis/README.md +++ b/study-redis/README.md @@ -84,7 +84,7 @@ redis采用的是定期删除+惰性删除策略 192.168.127.128:6379>exists name age departmentAddress(该值存在) (integer)2 - + 192.168.127.128:6379>exists name1 age1 departmentAddress(该值存在) (integer)0 - 语法:flushdb,清空当前数据所有的键值对。 @@ -140,7 +140,7 @@ redis采用的是定期删除+惰性删除策略 port 6379 4. 绑定的主机地址 bind 127.0.0.1 -5.当 客户端闲置多长时间后关闭连接,如果指定为0,表示关闭该功能 + 5.当 客户端闲置多长时间后关闭连接,如果指定为0,表示关闭该功能 timeout 300 6. 指定日志记录级别,Redis总共支持四个级别:debug、verbose、notice、warning,默认为verbose loglevel verbose @@ -155,7 +155,7 @@ redis采用的是定期删除+惰性删除策略 save 300 10 save 60 10000 分别表示900秒(15分钟)内有1个更改,300秒(5分钟)内有10个更改以及60秒内有10000个更改。 - + 10. 指定存储至本地数据库时是否压缩数据,默认为yes,Redis采用LZF压缩,如果为了节省CPU时间,可以关闭该选项,但会导致数据库文件变的巨大 rdbcompression yes 11. 指定本地数据库文件名,默认值为dump.rdb @@ -181,7 +181,7 @@ redis采用的是定期删除+惰性删除策略 always:表示每次更新操作后手动调用fsync()将数据写到磁盘(慢,安全) everysec:表示每秒同步一次(折衷,默认值) appendfsync everysec - + 21. 指定是否启用虚拟内存机制,默认值为no,简单的介绍一下,VM机制将数据分页存放,由Redis将访问量较少的页即冷数据swap到磁盘上,访问多的页面由磁盘自动换出到内存中(在后面的文章我会仔细分析Redis的VM机制) vm-enabled no 22. 虚拟内存文件路径,默认值为/tmp/redis.swap,不可多个Redis实例共享 @@ -233,3 +233,30 @@ Codis一个比较大的优点是可以不停机动态新增或删除数据节点 客户端分片 +## 慢查询日志 ## + +### 设置慢日志时间阈值 + +### 查询慢查询日志 + +### 扫描大Key + +需要注意的是当我们在线上实例进行大key扫描时,Redis的QPS会突增,为了降低扫描过程中对Redis的影响,我们需要控制扫描的频率,使用-i参数控制即可,它表示扫描过程中每次扫描的时间间隔,单位是秒。 + +### 大量key集中过期 + +有时你会发现,平时在使用Redis时没有延时比较大的情况,但在某个时间点突然出现一波延时,而且报慢的时间点很有规律,例如某个整点,或者间隔多久就会发生一次。 + +如果出现这种情况,就需要考虑是否存在大量key集中过期的情况 + +### **实例内存达到上限** + +实例的内存达到了maxmemory后,你会发现之后的每次写入新的数据,有可能变慢了。 + +导致变慢的原因是,当Redis内存达到maxmemory后,每次写入新的数据之前,必须先踢出一部分数据,让内存维持在maxmemory之下。 + +这个踢出旧数据的逻辑也是需要消耗时间的,而具体耗时的长短,要取决于配置的淘汰策略: + +### **fork耗时严重** + +执行生成RDB和AOF重写任务导致的。 diff --git a/study-summary/README.md b/study-summary/README.md index c655b5aaf..5ebf9c296 100644 --- a/study-summary/README.md +++ b/study-summary/README.md @@ -29,7 +29,7 @@ https://github.com/akullpp/awesome-java https://github.com/AobingJava/JavaFamily - +https://github.com/tuteng/Best-websites-a-programmer-should-visit-zh#interview-preparation ## [Java 基础](https://github.com/bage2014/interview/blob/master/README-Java.md) ## diff --git a/study-tomcat/README.md b/study-tomcat/README.md new file mode 100644 index 000000000..9d8aa1e78 --- /dev/null +++ b/study-tomcat/README.md @@ -0,0 +1,181 @@ +# study-Tomcat # +## ***性能优化*** + +参考链接: + +https://www.cnblogs.com/zhuawang/p/5213192.html + +***\*一:Tomcat内存优化,启动时告诉JVM我要一块大内存(调优内存是最直接的方式)\**** + +Windows 下的catalina.bat + +Linux 下的catalina.sh 如: + +JAVA_OPTS='-Xms256m -Xmx512m' + +-Xms JVM初始化堆的大小 + +-Xmx JVM堆的最大值 实际参数大小根据服务器配置或者项目具体设置. + +***\*二:Tomcat 线程优化\**** 在server.xml中 如: + + + +maxThreads="X" 表示最多同时处理X个连接 + +minSpareThreads="X" 初始化X个连接 + +maxSpareThreads="X" 表示如果最多可以有X个线程,一旦超过X个,则会关闭不在需要的线程 + +acceptCount="X" 当同时连接的人数达到maxThreads时,还可以排队,队列大小为X.超过X就不处理 + +***\*三:Tomcat IO优化\**** + +1:同步阻塞IO(JAVA BIO) 同步并阻塞,服务器实现模式为一个连接一个线程(one connection one thread 想想都觉得恐怖,线程可是非常宝贵的资源),当然可以通过线程池机制改善. + +2:JAVA NIO:又分为同步非阻塞IO,异步阻塞IO 与BIO最大的区别one request one thread.可以复用同一个线程处理多个connection(多路复用). + +3:,异步非阻塞IO(Java NIO2又叫AIO) 主要与NIO的区别主要是操作系统的底层区别.可以做个比喻:比作快递,NIO就是网购后要自己到官网查下快递是否已经到了(可能是多次),然后自己去取快递;AIO就是快递员送货上门了(不用关注快递进度)。 + +BIO方式适用于连接数目比较小且固定的架构,这种方式对服务器资源要求比较高,并发局限于应用中,JDK1.4以前的唯一选择,但程序直观简单易理解. + +NIO方式适用于连接数目多且连接比较短(轻操作)的架构,比如聊天服务器,并发局限于应用中,编程比较复杂,JDK1.4开始支持. + +AIO方式使用于连接数目多且连接比较长(重操作)的架构,比如相册服务器,充分调用OS参与并发操作,编程比较复杂,JDK7开始支持. + +在server.xml中 + + + +实现对Tomcat的IO切换. + +## **2.** ***\*配置\**** + +参考链接: + +https://www.cnblogs.com/xuwc/p/8523681.html + + 配置文件 + server.xml:主要的配置文件。 + web.xml:缺省的web app配置,WEB-INF/web.xml会覆盖该配置。 + context.xml:不清楚跟server.xml里面的context是否有关系。 + + server.xml配置 + server标签 + port:指定一个端口,这个端口负责监听关闭tomcat的请求。 + shutdown:指定向端口发送的命令字符串。 + + service标签 + name:指定service的名字。 + + Connector(表示客户端和service之间的连接)标签 + +port:指定服务器端要创建的端口号,并在这个端口监听来自客户端的请求。 + minProcessors:服务器启动时创建的处理请求的线程数。 + maxProcessors:最大可以创建的处理请求的线程数。 + enableLookups:如果为true,则可以通过调用request.getRemoteHost()进行DNS查询来得到远程客户端的实际主机名,若为false则不进行DNS查询,而是返回其ip地址。 + redirectPort:指定服务器正在处理http请求时收到了一个SSL传输请求后重定向的端口号。 + acceptCount:指定当所有可以使用的处理请求的线程数都被使用时,可以放到处理队列中的请求数,超过这个数的请求将不予处理。 + connectionTimeout:指定超时的时间数(以毫秒为单位)。 + + Engine(表示指定service中的请求处理机,接收和处理来自Connector的请求)标签 + defaultHost:指定缺省的处理请求的主机名,它至少与其中的一个host元素的name属性值是一样的。 + + Context(表示一个web应用程序,通常为WAR文件,关于WAR的具体信息见servlet规范)标签 + docBase:该web应用的文档基准目录(Document Base,也称为Context Root),或者是WAR文件的路径。可以使用绝对路径,也可以使用相对于context所属的Host的appBase路径。 + path:表示此web应用程序的url的前缀,这样请求的url为http://localhost:8080/path/****。 + ***\*reloadable:这个属性非常重要,如果为true,则tomcat会自动检测应用程序的/WEB-INF/lib和/WEB-INF/classes目录的变化,自动装载新的应用程序,我们可以在不重起tomcat的情况下改变应用程序。\**** + useNaming:如果希望Catalina为该web应用使能一个JNDI InitialContext对象,设为true。该InitialialContext符合J2EE平台的约定,缺省值为true。 + workDir:Context提供的临时目录的路径,用于servlet的临时读/写。利用javax.servlet.context.tempdir属性,servlet可以访问该目录。如果没有指定,使用$CATALINA_HOME/work下一个合适的目录。 + swallowOutput:如果该值为true,System.out和System.err的输出被重定向到web应用的logger。如果没有指定,缺省值为false + debug:与这个Engine关联的Logger记录的调试信息的详细程度。数字越大,输出越详细。如果没有指定,缺省为0。 + + host(表示一个虚拟主机)标签 + name:指定主机名。 + appBase:应用程序基本目录,即存放应用程序的目录。 + unpackWARs:如果为true,则tomcat会自动将WAR文件解压,否则不解压,直接从WAR文件中运行应用程序。 + + Logger(表示日志,调试和错误信息)标签 + className:指定logger使用的类名,此类必须实现org.apache.catalina.Logger接口。 + prefix:指定log文件的前缀。 + suffix:指定log文件的后缀。 + timestamp:如果为true,则log文件名中要加入时间,如下例:localhost_log.2001-10-04.txt。 + + Realm(表示存放用户名,密码及role的数据库)标签 + className:指定Realm使用的类名,此类必须实现org.apache.catalina.Realm接口。 + + Valve(功能与Logger差不多,其prefix和suffix属性解释和Logger 中的一样)标签 + className:指定Valve使用的类名,如用org.apache.catalina.valves.AccessLogValve类可以记录应用程序的访问信息。 + directory:指定log文件存放的位置。 + pattern:有两个值,common方式记录远程主机名或ip地址,用户名,日期,第一行请求的字符串,HTTP响应代码,发送的字节数。combined方式比common方式记录的值更多。 + +# ***\*tomcat的安全配置:\**** + +https://blog.51cto.com/8248183/2062343 + + + +首次安装完成后立即删除webapps下面的所有代码 +rm -rf /srv/apache-tomcat/webapps/* +注释或删除 tomcat-users.xml 所有用户权限,看上去如下: + +# ***\*cat conf/tomcat-users.xml\**** + + + + + + +2、隐藏tomcat版本 +01.首先找到这个jar包,$TOMCAT_HOME/lib/catalina.jar +02.解压catalina.jar之后按照路径\org\apache\catalina\util\ServerInfo.properties找到文件 +03.打开ServerInfo.properties文件修改如下:把server.number、server.built置空 +server.info=Apache Tomcat +server.number= +server.built= +04.重新打成jar包,重启tomcat。 +3、隐藏tomcat 的服务类型 +conf/server.xml文件中,为connector元素添加server=" +",注意不是空字符串,是空格组成的长度为1的字符串,或者输入其他的服务类型,这时候,在response header中就没有server的信息啦! +4、应用程序安全 +关闭war自动部署 unpackWARs="false" autoDeploy="false"。防止被植入木马等恶意程序 +5、修改服务监听端口 +一般公司的 Tomcat 都是放在内网的,因此我们针对 Tomcat 服务的监听地址都是内网地址。 +修改实例: + + + + + +## 手写Tomcat + +参考连接: https://blog.csdn.net/weixin_39033443/article/details/83901722、https://www.cnblogs.com/jyroy/p/10778760.html + +### 主要步骤 + +HTTP 协议基本解析 + +处理 GET 或者 POST 请求逻辑 + +启动容器(socket) + + + + + + + + + diff --git a/study-tomcat/readme.docx b/study-tomcat/readme.docx deleted file mode 100644 index f4eab1684ab77261f551842d13321d24d3b61958..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21199 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 From 9ddcdb7f72f270a9f96a5342fe75f09dd2d0c38d Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Thu, 16 Sep 2021 23:39:58 +0800 Subject: [PATCH 015/129] thread pool --- study-java/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/study-java/README.md b/study-java/README.md index 1379db1e1..a9c97ac68 100644 --- a/study-java/README.md +++ b/study-java/README.md @@ -17,6 +17,14 @@ - 序列化存储规则 +java 线程池 + +- 参数 +- 提交过程 +- 结束过程 +- 注意事项 + +参考: 池子技术:https://mp.weixin.qq.com/s?__biz=MzUxMzQ0Njc1NQ==&mid=2247494137&idx=1&sn=85962cae0f772c2b41298dd322c6ce5a&chksm=f957aff5ce2026e3201a7b26c08cce9788b340ae371e432b13ef8d035f491cbc55ff3a6b9b79&scene=126&sessionid=1631634578&key=4f90c08c96d622750d1f94cfc9c828d2b4f9b8a4d242217acb0c892b1f5b508c3361dc32b972957612ff0fb223133a8ce49e1f65df8f4ce0aea14a1ee9521ba15fb08ac413c4a7ec31cddc52f10866e62f5854ceb9c8f6d4fc71e97d72416567c92af6c1b4572fb0e40c90d6e037f8e77fc6424650165ad3aa2d40bbe19947fa&ascene=1&uin=MjU5MTQ1MDcxMQ%3D%3D&devicetype=Windows+10+x64&version=6302019c&lang=zh_CN&exportkey=A%2FarF0N%2Fbt0u8YbyerDiyRY%3D&pass_ticket=Uc9EXPQYEBD8FJh0ig5oIlm3BsTVmcxdxPOZc%2BFgOdCZbEfmuz9f7krxzG470APE&wx_header=0&fontgear=2 怎么实现Java的序列化 From b9a18b586f1f77f2e066d2203b52351834da006b Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Tue, 21 Sep 2021 20:02:38 +0800 Subject: [PATCH 016/129] settlemeng --- study-draw-io/Untitled Diagram.drawio | 89 +-------------------------- 1 file changed, 1 insertion(+), 88 deletions(-) diff --git a/study-draw-io/Untitled Diagram.drawio b/study-draw-io/Untitled Diagram.drawio index a433d0ad4..9416c154a 100644 --- a/study-draw-io/Untitled Diagram.drawio +++ b/study-draw-io/Untitled Diagram.drawio @@ -1,88 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +UzV2zq1wL0osyPDNT0nNUTV2VTV2LsrPL4GwciucU3NyVI0MMlNUjV1UjYwMgFjVyA2HrCFY1qAgsSg1rwSLBiADYTaQg2Y1AA== \ No newline at end of file From 09375ee0fa4957c59beb8b7da8a56502dd5dc89c Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Tue, 21 Sep 2021 20:03:40 +0800 Subject: [PATCH 017/129] settlement --- study-draw-io/Untitled Diagram.drawio | 66 ++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/study-draw-io/Untitled Diagram.drawio b/study-draw-io/Untitled Diagram.drawio index 9416c154a..4d5d421df 100644 --- a/study-draw-io/Untitled Diagram.drawio +++ b/study-draw-io/Untitled Diagram.drawio @@ -1 +1,65 @@ -UzV2zq1wL0osyPDNT0nNUTV2VTV2LsrPL4GwciucU3NyVI0MMlNUjV1UjYwMgFjVyA2HrCFY1qAgsSg1rwSLBiADYTaQg2Y1AA== \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From ce045cd4e9398b4306c64a00214a5e7a7e3c9f86 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Tue, 21 Sep 2021 20:05:15 +0800 Subject: [PATCH 018/129] settlement --- study-draw-io/Untitled Diagram.drawio | 112 +++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 1 deletion(-) diff --git a/study-draw-io/Untitled Diagram.drawio b/study-draw-io/Untitled Diagram.drawio index 4d5d421df..4aac42e27 100644 --- a/study-draw-io/Untitled Diagram.drawio +++ b/study-draw-io/Untitled Diagram.drawio @@ -1,4 +1,4 @@ - + @@ -59,6 +59,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 3813a2ad2d2761ee446ed5d84c5c91679ca00940 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Wed, 22 Sep 2021 20:45:14 +0800 Subject: [PATCH 019/129] Update README.md --- study-java/README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/study-java/README.md b/study-java/README.md index a9c97ac68..328caa433 100644 --- a/study-java/README.md +++ b/study-java/README.md @@ -16,8 +16,7 @@ - 对敏感字段加密 - 序列化存储规则 - -java 线程池 +### java 线程池 - 参数 - 提交过程 @@ -26,6 +25,14 @@ java 线程池 参考: 池子技术:https://mp.weixin.qq.com/s?__biz=MzUxMzQ0Njc1NQ==&mid=2247494137&idx=1&sn=85962cae0f772c2b41298dd322c6ce5a&chksm=f957aff5ce2026e3201a7b26c08cce9788b340ae371e432b13ef8d035f491cbc55ff3a6b9b79&scene=126&sessionid=1631634578&key=4f90c08c96d622750d1f94cfc9c828d2b4f9b8a4d242217acb0c892b1f5b508c3361dc32b972957612ff0fb223133a8ce49e1f65df8f4ce0aea14a1ee9521ba15fb08ac413c4a7ec31cddc52f10866e62f5854ceb9c8f6d4fc71e97d72416567c92af6c1b4572fb0e40c90d6e037f8e77fc6424650165ad3aa2d40bbe19947fa&ascene=1&uin=MjU5MTQ1MDcxMQ%3D%3D&devicetype=Windows+10+x64&version=6302019c&lang=zh_CN&exportkey=A%2FarF0N%2Fbt0u8YbyerDiyRY%3D&pass_ticket=Uc9EXPQYEBD8FJh0ig5oIlm3BsTVmcxdxPOZc%2BFgOdCZbEfmuz9f7krxzG470APE&wx_header=0&fontgear=2 +### 阻塞队列 + +- 阻塞队列常见实现 +- 常用方法 +- 阻塞队列实现 +- 手写一个阻塞队列 + + 怎么实现Java的序列化 为什么实现了java.io.Serializable接口才能被序列化 From e1eb5a0740e0c4aac7be5a87e40c1167491e30f0 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Thu, 23 Sep 2021 07:19:58 +0800 Subject: [PATCH 020/129] Update README.md --- study-flutter/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/study-flutter/README.md b/study-flutter/README.md index be77c5278..2459b2c7d 100644 --- a/study-flutter/README.md +++ b/study-flutter/README.md @@ -19,6 +19,8 @@ https://fluttergems.dev/ ### TODO +服务端代码改造 + 网络提示,请先连接网络 同意提示,多语言问题 From 3ab20e913cdd79963d5c03443f684340724133c0 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Sat, 25 Sep 2021 13:35:25 +0800 Subject: [PATCH 021/129] app ref --- study-flutter/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/study-flutter/README.md b/study-flutter/README.md index 2459b2c7d..2c6a0c7b0 100644 --- a/study-flutter/README.md +++ b/study-flutter/README.md @@ -36,6 +36,21 @@ https://fluttergems.dev/ +小组活动:每周体验一款app,产品包括最近热门,评价高,国外好的产品。建议从产品、市场两方面发表看法,也可以自由交流~ +产品方面: +1.主要功能 +2.解决用户什么需求 +3.独特卖点 +4.关键指标 + +市场方面: +1.用户群 +2.推广渠道 +3.收入分析 +4.成本分析 + + + app idea reference: https://www.douban.com/group/689011/ From aaf3ccba6da4f556b4e7087579feecad3ca5132e Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Tue, 28 Sep 2021 14:09:59 +0800 Subject: [PATCH 022/129] Update README.md --- study-flutter/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/study-flutter/README.md b/study-flutter/README.md index 2c6a0c7b0..5f8b1d459 100644 --- a/study-flutter/README.md +++ b/study-flutter/README.md @@ -17,6 +17,8 @@ https://developer.android.google.cn/studio/run/managing-avds#createavd https://fluttergems.dev/ +https://github.com/jahnli/awesome-flutter-plugins + ### TODO 服务端代码改造 From 8ef971f9f93bcd8ee12e6bb8f70bfc8492bcc1b8 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Mon, 11 Oct 2021 11:22:42 +0800 Subject: [PATCH 023/129] Update README.md --- study-summary/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/study-summary/README.md b/study-summary/README.md index 5ebf9c296..8384a0cd1 100644 --- a/study-summary/README.md +++ b/study-summary/README.md @@ -2,6 +2,7 @@ PPT 讲解 STAR 法则,背景、遇到问题、采取的方案、取得的效果 +UT 编写用例 ## 常用连接 From a3c534b4d7b214d5a5ed0e760f562dd1ad6084b6 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Mon, 11 Oct 2021 16:11:11 +0800 Subject: [PATCH 024/129] ui kits --- study-flutter/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/study-flutter/README.md b/study-flutter/README.md index 5f8b1d459..ff971c85b 100644 --- a/study-flutter/README.md +++ b/study-flutter/README.md @@ -84,6 +84,8 @@ https://github.com/mitesh77/Best-Flutter-UI-Templates https://github.com/iampawan/Flutter-UI-Kit +https://github.com/olayemii/flutter-ui-kits + https://github.com/flutter/gallery/tree/master/lib From 86b89cc928f52b31d82adf009b0bad0789a649d0 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Tue, 19 Oct 2021 20:02:41 +0800 Subject: [PATCH 025/129] Update README.md --- study-flutter/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/study-flutter/README.md b/study-flutter/README.md index 2c6a0c7b0..d59c3aeec 100644 --- a/study-flutter/README.md +++ b/study-flutter/README.md @@ -34,6 +34,14 @@ https://fluttergems.dev/ 大厂内推APP +https://github.com/lohanidamodar/flutter_ui_challenges + + + +https://github.com/FlutterOpen/flutter-ui-nice + + + 小组活动:每周体验一款app,产品包括最近热门,评价高,国外好的产品。建议从产品、市场两方面发表看法,也可以自由交流~ From b09896b528ec7cb427edc1e780d37694d8876e64 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Thu, 21 Oct 2021 19:22:55 +0800 Subject: [PATCH 026/129] jdk version --- bage-spring-boot-starter-ping-test/pom.xml | 2 ++ bage-spring-boot-starter-ping/pom.xml | 2 ++ study-activemq/pom.xml | 2 ++ study-algorithm/pom.xml | 2 ++ study-arthas/pom.xml | 4 ++-- study-axon/pom.xml | 2 ++ study-baidu-asr/pom.xml | 4 ++-- study-cache-memory-springboot/pom.xml | 2 ++ study-cas-client/pom.xml | 3 ++- study-cas-server/pom.xml | 8 ++++++++ study-cglib/pom.xml | 2 ++ study-code-format/pom.xml | 2 ++ study-cryption/pom.xml | 2 ++ study-cxf/pom.xml | 2 ++ study-dbschema-to-json/pom.xml | 2 ++ study-docker/pom.xml | 2 ++ study-domain-generator/pom.xml | 4 ++-- study-downtime/pom.xml | 4 ++-- study-dubbo/pom.xml | 2 ++ study-easyexcel/pom.xml | 4 ++-- study-ehcache/pom.xml | 8 ++++++++ study-es/pom.xml | 4 ++-- study-ews-java-api/pom.xml | 4 ++-- study-gateway-test/pom.xml | 2 ++ study-gateway/pom.xml | 2 ++ study-guava/pom.xml | 2 ++ study-hanlp/pom.xml | 4 ++-- study-hashids-java/pom.xml | 4 ++-- study-html2pdf/pom.xml | 4 ++-- study-hystrix/pom.xml | 4 ++-- study-id-generator/pom.xml | 4 ++-- study-itext/pom.xml | 4 ++-- study-java-agent-instrument/pom.xml | 2 +- .../study-java-agent-attach/pom.xml | 8 ++++++-- .../study-java-agent-demo-service/pom.xml | 6 +++--- .../study-java-agent-hotload-service/pom.xml | 8 ++++++-- .../study-java-agent-transform-service/pom.xml | 6 +++--- 37 files changed, 95 insertions(+), 38 deletions(-) diff --git a/bage-spring-boot-starter-ping-test/pom.xml b/bage-spring-boot-starter-ping-test/pom.xml index 3304759e8..d81193dee 100644 --- a/bage-spring-boot-starter-ping-test/pom.xml +++ b/bage-spring-boot-starter-ping-test/pom.xml @@ -15,6 +15,8 @@ http://www.example.com + 1.8 + 1.8 UTF-8 2.0.1.RELEASE diff --git a/bage-spring-boot-starter-ping/pom.xml b/bage-spring-boot-starter-ping/pom.xml index 231aa7e42..8dff3a981 100644 --- a/bage-spring-boot-starter-ping/pom.xml +++ b/bage-spring-boot-starter-ping/pom.xml @@ -15,6 +15,8 @@ http://www.example.com + 1.8 + 1.8 UTF-8 2.0.1.RELEASE diff --git a/study-activemq/pom.xml b/study-activemq/pom.xml index b9c5f4a01..c2ff35e66 100644 --- a/study-activemq/pom.xml +++ b/study-activemq/pom.xml @@ -12,6 +12,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 diff --git a/study-algorithm/pom.xml b/study-algorithm/pom.xml index 727d0b784..3ec41d244 100644 --- a/study-algorithm/pom.xml +++ b/study-algorithm/pom.xml @@ -12,6 +12,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 diff --git a/study-arthas/pom.xml b/study-arthas/pom.xml index 4be57d3d8..e57436c2c 100644 --- a/study-arthas/pom.xml +++ b/study-arthas/pom.xml @@ -16,8 +16,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-axon/pom.xml b/study-axon/pom.xml index 9e9fb12ab..bcbb33626 100644 --- a/study-axon/pom.xml +++ b/study-axon/pom.xml @@ -30,6 +30,8 @@ UTF-8 2.0.1.RELEASE + 1.8 + 1.8 diff --git a/study-baidu-asr/pom.xml b/study-baidu-asr/pom.xml index 91eec1b40..68d366c2e 100644 --- a/study-baidu-asr/pom.xml +++ b/study-baidu-asr/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-cache-memory-springboot/pom.xml b/study-cache-memory-springboot/pom.xml index 8797be462..0bcf07fae 100644 --- a/study-cache-memory-springboot/pom.xml +++ b/study-cache-memory-springboot/pom.xml @@ -13,6 +13,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 2.0.1.RELEASE diff --git a/study-cas-client/pom.xml b/study-cas-client/pom.xml index 8cea223aa..767d2604b 100644 --- a/study-cas-client/pom.xml +++ b/study-cas-client/pom.xml @@ -14,7 +14,8 @@ 3.5.0 - + 1.8 + 1.8 UTF-8 4.3.9.RELEASE UTF-8 diff --git a/study-cas-server/pom.xml b/study-cas-server/pom.xml index 78baad5a2..010a91936 100644 --- a/study-cas-server/pom.xml +++ b/study-cas-server/pom.xml @@ -16,4 +16,12 @@ study-cas-server + + + UTF-8 + 1.8 + 1.8 + + + diff --git a/study-cglib/pom.xml b/study-cglib/pom.xml index cd0a8c220..245d62f24 100644 --- a/study-cglib/pom.xml +++ b/study-cglib/pom.xml @@ -12,6 +12,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 diff --git a/study-code-format/pom.xml b/study-code-format/pom.xml index 4a418a669..a459d0a1a 100644 --- a/study-code-format/pom.xml +++ b/study-code-format/pom.xml @@ -12,6 +12,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 diff --git a/study-cryption/pom.xml b/study-cryption/pom.xml index 1e5a3d6b4..68017bc2c 100644 --- a/study-cryption/pom.xml +++ b/study-cryption/pom.xml @@ -12,6 +12,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 diff --git a/study-cxf/pom.xml b/study-cxf/pom.xml index 6f6684dcf..179a882bf 100644 --- a/study-cxf/pom.xml +++ b/study-cxf/pom.xml @@ -19,6 +19,8 @@ 3.1.9 1.9.13 4.1.9.RELEASE + 1.8 + 1.8 diff --git a/study-dbschema-to-json/pom.xml b/study-dbschema-to-json/pom.xml index b4c56e0d5..2b8432bf4 100644 --- a/study-dbschema-to-json/pom.xml +++ b/study-dbschema-to-json/pom.xml @@ -20,6 +20,8 @@ UTF-8 2.0.1.RELEASE springio + 1.8 + 1.8 diff --git a/study-docker/pom.xml b/study-docker/pom.xml index 5da7b633f..80de25688 100644 --- a/study-docker/pom.xml +++ b/study-docker/pom.xml @@ -12,6 +12,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 diff --git a/study-domain-generator/pom.xml b/study-domain-generator/pom.xml index c8ddc6f4b..be75927c2 100644 --- a/study-domain-generator/pom.xml +++ b/study-domain-generator/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-downtime/pom.xml b/study-downtime/pom.xml index 767c63199..efed404c9 100644 --- a/study-downtime/pom.xml +++ b/study-downtime/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-dubbo/pom.xml b/study-dubbo/pom.xml index dc3c034fd..6859b1f0e 100644 --- a/study-dubbo/pom.xml +++ b/study-dubbo/pom.xml @@ -12,6 +12,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 diff --git a/study-easyexcel/pom.xml b/study-easyexcel/pom.xml index 8ce90bfcb..6ac3584f3 100644 --- a/study-easyexcel/pom.xml +++ b/study-easyexcel/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-ehcache/pom.xml b/study-ehcache/pom.xml index 07fdaac42..c3496a5e9 100644 --- a/study-ehcache/pom.xml +++ b/study-ehcache/pom.xml @@ -12,6 +12,14 @@ war study-ehcache Maven Webapp http://maven.apache.org + + + + UTF-8 + 1.8 + 1.8 + + junit diff --git a/study-es/pom.xml b/study-es/pom.xml index 27263ec1f..7598cf0ea 100644 --- a/study-es/pom.xml +++ b/study-es/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-ews-java-api/pom.xml b/study-ews-java-api/pom.xml index 581a4e24c..d95793383 100644 --- a/study-ews-java-api/pom.xml +++ b/study-ews-java-api/pom.xml @@ -13,8 +13,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-gateway-test/pom.xml b/study-gateway-test/pom.xml index e1ac27ffb..75bb9c8b0 100644 --- a/study-gateway-test/pom.xml +++ b/study-gateway-test/pom.xml @@ -13,6 +13,8 @@ UTF-8 2.0.1.RELEASE + 1.8 + 1.8 diff --git a/study-gateway/pom.xml b/study-gateway/pom.xml index 4936e209d..3fce83b51 100644 --- a/study-gateway/pom.xml +++ b/study-gateway/pom.xml @@ -14,6 +14,8 @@ UTF-8 2.0.1.RELEASE + 1.8 + 1.8 diff --git a/study-guava/pom.xml b/study-guava/pom.xml index add009e3c..9ca554658 100644 --- a/study-guava/pom.xml +++ b/study-guava/pom.xml @@ -14,6 +14,8 @@ UTF-8 2.0.1.RELEASE + 1.8 + 1.8 diff --git a/study-hanlp/pom.xml b/study-hanlp/pom.xml index aa2400b9d..22ac121ae 100644 --- a/study-hanlp/pom.xml +++ b/study-hanlp/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-hashids-java/pom.xml b/study-hashids-java/pom.xml index 29ac2d90d..f76fd981b 100644 --- a/study-hashids-java/pom.xml +++ b/study-hashids-java/pom.xml @@ -16,8 +16,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-html2pdf/pom.xml b/study-html2pdf/pom.xml index 8c16a0ecf..0d41e8366 100644 --- a/study-html2pdf/pom.xml +++ b/study-html2pdf/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-hystrix/pom.xml b/study-hystrix/pom.xml index 7d6357157..f9aed99b7 100644 --- a/study-hystrix/pom.xml +++ b/study-hystrix/pom.xml @@ -13,8 +13,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-id-generator/pom.xml b/study-id-generator/pom.xml index 5aed39b6e..96c8e6d36 100644 --- a/study-id-generator/pom.xml +++ b/study-id-generator/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-itext/pom.xml b/study-itext/pom.xml index cfa8a1077..6c771d85f 100644 --- a/study-itext/pom.xml +++ b/study-itext/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-java-agent-instrument/pom.xml b/study-java-agent-instrument/pom.xml index 13ee23c79..becd6db0e 100644 --- a/study-java-agent-instrument/pom.xml +++ b/study-java-agent-instrument/pom.xml @@ -13,7 +13,7 @@ http://maven.apache.org pom - 1.0-SNAPSHOT + 0.0.1-SNAPSHOT study-java-agent-demo-service study-java-agent-transform-service diff --git a/study-java-agent-instrument/study-java-agent-attach/pom.xml b/study-java-agent-instrument/study-java-agent-attach/pom.xml index fab61b7e3..a79187f51 100644 --- a/study-java-agent-instrument/study-java-agent-attach/pom.xml +++ b/study-java-agent-instrument/study-java-agent-attach/pom.xml @@ -3,10 +3,14 @@ 4.0.0 + + study-java-agent-instrument + com.bage + 0.0.1-SNAPSHOT + - org.example + com.bage study-java-agent-attach - 1.0-SNAPSHOT study-java-agent-attach http://www.example.com diff --git a/study-java-agent-instrument/study-java-agent-demo-service/pom.xml b/study-java-agent-instrument/study-java-agent-demo-service/pom.xml index bccf6410c..e3fd118c1 100644 --- a/study-java-agent-instrument/study-java-agent-demo-service/pom.xml +++ b/study-java-agent-instrument/study-java-agent-demo-service/pom.xml @@ -3,9 +3,9 @@ - study-java-agent - org.example - 1.0-SNAPSHOT + study-java-agent-instrument + com.bage + 0.0.1-SNAPSHOT 4.0.0 diff --git a/study-java-agent-instrument/study-java-agent-hotload-service/pom.xml b/study-java-agent-instrument/study-java-agent-hotload-service/pom.xml index b64d089b4..9ef9955d1 100644 --- a/study-java-agent-instrument/study-java-agent-hotload-service/pom.xml +++ b/study-java-agent-instrument/study-java-agent-hotload-service/pom.xml @@ -3,10 +3,14 @@ 4.0.0 + + study-java-agent-instrument + com.bage + 0.0.1-SNAPSHOT + - org.example + com.bage study-java-agent-hotload-service - 1.0-SNAPSHOT study-java-agent-hotload-service http://www.example.com diff --git a/study-java-agent-instrument/study-java-agent-transform-service/pom.xml b/study-java-agent-instrument/study-java-agent-transform-service/pom.xml index c3e150187..f9c1aa092 100644 --- a/study-java-agent-instrument/study-java-agent-transform-service/pom.xml +++ b/study-java-agent-instrument/study-java-agent-transform-service/pom.xml @@ -3,9 +3,9 @@ - study-java-agent - org.example - 1.0-SNAPSHOT + study-java-agent-instrument + com.bage + 0.0.1-SNAPSHOT 4.0.0 From dc8ca69d7d40d2fc2e767bae22b4359a1c4f9a65 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Thu, 21 Oct 2021 19:37:05 +0800 Subject: [PATCH 027/129] jdk version --- bage-spring-boot-starter-ping-test/pom.xml | 2 +- bage-spring-boot-starter-ping/README.md | 2 ++ bage-spring-boot-starter-ping/pom.xml | 2 +- pom.xml | 2 ++ study-activemq/pom.xml | 2 +- study-algorithm/pom.xml | 2 +- study-arthas/pom.xml | 2 +- study-axon/pom.xml | 2 +- study-baidu-asr/pom.xml | 2 +- study-cache-memory-spring/pom.xml | 2 +- study-java-agent-instrument/study-java-agent-attach/pom.xml | 4 ++-- .../study-java-agent-demo-service/pom.xml | 4 ++-- .../study-java-agent-hotload-service/pom.xml | 4 ++-- .../study-java-agent-transform-service/pom.xml | 4 ++-- study-java-shell/pom.xml | 2 ++ study-jmeter/pom.xml | 2 ++ study-jmockit/pom.xml | 2 ++ study-jpush/pom.xml | 2 ++ study-json-to-pojo/pom.xml | 2 ++ study-json/pom.xml | 2 ++ study-jvm/pom.xml | 2 ++ study-jwt/pom.xml | 2 ++ study-leancloud/pom.xml | 2 ++ study-log-logback/pom.xml | 2 ++ study-log4j2/pom.xml | 2 ++ study-lombok/pom.xml | 2 ++ study-m3u/pom.xml | 2 ++ study-mapping-generator/pom.xml | 2 ++ study-materialize-spring-boot/pom.xml | 2 ++ study-mockito/pom.xml | 2 ++ study-mongodb/pom.xml | 2 ++ study-mybatis-generator-maven-plugin/pom.xml | 2 ++ study-mybatis/pom.xml | 4 ++-- study-obj-mapper/pom.xml | 4 ++-- study-regex/pom.xml | 4 ++-- study-security/pom.xml | 2 ++ study-sftp/pom.xml | 4 ++-- study-shiro-spring-boot/pom.xml | 4 ++-- study-shiro-tutorial/pom.xml | 2 ++ study-shiro-web-tutorial/pom.xml | 2 ++ study-shiro-web/pom.xml | 2 ++ study-socket/pom.xml | 2 ++ study-spring-boot-actuator/pom.xml | 2 ++ study-spring-boot-building/pom.xml | 2 ++ study-spring-boot-dependencies/pom.xml | 2 ++ study-spring-boot-docker/pom.xml | 2 ++ study-spring-boot-dynamic-datasource/pom.xml | 2 ++ study-spring-boot-env/pom.xml | 2 ++ study-spring-boot-jpa/pom.xml | 2 ++ study-spring-boot-metrics/pom.xml | 2 ++ study-spring-boot-multi-datasource/pom.xml | 2 ++ study-spring-boot-oauth2-auth-server/pom.xml | 2 +- study-spring-boot-websocket/pom.xml | 4 ++-- study-spring-boot-zipkin/pom.xml | 2 ++ study-spring-boot/pom.xml | 2 ++ study-spring-dependencies/pom.xml | 2 ++ study-spring-email/pom.xml | 2 ++ study-spring-session/pom.xml | 2 ++ study-spring/pom.xml | 2 ++ study-springmvc-java/pom.xml | 2 ++ study-sql/pom.xml | 2 ++ study-sso-baeldung-auth-server/pom.xml | 2 ++ study-sso-baeldung-client1/pom.xml | 2 ++ study-summary/pom.xml | 4 ++-- study-tencent-share/pom.xml | 4 ++-- study-test-restdoc/pom.xml | 2 ++ study-test/pom.xml | 2 ++ study-utils/pom.xml | 2 ++ study-vue-npm/pom.xml | 4 ++-- study-vue/pom.xml | 4 ++-- study-websocket/pom.xml | 2 ++ study-xfyun-lfasr/pom.xml | 2 ++ study-zipkin/pom.xml | 2 ++ 73 files changed, 137 insertions(+), 37 deletions(-) diff --git a/bage-spring-boot-starter-ping-test/pom.xml b/bage-spring-boot-starter-ping-test/pom.xml index d81193dee..cbcef443e 100644 --- a/bage-spring-boot-starter-ping-test/pom.xml +++ b/bage-spring-boot-starter-ping-test/pom.xml @@ -17,7 +17,7 @@ 1.8 1.8 - UTF-8 + 2.0.1.RELEASE diff --git a/bage-spring-boot-starter-ping/README.md b/bage-spring-boot-starter-ping/README.md index 0f06dc689..e92d4f7ac 100644 --- a/bage-spring-boot-starter-ping/README.md +++ b/bage-spring-boot-starter-ping/README.md @@ -7,6 +7,8 @@ ``` UTF-8 + 1.8 + 1.8 2.0.1.RELEASE diff --git a/bage-spring-boot-starter-ping/pom.xml b/bage-spring-boot-starter-ping/pom.xml index 8dff3a981..45e6d816e 100644 --- a/bage-spring-boot-starter-ping/pom.xml +++ b/bage-spring-boot-starter-ping/pom.xml @@ -17,7 +17,7 @@ 1.8 1.8 - UTF-8 + 2.0.1.RELEASE diff --git a/pom.xml b/pom.xml index f4978018f..15f5c85fb 100644 --- a/pom.xml +++ b/pom.xml @@ -16,6 +16,8 @@ UTF-8 + 1.8 + 1.8 study-spring-boot diff --git a/study-activemq/pom.xml b/study-activemq/pom.xml index c2ff35e66..56365c9bc 100644 --- a/study-activemq/pom.xml +++ b/study-activemq/pom.xml @@ -11,7 +11,7 @@ study-activemq http://maven.apache.org - UTF-8 + 1.8 1.8 diff --git a/study-algorithm/pom.xml b/study-algorithm/pom.xml index 3ec41d244..5e77e61e9 100644 --- a/study-algorithm/pom.xml +++ b/study-algorithm/pom.xml @@ -11,7 +11,7 @@ study-algorithm http://maven.apache.org - UTF-8 + 1.8 1.8 diff --git a/study-arthas/pom.xml b/study-arthas/pom.xml index e57436c2c..9dd285a0d 100644 --- a/study-arthas/pom.xml +++ b/study-arthas/pom.xml @@ -15,7 +15,7 @@ http://www.example.com - UTF-8 + 1.8 1.8 diff --git a/study-axon/pom.xml b/study-axon/pom.xml index bcbb33626..d515be186 100644 --- a/study-axon/pom.xml +++ b/study-axon/pom.xml @@ -28,7 +28,7 @@ - UTF-8 + 2.0.1.RELEASE 1.8 1.8 diff --git a/study-baidu-asr/pom.xml b/study-baidu-asr/pom.xml index 68d366c2e..8148c0532 100644 --- a/study-baidu-asr/pom.xml +++ b/study-baidu-asr/pom.xml @@ -16,7 +16,7 @@ http://www.example.com - UTF-8 + 1.8 1.8 diff --git a/study-cache-memory-spring/pom.xml b/study-cache-memory-spring/pom.xml index 4c4ff630f..d2a5d1a1f 100644 --- a/study-cache-memory-spring/pom.xml +++ b/study-cache-memory-spring/pom.xml @@ -17,7 +17,7 @@ 1.8 1.8 - UTF-8 + 4.1.9.RELEASE UTF-8 3.0-alpha-1 diff --git a/study-java-agent-instrument/study-java-agent-attach/pom.xml b/study-java-agent-instrument/study-java-agent-attach/pom.xml index a79187f51..07fad242f 100644 --- a/study-java-agent-instrument/study-java-agent-attach/pom.xml +++ b/study-java-agent-instrument/study-java-agent-attach/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-java-agent-instrument/study-java-agent-demo-service/pom.xml b/study-java-agent-instrument/study-java-agent-demo-service/pom.xml index e3fd118c1..1dcde2831 100644 --- a/study-java-agent-instrument/study-java-agent-demo-service/pom.xml +++ b/study-java-agent-instrument/study-java-agent-demo-service/pom.xml @@ -16,8 +16,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-java-agent-instrument/study-java-agent-hotload-service/pom.xml b/study-java-agent-instrument/study-java-agent-hotload-service/pom.xml index 9ef9955d1..934b50c43 100644 --- a/study-java-agent-instrument/study-java-agent-hotload-service/pom.xml +++ b/study-java-agent-instrument/study-java-agent-hotload-service/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-java-agent-instrument/study-java-agent-transform-service/pom.xml b/study-java-agent-instrument/study-java-agent-transform-service/pom.xml index f9c1aa092..95d66559e 100644 --- a/study-java-agent-instrument/study-java-agent-transform-service/pom.xml +++ b/study-java-agent-instrument/study-java-agent-transform-service/pom.xml @@ -16,8 +16,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-java-shell/pom.xml b/study-java-shell/pom.xml index 60ef765cd..16317767c 100644 --- a/study-java-shell/pom.xml +++ b/study-java-shell/pom.xml @@ -17,6 +17,8 @@ UTF-8 + 1.8 + 1.8 1.7 1.7 diff --git a/study-jmeter/pom.xml b/study-jmeter/pom.xml index f9c02bae1..22ab06782 100644 --- a/study-jmeter/pom.xml +++ b/study-jmeter/pom.xml @@ -17,6 +17,8 @@ UTF-8 + 1.8 + 1.8 1.7 1.7 diff --git a/study-jmockit/pom.xml b/study-jmockit/pom.xml index 66cf3872c..98747c135 100644 --- a/study-jmockit/pom.xml +++ b/study-jmockit/pom.xml @@ -16,6 +16,8 @@ UTF-8 + 1.8 + 1.8 1.7 1.7 diff --git a/study-jpush/pom.xml b/study-jpush/pom.xml index a51455cfa..50c37e854 100644 --- a/study-jpush/pom.xml +++ b/study-jpush/pom.xml @@ -14,6 +14,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 diff --git a/study-json-to-pojo/pom.xml b/study-json-to-pojo/pom.xml index 314ed6d9b..95b7a9610 100644 --- a/study-json-to-pojo/pom.xml +++ b/study-json-to-pojo/pom.xml @@ -17,6 +17,8 @@ UTF-8 + 1.8 + 1.8 1.7 1.7 diff --git a/study-json/pom.xml b/study-json/pom.xml index e2eb8cc6a..040b13cd3 100644 --- a/study-json/pom.xml +++ b/study-json/pom.xml @@ -29,6 +29,8 @@ UTF-8 + 1.8 + 1.8 1.7 1.7 diff --git a/study-jvm/pom.xml b/study-jvm/pom.xml index 32afc7868..fb0a1ab2b 100644 --- a/study-jvm/pom.xml +++ b/study-jvm/pom.xml @@ -32,6 +32,8 @@ UTF-8 + 1.8 + 1.8 1.7 1.7 diff --git a/study-jwt/pom.xml b/study-jwt/pom.xml index 7ab19f4c1..689e8fb04 100644 --- a/study-jwt/pom.xml +++ b/study-jwt/pom.xml @@ -14,6 +14,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE 3.4.6 1.3.2 diff --git a/study-leancloud/pom.xml b/study-leancloud/pom.xml index fccc0246b..fb9c46053 100644 --- a/study-leancloud/pom.xml +++ b/study-leancloud/pom.xml @@ -17,6 +17,8 @@ UTF-8 + 1.8 + 1.8 1.7 1.7 diff --git a/study-log-logback/pom.xml b/study-log-logback/pom.xml index a62848b14..123d06a09 100644 --- a/study-log-logback/pom.xml +++ b/study-log-logback/pom.xml @@ -12,6 +12,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 1.0.13 diff --git a/study-log4j2/pom.xml b/study-log4j2/pom.xml index 79a121078..06978a3e0 100644 --- a/study-log4j2/pom.xml +++ b/study-log4j2/pom.xml @@ -12,6 +12,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 1.8 1.8 diff --git a/study-lombok/pom.xml b/study-lombok/pom.xml index 9891c8d2e..0e9a65bce 100644 --- a/study-lombok/pom.xml +++ b/study-lombok/pom.xml @@ -12,6 +12,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 diff --git a/study-m3u/pom.xml b/study-m3u/pom.xml index 090e62dea..c89d91956 100644 --- a/study-m3u/pom.xml +++ b/study-m3u/pom.xml @@ -25,6 +25,8 @@ UTF-8 + 1.8 + 1.8 1.7 1.7 diff --git a/study-mapping-generator/pom.xml b/study-mapping-generator/pom.xml index 9ed5d567a..a59e55a87 100644 --- a/study-mapping-generator/pom.xml +++ b/study-mapping-generator/pom.xml @@ -16,6 +16,8 @@ UTF-8 + 1.8 + 1.8 1.7 1.7 diff --git a/study-materialize-spring-boot/pom.xml b/study-materialize-spring-boot/pom.xml index a9ea33049..b2d6e4278 100644 --- a/study-materialize-spring-boot/pom.xml +++ b/study-materialize-spring-boot/pom.xml @@ -12,6 +12,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 2.0.1.RELEASE 3.4.6 1.3.2 diff --git a/study-mockito/pom.xml b/study-mockito/pom.xml index 6c367c9e6..8da4dfff4 100644 --- a/study-mockito/pom.xml +++ b/study-mockito/pom.xml @@ -14,6 +14,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE diff --git a/study-mongodb/pom.xml b/study-mongodb/pom.xml index c118b2443..9cc537db3 100644 --- a/study-mongodb/pom.xml +++ b/study-mongodb/pom.xml @@ -15,6 +15,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE diff --git a/study-mybatis-generator-maven-plugin/pom.xml b/study-mybatis-generator-maven-plugin/pom.xml index d520c4ee7..88770cd5c 100644 --- a/study-mybatis-generator-maven-plugin/pom.xml +++ b/study-mybatis-generator-maven-plugin/pom.xml @@ -17,6 +17,8 @@ UTF-8 + 1.8 + 1.8 1.7 1.7 diff --git a/study-mybatis/pom.xml b/study-mybatis/pom.xml index 5004e0322..52eccec1d 100644 --- a/study-mybatis/pom.xml +++ b/study-mybatis/pom.xml @@ -117,7 +117,7 @@ - + diff --git a/study-obj-mapper/pom.xml b/study-obj-mapper/pom.xml index 6afeb9cba..0848bb3b8 100644 --- a/study-obj-mapper/pom.xml +++ b/study-obj-mapper/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 1.3.0.Final diff --git a/study-regex/pom.xml b/study-regex/pom.xml index bcdeefccd..328468e33 100644 --- a/study-regex/pom.xml +++ b/study-regex/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-security/pom.xml b/study-security/pom.xml index ed86babb6..df5194a1f 100644 --- a/study-security/pom.xml +++ b/study-security/pom.xml @@ -14,6 +14,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 4.3.9.RELEASE UTF-8 3.1.0 diff --git a/study-sftp/pom.xml b/study-sftp/pom.xml index 905257fe8..98b214014 100644 --- a/study-sftp/pom.xml +++ b/study-sftp/pom.xml @@ -28,8 +28,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-shiro-spring-boot/pom.xml b/study-shiro-spring-boot/pom.xml index ba91c4892..b3da965da 100644 --- a/study-shiro-spring-boot/pom.xml +++ b/study-shiro-spring-boot/pom.xml @@ -16,8 +16,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 2.0.1.RELEASE 1.8 diff --git a/study-shiro-tutorial/pom.xml b/study-shiro-tutorial/pom.xml index 66cd5834a..51597502f 100644 --- a/study-shiro-tutorial/pom.xml +++ b/study-shiro-tutorial/pom.xml @@ -12,6 +12,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 diff --git a/study-shiro-web-tutorial/pom.xml b/study-shiro-web-tutorial/pom.xml index 79fdc34ab..829bff6cf 100644 --- a/study-shiro-web-tutorial/pom.xml +++ b/study-shiro-web-tutorial/pom.xml @@ -14,6 +14,8 @@ 1.3.2 UTF-8 + 1.8 + 1.8 4.3.9.RELEASE 3.1.0 2.3.4 diff --git a/study-shiro-web/pom.xml b/study-shiro-web/pom.xml index 266c6567d..8cce15c44 100644 --- a/study-shiro-web/pom.xml +++ b/study-shiro-web/pom.xml @@ -16,6 +16,8 @@ 1.3.2 UTF-8 + 1.8 + 1.8 4.3.9.RELEASE 3.1.0 2.3.4 diff --git a/study-socket/pom.xml b/study-socket/pom.xml index 98308e6dc..4de5fb7ef 100644 --- a/study-socket/pom.xml +++ b/study-socket/pom.xml @@ -14,6 +14,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 diff --git a/study-spring-boot-actuator/pom.xml b/study-spring-boot-actuator/pom.xml index 62f303cb6..d129bdd76 100644 --- a/study-spring-boot-actuator/pom.xml +++ b/study-spring-boot-actuator/pom.xml @@ -17,6 +17,8 @@ UTF-8 + 1.8 + 1.8 2.1.7.RELEASE springio diff --git a/study-spring-boot-building/pom.xml b/study-spring-boot-building/pom.xml index c4187ea8d..9b6274156 100644 --- a/study-spring-boot-building/pom.xml +++ b/study-spring-boot-building/pom.xml @@ -17,6 +17,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE 1.8 diff --git a/study-spring-boot-dependencies/pom.xml b/study-spring-boot-dependencies/pom.xml index c90827882..972c9d519 100644 --- a/study-spring-boot-dependencies/pom.xml +++ b/study-spring-boot-dependencies/pom.xml @@ -14,6 +14,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE diff --git a/study-spring-boot-docker/pom.xml b/study-spring-boot-docker/pom.xml index 79529c8bd..26632bd69 100644 --- a/study-spring-boot-docker/pom.xml +++ b/study-spring-boot-docker/pom.xml @@ -18,6 +18,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE springio diff --git a/study-spring-boot-dynamic-datasource/pom.xml b/study-spring-boot-dynamic-datasource/pom.xml index ebc31aa28..6c069dfdd 100644 --- a/study-spring-boot-dynamic-datasource/pom.xml +++ b/study-spring-boot-dynamic-datasource/pom.xml @@ -16,6 +16,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE 3.4.6 diff --git a/study-spring-boot-env/pom.xml b/study-spring-boot-env/pom.xml index b3361bf34..cdea27078 100644 --- a/study-spring-boot-env/pom.xml +++ b/study-spring-boot-env/pom.xml @@ -17,6 +17,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE diff --git a/study-spring-boot-jpa/pom.xml b/study-spring-boot-jpa/pom.xml index 5517cc8c3..385be6e5a 100644 --- a/study-spring-boot-jpa/pom.xml +++ b/study-spring-boot-jpa/pom.xml @@ -17,6 +17,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE diff --git a/study-spring-boot-metrics/pom.xml b/study-spring-boot-metrics/pom.xml index 8aaa3a1ce..cf59611c5 100644 --- a/study-spring-boot-metrics/pom.xml +++ b/study-spring-boot-metrics/pom.xml @@ -17,6 +17,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE diff --git a/study-spring-boot-multi-datasource/pom.xml b/study-spring-boot-multi-datasource/pom.xml index 355aaa4c8..0860bf90e 100644 --- a/study-spring-boot-multi-datasource/pom.xml +++ b/study-spring-boot-multi-datasource/pom.xml @@ -16,6 +16,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE 3.4.6 diff --git a/study-spring-boot-oauth2-auth-server/pom.xml b/study-spring-boot-oauth2-auth-server/pom.xml index 5b5a484cb..7084e0659 100644 --- a/study-spring-boot-oauth2-auth-server/pom.xml +++ b/study-spring-boot-oauth2-auth-server/pom.xml @@ -14,7 +14,7 @@ 1.8 1.8 - UTF-8 + 2.0.1.RELEASE diff --git a/study-spring-boot-websocket/pom.xml b/study-spring-boot-websocket/pom.xml index b77cc7004..85da5997f 100644 --- a/study-spring-boot-websocket/pom.xml +++ b/study-spring-boot-websocket/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-spring-boot-zipkin/pom.xml b/study-spring-boot-zipkin/pom.xml index 523d281ff..f657e1e6d 100644 --- a/study-spring-boot-zipkin/pom.xml +++ b/study-spring-boot-zipkin/pom.xml @@ -17,6 +17,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE diff --git a/study-spring-boot/pom.xml b/study-spring-boot/pom.xml index 0beb926a9..ab27c416a 100644 --- a/study-spring-boot/pom.xml +++ b/study-spring-boot/pom.xml @@ -15,6 +15,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE diff --git a/study-spring-dependencies/pom.xml b/study-spring-dependencies/pom.xml index 857cb5926..f9b49d424 100644 --- a/study-spring-dependencies/pom.xml +++ b/study-spring-dependencies/pom.xml @@ -13,6 +13,8 @@ UTF-8 + 1.8 + 1.8 4.3.9.RELEASE UTF-8 3.0-alpha-1 diff --git a/study-spring-email/pom.xml b/study-spring-email/pom.xml index 6d84230b0..ae0311544 100644 --- a/study-spring-email/pom.xml +++ b/study-spring-email/pom.xml @@ -16,6 +16,8 @@ http://www.example.com UTF-8 + 1.8 + 1.8 2.0.1.RELEASE diff --git a/study-spring-session/pom.xml b/study-spring-session/pom.xml index 53ff8f9ef..0b9e47c5b 100644 --- a/study-spring-session/pom.xml +++ b/study-spring-session/pom.xml @@ -15,6 +15,8 @@ UTF-8 + 1.8 + 1.8 5.0.9.RELEASE UTF-8 3.0-alpha-1 diff --git a/study-spring/pom.xml b/study-spring/pom.xml index b77ab24b7..077db7040 100644 --- a/study-spring/pom.xml +++ b/study-spring/pom.xml @@ -13,6 +13,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 4.3.9.RELEASE UTF-8 3.0-alpha-1 diff --git a/study-springmvc-java/pom.xml b/study-springmvc-java/pom.xml index 94a3af8e9..fd0d48e0c 100644 --- a/study-springmvc-java/pom.xml +++ b/study-springmvc-java/pom.xml @@ -14,6 +14,8 @@ UTF-8 + 1.8 + 1.8 4.3.9.RELEASE UTF-8 3.0-alpha-1 diff --git a/study-sql/pom.xml b/study-sql/pom.xml index 6a8654523..322f11bfe 100644 --- a/study-sql/pom.xml +++ b/study-sql/pom.xml @@ -24,6 +24,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 diff --git a/study-sso-baeldung-auth-server/pom.xml b/study-sso-baeldung-auth-server/pom.xml index a51c9e21c..01d0110a9 100644 --- a/study-sso-baeldung-auth-server/pom.xml +++ b/study-sso-baeldung-auth-server/pom.xml @@ -13,6 +13,8 @@ UTF-8 + 1.8 + 1.8 1.5.10.RELEASE diff --git a/study-sso-baeldung-client1/pom.xml b/study-sso-baeldung-client1/pom.xml index b03aece75..173d2f108 100644 --- a/study-sso-baeldung-client1/pom.xml +++ b/study-sso-baeldung-client1/pom.xml @@ -14,6 +14,8 @@ UTF-8 + 1.8 + 1.8 1.5.10.RELEASE diff --git a/study-summary/pom.xml b/study-summary/pom.xml index 1fd030073..68c0c1d52 100644 --- a/study-summary/pom.xml +++ b/study-summary/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-tencent-share/pom.xml b/study-tencent-share/pom.xml index bb611f51f..6aad43743 100644 --- a/study-tencent-share/pom.xml +++ b/study-tencent-share/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-test-restdoc/pom.xml b/study-test-restdoc/pom.xml index 3ef952e51..68edfe7ca 100644 --- a/study-test-restdoc/pom.xml +++ b/study-test-restdoc/pom.xml @@ -17,6 +17,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE diff --git a/study-test/pom.xml b/study-test/pom.xml index ba0f604dd..8539d9a1c 100644 --- a/study-test/pom.xml +++ b/study-test/pom.xml @@ -12,6 +12,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 diff --git a/study-utils/pom.xml b/study-utils/pom.xml index 8463cec56..087bc8a7b 100644 --- a/study-utils/pom.xml +++ b/study-utils/pom.xml @@ -12,6 +12,8 @@ http://maven.apache.org UTF-8 + 1.8 + 1.8 diff --git a/study-vue-npm/pom.xml b/study-vue-npm/pom.xml index 5792e1b86..770071e1f 100644 --- a/study-vue-npm/pom.xml +++ b/study-vue-npm/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-vue/pom.xml b/study-vue/pom.xml index 805e5e186..0c50307df 100644 --- a/study-vue/pom.xml +++ b/study-vue/pom.xml @@ -17,8 +17,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 diff --git a/study-websocket/pom.xml b/study-websocket/pom.xml index a7a577479..913c3cd24 100644 --- a/study-websocket/pom.xml +++ b/study-websocket/pom.xml @@ -18,6 +18,8 @@ UTF-8 + 1.8 + 1.8 2.0.1.RELEASE diff --git a/study-xfyun-lfasr/pom.xml b/study-xfyun-lfasr/pom.xml index 238af84c6..d315dfd3b 100644 --- a/study-xfyun-lfasr/pom.xml +++ b/study-xfyun-lfasr/pom.xml @@ -17,6 +17,8 @@ UTF-8 + 1.8 + 1.8 1.7 1.7 diff --git a/study-zipkin/pom.xml b/study-zipkin/pom.xml index 66da46201..479a20158 100644 --- a/study-zipkin/pom.xml +++ b/study-zipkin/pom.xml @@ -17,6 +17,8 @@ UTF-8 + 1.8 + 1.8 1.7 1.7 From 76f289d1973c8663185586f3642442a704ed0a24 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Wed, 27 Oct 2021 12:42:14 +0800 Subject: [PATCH 028/129] test fix --- study-dubbo/pom.xml | 2 +- study-lombok/pom.xml | 4 +- study-m3u/pom.xml | 2 +- .../src/main/java/cn/home/maventool/Main.java | 29 +- study-mybatis/pom.xml | 2 +- study-quartz/pom.xml | 1 + study-split-db-tb/pom.xml | 2 +- study-xfyun-lfasr/pom.xml | 2 - .../bage/study/xfyun/lfasr/JsonParser.java | 44 +-- .../bage/study/xfyun/lfasr/LfasrSDKDemo.java | 266 +++++++++--------- study-xxl-job/pom.xml | 2 +- 11 files changed, 177 insertions(+), 179 deletions(-) diff --git a/study-dubbo/pom.xml b/study-dubbo/pom.xml index 6859b1f0e..1a9fae841 100644 --- a/study-dubbo/pom.xml +++ b/study-dubbo/pom.xml @@ -32,7 +32,7 @@ org.apache.zookeeper zookeeper - 3.3.3 + 3.4.13 diff --git a/study-lombok/pom.xml b/study-lombok/pom.xml index 0e9a65bce..0c674f735 100644 --- a/study-lombok/pom.xml +++ b/study-lombok/pom.xml @@ -26,8 +26,8 @@ org.projectlombok lombok - 1.16.18 - provided + 1.18.20 + provided diff --git a/study-m3u/pom.xml b/study-m3u/pom.xml index c89d91956..da4ef06de 100644 --- a/study-m3u/pom.xml +++ b/study-m3u/pom.xml @@ -69,7 +69,7 @@ org.projectlombok lombok - 1.16.10 + 1.18.20 diff --git a/study-maven/src/main/java/cn/home/maventool/Main.java b/study-maven/src/main/java/cn/home/maventool/Main.java index e8e2e7946..67507bcf4 100644 --- a/study-maven/src/main/java/cn/home/maventool/Main.java +++ b/study-maven/src/main/java/cn/home/maventool/Main.java @@ -11,7 +11,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import sun.misc.JarFilter; /** * @author lihzh-home @@ -38,20 +37,20 @@ public static void main(String[] args) { _log.warn("The path must be a directory."); return; } - FilenameFilter filter = new JarFilter(); - File[] jarFiles = file.listFiles(filter); - for(File jar: jarFiles){ - installJarToMaven(jar); - if(isDelete){ - _log.info("Delete the original jar file ["+jar.getName()+"]."); - jar.delete(); - }else{ - if(isMove){ - String backupPath = propHelper.getValue(KEY_BACKUPPATH); - backupJar(jar,file,backupPath); - } - } - } +// FilenameFilter filter = new JarFilter(); +// File[] jarFiles = file.listFiles(filter); +// for(File jar: jarFiles){ +// installJarToMaven(jar); +// if(isDelete){ +// _log.info("Delete the original jar file ["+jar.getName()+"]."); +// jar.delete(); +// }else{ +// if(isMove){ +// String backupPath = propHelper.getValue(KEY_BACKUPPATH); +// backupJar(jar,file,backupPath); +// } +// } +// } } private static void backupJar(File jar, File file, String backupPath) { diff --git a/study-mybatis/pom.xml b/study-mybatis/pom.xml index 52eccec1d..c4b247daf 100644 --- a/study-mybatis/pom.xml +++ b/study-mybatis/pom.xml @@ -99,7 +99,7 @@ org.projectlombok lombok - 1.16.18 + 1.18.20 provided diff --git a/study-quartz/pom.xml b/study-quartz/pom.xml index 43b0ce59f..5e9d65afd 100644 --- a/study-quartz/pom.xml +++ b/study-quartz/pom.xml @@ -71,6 +71,7 @@ org.projectlombok lombok + 1.18.20 true diff --git a/study-split-db-tb/pom.xml b/study-split-db-tb/pom.xml index 733faf509..bd31aa5de 100644 --- a/study-split-db-tb/pom.xml +++ b/study-split-db-tb/pom.xml @@ -156,7 +156,7 @@ org.projectlombok lombok - 1.16.18 + 1.18.20 provided diff --git a/study-xfyun-lfasr/pom.xml b/study-xfyun-lfasr/pom.xml index d315dfd3b..29d775872 100644 --- a/study-xfyun-lfasr/pom.xml +++ b/study-xfyun-lfasr/pom.xml @@ -19,8 +19,6 @@ UTF-8 1.8 1.8 - 1.7 - 1.7 diff --git a/study-xfyun-lfasr/src/main/java/com/bage/study/xfyun/lfasr/JsonParser.java b/study-xfyun-lfasr/src/main/java/com/bage/study/xfyun/lfasr/JsonParser.java index 40c826aa0..2f568914b 100644 --- a/study-xfyun-lfasr/src/main/java/com/bage/study/xfyun/lfasr/JsonParser.java +++ b/study-xfyun-lfasr/src/main/java/com/bage/study/xfyun/lfasr/JsonParser.java @@ -1,22 +1,22 @@ -package com.bage.study.xfyun.lfasr; - -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; - -public class JsonParser { - - public static String parseMessage(String data) { - JSONArray jsonArray = JSON.parseArray(data); - StringBuilder sb = new StringBuilder(); - JSONObject item = null; - for (int i = 0; i < jsonArray.size(); i++) { - item = jsonArray.getJSONObject(i); - if(item != null) { - sb.append(item.getString("onebest")); - } - } - return sb.toString(); - } - -} +//package com.bage.study.xfyun.lfasr; +// +//import com.alibaba.fastjson.JSON; +//import com.alibaba.fastjson.JSONArray; +//import com.alibaba.fastjson.JSONObject; +// +//public class JsonParser { +// +// public static String parseMessage(String data) { +// JSONArray jsonArray = JSON.parseArray(data); +// StringBuilder sb = new StringBuilder(); +// JSONObject item = null; +// for (int i = 0; i < jsonArray.size(); i++) { +// item = jsonArray.getJSONObject(i); +// if(item != null) { +// sb.append(item.getString("onebest")); +// } +// } +// return sb.toString(); +// } +// +//} diff --git a/study-xfyun-lfasr/src/main/java/com/bage/study/xfyun/lfasr/LfasrSDKDemo.java b/study-xfyun-lfasr/src/main/java/com/bage/study/xfyun/lfasr/LfasrSDKDemo.java index ad5db7779..96be95f91 100644 --- a/study-xfyun-lfasr/src/main/java/com/bage/study/xfyun/lfasr/LfasrSDKDemo.java +++ b/study-xfyun-lfasr/src/main/java/com/bage/study/xfyun/lfasr/LfasrSDKDemo.java @@ -1,133 +1,133 @@ -package com.bage.study.xfyun.lfasr; - -import com.alibaba.fastjson.JSON; -import com.iflytek.msp.cpdb.lfasr.client.LfasrClientImp; -import com.iflytek.msp.cpdb.lfasr.exception.LfasrException; -import com.iflytek.msp.cpdb.lfasr.model.LfasrType; -import com.iflytek.msp.cpdb.lfasr.model.Message; -import com.iflytek.msp.cpdb.lfasr.model.ProgressStatus; - -import java.io.File; -import java.util.HashMap; - -/** - * 非实时转写SDK调用demo - * 此demo只是一个简单的调用示例, 不适合用到实际生产环境中 - * - * @author white - * - */ -public class LfasrSDKDemo { - - // 原始音频存放地址 - private static final String local_file = "E:\\workspace\\IdeaProjects\\study\\study\\study-xfyun-lfasr\\target\\classes\\audio\\lfasr.wav"; - - /* - * 转写类型选择:标准版和电话版(旧版本, 不建议使用)分别为: - * LfasrType.LFASR_STANDARD_RECORDED_AUDIO 和 LfasrType.LFASR_TELEPHONY_RECORDED_AUDIO - * */ - private static final LfasrType type = LfasrType.LFASR_STANDARD_RECORDED_AUDIO; - - // 等待时长(毫秒) - private static int sleepMillis = 500; - - public static void main(String[] args) { - // 初始化LFASRClient实例 - LfasrClientImp lc = null; - try { - lc = LfasrClientImp.initLfasrClient(); - } catch (LfasrException e) { - // 初始化异常,解析异常描述信息 - Message initMsg = JSON.parseObject(e.getMessage(), Message.class); - System.out.println("ecode=" + initMsg.getErr_no()); - System.out.println("failed=" + initMsg.getFailed()); - } - - // 获取上传任务ID - String task_id = ""; - HashMap params = new HashMap(); - params.put("has_participle", "true"); - //合并后标准版开启电话版功能 - //params.put("has_seperate", "true"); - try { - // 上传音频文件 - Message uploadMsg = lc.lfasrUpload(local_file, type, params); - - // 判断返回值 - int ok = uploadMsg.getOk(); - if (ok == 0) { - // 创建任务成功 - task_id = uploadMsg.getData(); - System.out.println("task_id=" + task_id); - } else { - // 创建任务失败-服务端异常 - System.out.println("ecode=" + uploadMsg.getErr_no()); - System.out.println("failed=" + uploadMsg.getFailed()); - } - } catch (LfasrException e) { - // 上传异常,解析异常描述信息 - Message uploadMsg = JSON.parseObject(e.getMessage(), Message.class); - System.out.println("ecode=" + uploadMsg.getErr_no()); - System.out.println("failed=" + uploadMsg.getFailed()); - } - - // 循环等待音频处理结果 - while (true) { - try { - // 等待sleepMillis在获取任务进度 - Thread.sleep(sleepMillis); - System.out.println("waiting ..."); - } catch (InterruptedException e) { - e.printStackTrace(); - } - try { - // 获取处理进度 - Message progressMsg = lc.lfasrGetProgress(task_id); - - // 如果返回状态不等于0,则任务失败 - if (progressMsg.getOk() != 0) { - System.out.println("task was fail. task_id:" + task_id); - System.out.println("ecode=" + progressMsg.getErr_no()); - System.out.println("failed=" + progressMsg.getFailed()); - - return; - } else { - ProgressStatus progressStatus = JSON.parseObject(progressMsg.getData(), ProgressStatus.class); - if (progressStatus.getStatus() == 9) { - // 处理完成 - System.out.println("task was completed. task_id:" + task_id); - break; - } else { - // 未处理完成 - System.out.println("task is incomplete. task_id:" + task_id + ", status:" + progressStatus.getDesc()); - continue; - } - } - } catch (LfasrException e) { - // 获取进度异常处理,根据返回信息排查问题后,再次进行获取 - Message progressMsg = JSON.parseObject(e.getMessage(), Message.class); - System.out.println("ecode=" + progressMsg.getErr_no()); - System.out.println("failed=" + progressMsg.getFailed()); - } - } - - // 获取任务结果 - try { - Message resultMsg = lc.lfasrGetResult(task_id); - // 如果返回状态等于0,则获取任务结果成功 - if (resultMsg.getOk() == 0) { - // 打印转写结果 - System.out.println(JsonParser.parseMessage(resultMsg.getData())); - } else { - // 获取任务结果失败 - System.out.println("ecode=" + resultMsg.getErr_no()); - System.out.println("failed=" + resultMsg.getFailed()); - } - } catch (LfasrException e) { - // 获取结果异常处理,解析异常描述信息 - Message resultMsg = JSON.parseObject(e.getMessage(), Message.class); - System.out.println("ecode=" + resultMsg.getErr_no()); - System.out.println("failed=" + resultMsg.getFailed()); - } - } -} \ No newline at end of file +//package com.bage.study.xfyun.lfasr; +// +//import com.alibaba.fastjson.JSON; +//import com.iflytek.msp.cpdb.lfasr.client.LfasrClientImp; +//import com.iflytek.msp.cpdb.lfasr.exception.LfasrException; +//import com.iflytek.msp.cpdb.lfasr.model.LfasrType; +//import com.iflytek.msp.cpdb.lfasr.model.Message; +//import com.iflytek.msp.cpdb.lfasr.model.ProgressStatus; +// +//import java.io.File; +//import java.util.HashMap; +// +///** +// * 非实时转写SDK调用demo +// * 此demo只是一个简单的调用示例, 不适合用到实际生产环境中 +// * +// * @author white +// * +// */ +//public class LfasrSDKDemo { +// +// // 原始音频存放地址 +// private static final String local_file = "E:\\workspace\\IdeaProjects\\study\\study\\study-xfyun-lfasr\\target\\classes\\audio\\lfasr.wav"; +// +// /* +// * 转写类型选择:标准版和电话版(旧版本, 不建议使用)分别为: +// * LfasrType.LFASR_STANDARD_RECORDED_AUDIO 和 LfasrType.LFASR_TELEPHONY_RECORDED_AUDIO +// * */ +// private static final LfasrType type = LfasrType.LFASR_STANDARD_RECORDED_AUDIO; +// +// // 等待时长(毫秒) +// private static int sleepMillis = 500; +// +// public static void main(String[] args) { +// // 初始化LFASRClient实例 +// LfasrClientImp lc = null; +// try { +// lc = LfasrClientImp.initLfasrClient(); +// } catch (LfasrException e) { +// // 初始化异常,解析异常描述信息 +// Message initMsg = JSON.parseObject(e.getMessage(), Message.class); +// System.out.println("ecode=" + initMsg.getErr_no()); +// System.out.println("failed=" + initMsg.getFailed()); +// } +// +// // 获取上传任务ID +// String task_id = ""; +// HashMap params = new HashMap(); +// params.put("has_participle", "true"); +// //合并后标准版开启电话版功能 +// //params.put("has_seperate", "true"); +// try { +// // 上传音频文件 +// Message uploadMsg = lc.lfasrUpload(local_file, type, params); +// +// // 判断返回值 +// int ok = uploadMsg.getOk(); +// if (ok == 0) { +// // 创建任务成功 +// task_id = uploadMsg.getData(); +// System.out.println("task_id=" + task_id); +// } else { +// // 创建任务失败-服务端异常 +// System.out.println("ecode=" + uploadMsg.getErr_no()); +// System.out.println("failed=" + uploadMsg.getFailed()); +// } +// } catch (LfasrException e) { +// // 上传异常,解析异常描述信息 +// Message uploadMsg = JSON.parseObject(e.getMessage(), Message.class); +// System.out.println("ecode=" + uploadMsg.getErr_no()); +// System.out.println("failed=" + uploadMsg.getFailed()); +// } +// +// // 循环等待音频处理结果 +// while (true) { +// try { +// // 等待sleepMillis在获取任务进度 +// Thread.sleep(sleepMillis); +// System.out.println("waiting ..."); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } +// try { +// // 获取处理进度 +// Message progressMsg = lc.lfasrGetProgress(task_id); +// +// // 如果返回状态不等于0,则任务失败 +// if (progressMsg.getOk() != 0) { +// System.out.println("task was fail. task_id:" + task_id); +// System.out.println("ecode=" + progressMsg.getErr_no()); +// System.out.println("failed=" + progressMsg.getFailed()); +// +// return; +// } else { +// ProgressStatus progressStatus = JSON.parseObject(progressMsg.getData(), ProgressStatus.class); +// if (progressStatus.getStatus() == 9) { +// // 处理完成 +// System.out.println("task was completed. task_id:" + task_id); +// break; +// } else { +// // 未处理完成 +// System.out.println("task is incomplete. task_id:" + task_id + ", status:" + progressStatus.getDesc()); +// continue; +// } +// } +// } catch (LfasrException e) { +// // 获取进度异常处理,根据返回信息排查问题后,再次进行获取 +// Message progressMsg = JSON.parseObject(e.getMessage(), Message.class); +// System.out.println("ecode=" + progressMsg.getErr_no()); +// System.out.println("failed=" + progressMsg.getFailed()); +// } +// } +// +// // 获取任务结果 +// try { +// Message resultMsg = lc.lfasrGetResult(task_id); +// // 如果返回状态等于0,则获取任务结果成功 +// if (resultMsg.getOk() == 0) { +// // 打印转写结果 +// System.out.println(JsonParser.parseMessage(resultMsg.getData())); +// } else { +// // 获取任务结果失败 +// System.out.println("ecode=" + resultMsg.getErr_no()); +// System.out.println("failed=" + resultMsg.getFailed()); +// } +// } catch (LfasrException e) { +// // 获取结果异常处理,解析异常描述信息 +// Message resultMsg = JSON.parseObject(e.getMessage(), Message.class); +// System.out.println("ecode=" + resultMsg.getErr_no()); +// System.out.println("failed=" + resultMsg.getFailed()); +// } +// } +//} \ No newline at end of file diff --git a/study-xxl-job/pom.xml b/study-xxl-job/pom.xml index 89d7e3abd..200a02a8d 100644 --- a/study-xxl-job/pom.xml +++ b/study-xxl-job/pom.xml @@ -69,7 +69,7 @@ org.projectlombok lombok - 1.16.18 + 1.18.20 provided From be39f96a19a5b9176343044cfb14adf138cfb352 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Wed, 27 Oct 2021 12:48:16 +0800 Subject: [PATCH 029/129] compile fix --- study-json-to-pojo/pom.xml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/study-json-to-pojo/pom.xml b/study-json-to-pojo/pom.xml index 95b7a9610..0b5e02bf5 100644 --- a/study-json-to-pojo/pom.xml +++ b/study-json-to-pojo/pom.xml @@ -19,8 +19,6 @@ UTF-8 1.8 1.8 - 1.7 - 1.7 @@ -37,19 +35,18 @@ 1.0.0 - - - org.json - JSON-Java - 1.2 - jar - junit junit 4.12 compile + + org.json + json + 20160810 + compile + From 1762ed11f37527dcbc4af21acf91d5c57f935656 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Sun, 31 Oct 2021 23:58:58 +0800 Subject: [PATCH 030/129] new start --- study-summary/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/study-summary/README.md b/study-summary/README.md index 5ebf9c296..52e7b589a 100644 --- a/study-summary/README.md +++ b/study-summary/README.md @@ -2,6 +2,8 @@ PPT 讲解 STAR 法则,背景、遇到问题、采取的方案、取得的效果 +NEW STRAT + ## 常用连接 From 16d3832db97a7d0ae3e27697631d70701be71efe Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Wed, 10 Nov 2021 12:41:26 +0800 Subject: [PATCH 031/129] Update README.md --- study-summary/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/study-summary/README.md b/study-summary/README.md index b58c62367..037006ff8 100644 --- a/study-summary/README.md +++ b/study-summary/README.md @@ -4,6 +4,8 @@ PPT 讲解 STAR 法则,背景、遇到问题、采取的方案、取得的效 NEW STRAT UT 编写用例 +管理学知识 +技术技能 ## 常用连接 From 865eef202e11eeba8bfe469aa426553a2731f499 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Fri, 12 Nov 2021 08:36:58 +0800 Subject: [PATCH 032/129] book dir change --- .DS_Store | Bin 0 -> 6148 bytes PPT.md => study-summary/PPT.md | 0 .../README-OS-Reinstall.md | 0 .../README-WeChat-Developer.md | 0 README-paxos.md => study-summary/README-paxos.md | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 .DS_Store rename PPT.md => study-summary/PPT.md (100%) rename README-OS-Reinstall.md => study-summary/README-OS-Reinstall.md (100%) rename README-WeChat-Developer.md => study-summary/README-WeChat-Developer.md (100%) rename README-paxos.md => study-summary/README-paxos.md (100%) diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7f7cfe4c8abb75b6d4a312ce9956b8cd041fbf5b GIT binary patch literal 6148 zcmeHK%}T>S5T0$TZY#we1U=^BO(7P0=s^fk58i}`9#k|T#Rl4>G^wS=N?t?X$S3f1 zoY~zL#h;T1mYFj9&Cbs3vfq}SEC2|16z&2v06?M=ma5o%Av8|9&=($!^*0>9i_0ws!ZAZ~Bw_{9*d|qnE_^i8CVbo%=IQ$7i2%Y4Q7BD_&o;bey~sp9fO5N zb#-7vpN}+NAtXVY-V%hCLC0XB5l2vjPDRwI!aOmAPDj6G;v9p8Mx72qt&H=Sm4$hs z2(>!;Efo&J(a0?`zzlq3psc$Ms{cpdzyCibagP~b1{R6|Q91MuUEGqXt)DhWwbnwt rK_#KMLgPFI4ONOUmP+v^suJ{DWFR^Q3ytVO;ST{t12@dTpEB?U-u_mN literal 0 HcmV?d00001 diff --git a/PPT.md b/study-summary/PPT.md similarity index 100% rename from PPT.md rename to study-summary/PPT.md diff --git a/README-OS-Reinstall.md b/study-summary/README-OS-Reinstall.md similarity index 100% rename from README-OS-Reinstall.md rename to study-summary/README-OS-Reinstall.md diff --git a/README-WeChat-Developer.md b/study-summary/README-WeChat-Developer.md similarity index 100% rename from README-WeChat-Developer.md rename to study-summary/README-WeChat-Developer.md diff --git a/README-paxos.md b/study-summary/README-paxos.md similarity index 100% rename from README-paxos.md rename to study-summary/README-paxos.md From 63a80eacf09d282cfaf1aab07e7044b5918cd26e Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Fri, 12 Nov 2021 08:56:34 +0800 Subject: [PATCH 033/129] java new process --- .DS_Store | Bin 6148 -> 6148 bytes study-summary/README.md | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/.DS_Store b/.DS_Store index 7f7cfe4c8abb75b6d4a312ce9956b8cd041fbf5b..060b207cc4ee703c81f3da544acb9b99f4d0b4e3 100644 GIT binary patch delta 21 ccmZoMXffEZlZnI3$Vf-Q$kc4}K_+KW07)VSEdT%j delta 21 ccmZoMXffEZlZnIB$UsNI$i#H>K_+KW07&u%C;$Ke diff --git a/study-summary/README.md b/study-summary/README.md index 037006ff8..eb408409b 100644 --- a/study-summary/README.md +++ b/study-summary/README.md @@ -150,6 +150,28 @@ CompletableFuture; ## [JVM](https://github.com/bage2014/interview/blob/master/README-Jvm.md) ## 常用理论知识,前世今生,开源组件; +### 对象创建 + +**常量池校验** + +**内存分配** + +1. 指针碰撞 +2. 空闲列表 + +内存分配线程安全 + +1. CAS线程枷锁实现 +2. TLAB 本地线程分配缓冲 + +**零值初始化** + +**对象元信息初始化** + +**Java 线程初始化** + + + ### 内存划分 ### 了解目标:基本概念、主要特点、常见异常 From b2f708a50261e7953137df5dda03d83bf54b57cf Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Fri, 12 Nov 2021 12:12:51 +0800 Subject: [PATCH 034/129] java compile version --- .DS_Store | Bin 6148 -> 6148 bytes study-java-shell/pom.xml | 2 -- study-jmeter/pom.xml | 2 -- study-json/pom.xml | 2 -- study-leancloud/pom.xml | 2 -- study-m3u/pom.xml | 3 +-- study-zipkin/pom.xml | 2 -- 7 files changed, 1 insertion(+), 12 deletions(-) diff --git a/.DS_Store b/.DS_Store index 060b207cc4ee703c81f3da544acb9b99f4d0b4e3..d334e491a6ce5b120514312adbb2d30f6df253bd 100644 GIT binary patch delta 20 bcmZoMXffEZlZoBP%uGkY$YS#WCKpivL)-=Z delta 20 bcmZoMXffEZlZoBT$Vf-Q$aM1oCKpivL#74x diff --git a/study-java-shell/pom.xml b/study-java-shell/pom.xml index 16317767c..7c0b11346 100644 --- a/study-java-shell/pom.xml +++ b/study-java-shell/pom.xml @@ -19,8 +19,6 @@ UTF-8 1.8 1.8 - 1.7 - 1.7 diff --git a/study-jmeter/pom.xml b/study-jmeter/pom.xml index 22ab06782..c1e330165 100644 --- a/study-jmeter/pom.xml +++ b/study-jmeter/pom.xml @@ -19,8 +19,6 @@ UTF-8 1.8 1.8 - 1.7 - 1.7 diff --git a/study-json/pom.xml b/study-json/pom.xml index 040b13cd3..f28f2062b 100644 --- a/study-json/pom.xml +++ b/study-json/pom.xml @@ -31,8 +31,6 @@ UTF-8 1.8 1.8 - 1.7 - 1.7 diff --git a/study-leancloud/pom.xml b/study-leancloud/pom.xml index fb9c46053..37534cc17 100644 --- a/study-leancloud/pom.xml +++ b/study-leancloud/pom.xml @@ -19,8 +19,6 @@ UTF-8 1.8 1.8 - 1.7 - 1.7 diff --git a/study-m3u/pom.xml b/study-m3u/pom.xml index da4ef06de..5a1348fbd 100644 --- a/study-m3u/pom.xml +++ b/study-m3u/pom.xml @@ -27,8 +27,7 @@ UTF-8 1.8 1.8 - 1.7 - 1.7 + diff --git a/study-zipkin/pom.xml b/study-zipkin/pom.xml index 479a20158..932aea4c3 100644 --- a/study-zipkin/pom.xml +++ b/study-zipkin/pom.xml @@ -19,8 +19,6 @@ UTF-8 1.8 1.8 - 1.7 - 1.7 2.0.1.RELEASE 5.6.10 From 6f17e32ec314b2a9d36e6f909b924c76bb63cb9c Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Tue, 16 Nov 2021 21:44:12 +0800 Subject: [PATCH 035/129] jmocket --- study-jmockit/coverage-failure.txt | 17 +++++++++++++++++ study-jmockit/pom.xml | 2 -- .../java/com/bage/jmockit/HelloJMockitTest.java | 3 +++ .../java/com/bage/jmockit/HelloServiceTest.java | 13 ++++++------- 4 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 study-jmockit/coverage-failure.txt diff --git a/study-jmockit/coverage-failure.txt b/study-jmockit/coverage-failure.txt new file mode 100644 index 000000000..a2c140e93 --- /dev/null +++ b/study-jmockit/coverage-failure.txt @@ -0,0 +1,17 @@ +java.lang.IllegalStateException: Running on JDK 9 requires -javaagent:/jmockit-1.n.jar or -Djdk.attach.allowAttachSelf + at mockit.internal.startup.AgentLoader.attachToRunningVM(AgentLoader.java:151) + at mockit.internal.startup.AgentLoader.loadAgent(AgentLoader.java:60) + at mockit.internal.startup.Startup.verifyInitialization(Startup.java:137) + at mockit.internal.startup.Startup.instrumentation(Startup.java:130) + at mockit.coverage.modification.ClassModification.redefineClassesAlreadyLoadedForCoverage(ClassModification.java:34) + at mockit.coverage.modification.ClassModification.(ClassModification.java:29) + at mockit.coverage.CodeCoverage.(CodeCoverage.java:52) + at mockit.coverage.CodeCoverage.create(CodeCoverage.java:90) + at mockit.internal.startup.Startup.activateCodeCoverageIfRequested(Startup.java:109) + at mockit.internal.startup.Startup.premain(Startup.java:52) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:568) + at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:491) + at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:503) diff --git a/study-jmockit/pom.xml b/study-jmockit/pom.xml index 98747c135..85130b5ae 100644 --- a/study-jmockit/pom.xml +++ b/study-jmockit/pom.xml @@ -18,8 +18,6 @@ UTF-8 1.8 1.8 - 1.7 - 1.7 diff --git a/study-jmockit/src/test/java/com/bage/jmockit/HelloJMockitTest.java b/study-jmockit/src/test/java/com/bage/jmockit/HelloJMockitTest.java index 8efe57515..bacd18e14 100644 --- a/study-jmockit/src/test/java/com/bage/jmockit/HelloJMockitTest.java +++ b/study-jmockit/src/test/java/com/bage/jmockit/HelloJMockitTest.java @@ -3,10 +3,13 @@ import mockit.Expectations; import mockit.Mocked; import mockit.Verifications; +import mockit.integration.junit4.JMockit; import org.junit.Assert; import org.junit.Test; +import org.junit.runner.RunWith; //HelloJMockit类的测试类 +@RunWith(JMockit.class) public class HelloJMockitTest { // 这是一个测试属性 diff --git a/study-jmockit/src/test/java/com/bage/jmockit/HelloServiceTest.java b/study-jmockit/src/test/java/com/bage/jmockit/HelloServiceTest.java index 479dcc931..cdda15295 100644 --- a/study-jmockit/src/test/java/com/bage/jmockit/HelloServiceTest.java +++ b/study-jmockit/src/test/java/com/bage/jmockit/HelloServiceTest.java @@ -1,31 +1,30 @@ package com.bage.jmockit; -import mockit.Expectations; -import mockit.Mocked; -import mockit.Verifications; +import mockit.*; import org.junit.Assert; import org.junit.Test; //HelloJMockit类的测试类 public class HelloServiceTest { - @Mocked + @Tested HelloService helloService; - @Mocked + @Injectable HelloJMockit helloJMockit; @Test - public void test() { + public void test(final @Mocked HelloJMockit target) { // 录制(Record) new Expectations() { { - helloJMockit.sayHello(); + target.sayHello(); // 期待上述调用的返回是"hello,david",而不是返回"hello,JMockit" result = "hello,david"; } }; // 重放(Replay) String msg = helloService.sayHello(); + System.out.println(msg); Assert.assertTrue(msg.equals("hello,david")); // 验证(Verification) new Verifications() { From f2a88b743d5b210c017512be7896f19e1bbd3ecf Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Sat, 20 Nov 2021 13:26:23 +0800 Subject: [PATCH 036/129] Update README.md --- study-summary/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/study-summary/README.md b/study-summary/README.md index eb408409b..a1f516dc7 100644 --- a/study-summary/README.md +++ b/study-summary/README.md @@ -6,6 +6,9 @@ NEW STRAT UT 编写用例 管理学知识 技术技能 +Cauch 教练管理方式 +裸心会 +调查问卷 ## 常用连接 From a4bbdcebed649ca10514c74440033654c1eacf28 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Tue, 23 Nov 2021 17:26:24 +0800 Subject: [PATCH 037/129] add file online --- pom.xml | 1 + study-file-online-preview/README.md | 2 ++ study-file-online-preview/pom.xml | 27 +++++++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 study-file-online-preview/README.md create mode 100644 study-file-online-preview/pom.xml diff --git a/pom.xml b/pom.xml index 15f5c85fb..bc58f8c0d 100644 --- a/pom.xml +++ b/pom.xml @@ -147,6 +147,7 @@ study-jmockit study-mockito study-java-agent-instrument + untitled \ No newline at end of file diff --git a/study-file-online-preview/README.md b/study-file-online-preview/README.md new file mode 100644 index 000000000..b4d1a82e8 --- /dev/null +++ b/study-file-online-preview/README.md @@ -0,0 +1,2 @@ +https://gitee.com/kekingcn/file-online-preview/blob/master/README.md + diff --git a/study-file-online-preview/pom.xml b/study-file-online-preview/pom.xml new file mode 100644 index 000000000..17ddd126a --- /dev/null +++ b/study-file-online-preview/pom.xml @@ -0,0 +1,27 @@ + + + + study + com.bage + 0.0.1-SNAPSHOT + + 4.0.0 + + study-file-online-preview + + + 8 + 8 + + + + + + + + + + + \ No newline at end of file From 501f93df62ce261f7554769ed17af0c2df93b505 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sun, 28 Nov 2021 15:54:52 +0800 Subject: [PATCH 038/129] bilibili summary . --- .DS_Store | Bin 6148 -> 16388 bytes study-summary/README-bilibili.md | 51 +++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 study-summary/README-bilibili.md diff --git a/.DS_Store b/.DS_Store index d334e491a6ce5b120514312adbb2d30f6df253bd..b271d6d43a8b6bf71ad5a175d262f5085800f530 100644 GIT binary patch literal 16388 zcmeHOO>CQmW#?^R*Z7G2Ya0zI7EJ%n$ybkKAzqpH%SpH6ELwPidN3=_GBZKA!*kj}3^( z2V_q#rg55x{Ebw{C*3rDuQzNqdcy|3g(X(5gW$$L?Z77~UBu&yLOo8SbO_2p+J`P0 zX^6iGULD}`dO-U-06tovMPB%?@VY8|2B{6)Njg!?js2BWL#%5Gs`atfz*+-q4Xicr zS=9h*H;$^S_1P!u=d}jb8u-j>fcc?@2hY3n^J#Xr)PX0q&-_1IXgly4O|pGfo1b^* z=hN(Lq@XcUoHNqOe8i|^H2~=HSAkV%%}A;SG+;uASCT zYYnV5P@sWreD-CTDwj>KeVaBp*EZu!%!$)Yu_?V?5^ zbi`*}NBTqH^J*zRhd^o-??#B!Un+$*hNS(}Q^_j73X*-LBvu>xq|Lhdy@(2SFhss` zS{;M)(5!W)QEHb~>p~9$@VTwB(*yr4e0BmKc%kt5T1g!ht!KH9&=>#ceDNEf4j1U~ zAkET5*JK{)xs}TY+%K!c>XW>WbB|2qzfn?thX`4T3@$3Id8wDSoW~bq(K|iXS4+t` zgIo=Ka|n<81zraU%@;lDYo$;h!M8`i!@i-ec!NIY@mATV1$jnz43I7O+_Z=Z`-;qU zmv1`%`uqwB+sG7kpoDBeuMvz_R$$Q68Pi?pEUb>cQWB?+eA+Z0uH#kQNk#S&oaI_S z!x=!D%$COm*$}=Vcwbn$zB9Z66#9aoYz35uQLnVNP{i2DG6`#18~Lz>%$w~qpJmEb zwTE{9(Ahm^_+{8DGOzi;^J0c9Yd+yIKNqw%LEdRw4db1vC2?@=)yv$myLMw2kE@1i5DtORYwS!pi5drDAaF^ z0$LfMAoX=+W`(ED3d+lpa-g6MJjKhRi*rh{Y2Q<8LV>U0f+Z8_HuUlU8Xd>Boe4$w z>spV~F(}zy4O2rUH*0v_YQ^PcA2B8zL!hqTt~K!d8bCTs*KI;((q`H$zIH9$KE5|X z3PInYuFkMdzOQ`!lOu!2(qt?=E+GY?t3=p#qdW|I`R--N&7^q~;aWKV%D1=D57N6> z)BW^aoNt1nrR!yA3&l&4l(^5pRLfm}etM|1EQms@39XKFvJY9ask##rC{wRcYf{PP zG8Vvs&Od$V60eq_I`oq3&{_V3MkQq@+O& zLd7>b+6Xk^Vcby(1&j6;DlL|bHqMsYh&cKur^DEQz~+LWv*9xY<{aL|!acbO(RBT^ zwBTrbH9>cRh-QrCyq2*kwAx}c;pwr#L_`XO?ku!y=FfbUYi54p9@PPCn&VE(36{pE zHHfx%5LV0#T6yZ?Gs?j1#du?@a*p=Qjvh<3M;T_oq4p4YLG!err`2|+Wfq%3253G| z(q^7geU9^LgV7hLXf02rIfk>|7`AT1YHabtUIgPzs8!lF^2;K2m9N>!^Q}sRqMg_8 zn|=P~?4zSV8yaOqA3$F0P~cUal`>#3zC4CzMAk9vPJ@01BIa*3;l`7GYi%rQC=7q~dTE?lQCZ@|3Cxp@j5>wcPCHG1OP~A$7q{kJ)TF z6{{ZgHc}nYavMKiYB{Tw@Do-tXTg90%L#@?R0pd>SAi=5BcO!rLK_LKYPtjOW{<^s zf2>?-BcW7HQ{r=T0j(t%s%h@rGqyq=r+tJ*hr&c3fwhIgms>EhBPpKN` zy`WR9xf7^pCr=eMUQ}ynB~PRNF|SV+gREEVfH9^jU$dIW&}w;ryi+j3U-*`@NTk3> zt~_Xib10$?p?#sys=zGCSZDvltA?>VN8AXtS|H1;(_FN{0z#$T4>{ElaqN0~bM9fC zj2b~u%@85XP1L?n$6%%e#~aV zPuFOBvMM3tK`8XPC%c*v{%oqmTF>cin9l@FX8@vEGy{)z>ZV8Vm2JdZ!E~!~n)SR! z)N6>$c`jVVFbjGr%@Zz5#K>c2+q~f{m#5_ZK6~zhK3ym=ynO5fb_`d#dGEfzVxF@E z^tjLhUXP&PDI|pDRFky0$fsUCfF`rqnD@w|zkpUlw?!)pg4*Kw?tc%NmlhOWT4AuQ zhv>;xPCw0cQf9~BI6Gj>7s9AZ7q>s%w`@% zFtt_|`Ya^Qc2%=@WOTF73Ns+BF39m(b+HCY-J`&G7wqVv%dpQpElj%1&lf*(ep2pE zB>tX_m8uWT^4^1U?^83s@_fquHjMf`D)29l6f;G!25=`@z(E~;wsQBsOIf#Y_bSfs zF8}@C$L=ZC1ZxefHSoWqfy(Cnz5DkdZ)J(hyw|>l#|L=u;P+1X0ta5(t@t?Gt@t?0 qkA?AmcmBQ8?2J!v{KtO)5N7Um{YNbe*V&{`S=axp>-;~h|NjE{$hgk{ delta 180 zcmZo^U~DmvU|?WibSh0TWMB{gGC6=4L^E+tEEJolCpp=`hD8#{XJ7(iMzCBZgDyic zLn%WpL+)llrsa$vC6hl(NKf{VoG4_bqhMrVR;!~>ZE0knqhM-aIr+6@{ALlR+boOO yIXDEFL1qDs;RX_}AZvg|d}p4_Z)2$dG#!W_0LWkgv4FOMTm*6?!{&INIm`gVWE?pF diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md new file mode 100644 index 000000000..42351b249 --- /dev/null +++ b/study-summary/README-bilibili.md @@ -0,0 +1,51 @@ +# 常用链接 + + + +- 搜索结果 + +https://search.bilibili.com/all?keyword=JAVA%E9%9D%A2%E8%AF%95%E9%A2%982021&from_source=webtop_search&spm_id_from=333.851&order=totalrank&duration=4&tids_1=0 + + + + + +# [活动作品](https://www.bilibili.com/blackboard/techhunters3.html)2022年最新版Java面试题突击视频教程,不管工作几年还是应届生必看的Java面试必考真题【最强Java面试宝典】赶紧收藏起来! + +https://www.bilibili.com/video/BV1UU4y1u7fB?p=2&spm_id_from=pageDriver + + + +- 面试系列!! + +# Alibaba最新Java面试137题汇总详解__对标P7,全学完随便拿50Koffer + +https://www.bilibili.com/video/BV1V44y1i7L8?from=search&seid=16808638854944282623&spm_id_from=333.337.0.0 + + + +# [活动作品](https://www.bilibili.com/video/BV1aV411W7U2?from=search&seid=7880316255452534004&spm_id_from=333.337.0.0)B站最全面Java面试500讲(涵盖所有Java核心面试知识点),立刻收藏! + +https://www.bilibili.com/video/BV1aV411W7U2?from=search&seid=7880316255452534004&spm_id_from=333.337.0.0 + + + +- 马士兵 + +# 终于把阿里1350道Java面试题都讲明白了:开源视频+笔记+源码+文档+解析图 + +https://www.bilibili.com/video/BV1G44y1v7Hz?p=1 + + + +- 面试题目汇总-- + +https://www.bilibili.com/video/BV1iV411p7LU?from=search&seid=7880316255452534004&spm_id_from=333.337.0.0 + + + +https://www.bilibili.com/video/BV1w341187cF?from=search&seid=7880316255452534004&spm_id_from=333.337.0.0 + + + +https://www.bilibili.com/video/BV1444y1x7gJ?from=search&seid=591244058940940941&spm_id_from=333.337.0.0 From b3115116a4b07c9545391aef0b4620bf14634385 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sun, 5 Dec 2021 20:28:09 +0800 Subject: [PATCH 039/129] structure --- .gitignore | 1 + study-summary/README-structure.md | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 study-summary/README-structure.md diff --git a/.gitignore b/.gitignore index d386c3123..b16b59ea8 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ buildNumber.properties *.iml out gen +study-summary/.DS_Store diff --git a/study-summary/README-structure.md b/study-summary/README-structure.md new file mode 100644 index 000000000..63e213aa1 --- /dev/null +++ b/study-summary/README-structure.md @@ -0,0 +1,16 @@ +# 系统结构 + +技术要素 + +团队建设 + +发展 + +技术趋势 + +招兵买马 + + + + + From 73beb741fefad7069821ee1261874222de250383 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 8 Dec 2021 00:43:29 +0800 Subject: [PATCH 040/129] guava retry demo --- pom.xml | 1 + study-guava/pom.xml | 5 ++ .../java/com/bage/study/guava/RetryDemo.java | 53 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 study-guava/src/main/java/com/bage/study/guava/RetryDemo.java diff --git a/pom.xml b/pom.xml index bc58f8c0d..3423496bc 100644 --- a/pom.xml +++ b/pom.xml @@ -53,6 +53,7 @@ study-gateway study-sql study-quartz + study-guava study-shiro-web-tutorial study-rabbitmq study-tomcat diff --git a/study-guava/pom.xml b/study-guava/pom.xml index 9ca554658..cb63a0c6b 100644 --- a/study-guava/pom.xml +++ b/study-guava/pom.xml @@ -56,6 +56,11 @@ guava-testlib 26.0-jre + + com.github.rholder + guava-retrying + 2.0.0 + com.google.truth diff --git a/study-guava/src/main/java/com/bage/study/guava/RetryDemo.java b/study-guava/src/main/java/com/bage/study/guava/RetryDemo.java new file mode 100644 index 000000000..9dc8b4bfc --- /dev/null +++ b/study-guava/src/main/java/com/bage/study/guava/RetryDemo.java @@ -0,0 +1,53 @@ +package com.bage.study.guava; + +import com.github.rholder.retry.RetryException; +import com.github.rholder.retry.Retryer; +import com.github.rholder.retry.RetryerBuilder; +import com.github.rholder.retry.StopStrategies; +import com.google.common.base.Predicates; + +import java.io.IOException; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; + +public class RetryDemo { + + private static int count = 0; + + public static void main(String[] args) { + + Callable callable = new Callable() { + public Boolean call() throws Exception { + System.out.println(count ++); + if(count <= 2){ + throw new IOException(); + } + return true; // do something useful here + } + }; + + Retryer retryer = RetryerBuilder.newBuilder() + .retryIfResult(Predicates.isNull()) + .retryIfExceptionOfType(IOException.class) + .retryIfRuntimeException() + .withStopStrategy(StopStrategies.stopAfterAttempt(5)) + .build(); + +// Retryer retryer = RetryerBuilder.newBuilder() +// .retryIfExceptionOfType(IOException.class) +// .retryIfRuntimeException() +// .withWaitStrategy(WaitStrategies.exponentialWait(100, 5, TimeUnit.MINUTES)) +// .withStopStrategy(StopStrategies.neverStop()) +// .build(); + + try { + retryer.call(callable); + } catch (RetryException e) { + e.printStackTrace(); + } catch (ExecutionException e) { + e.printStackTrace(); + } + + + } +} From f7235df27665d7552c10f3e776508341df612290 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sun, 12 Dec 2021 00:00:00 +0800 Subject: [PATCH 041/129] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b4f079eb..adaa4c79e 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ AOP实用技巧;比如打日志等 m3u parser https://github.com/BjoernPetersen/m3u-parser -知识汇总:::: +知识汇总: https://github.com/CyC2018/CS-Notes @@ -49,6 +49,10 @@ https://github.com/jobbole/awesome-java-cn https://mp.weixin.qq.com/s/kro_gyUQrdKSy1x3ETwb5A +限流组件 + +重试组件 + ## Others ## From cdbf57777477c00fa70c4c615ee569c72d3cd844 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Thu, 16 Dec 2021 00:35:59 +0800 Subject: [PATCH 042/129] Update README-bilibili.md --- study-summary/README-bilibili.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 42351b249..a4fe84560 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -12,6 +12,8 @@ https://search.bilibili.com/all?keyword=JAVA%E9%9D%A2%E8%AF%95%E9%A2%982021&from # [活动作品](https://www.bilibili.com/blackboard/techhunters3.html)2022年最新版Java面试题突击视频教程,不管工作几年还是应届生必看的Java面试必考真题【最强Java面试宝典】赶紧收藏起来! +ING(进度): https://www.bilibili.com/video/BV1nK4y1H7g9?p=14&spm_id_from=pageDriver + https://www.bilibili.com/video/BV1UU4y1u7fB?p=2&spm_id_from=pageDriver From a1080abd2838a3ec2e5c3a32757f23d34ef936dc Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Fri, 17 Dec 2021 00:50:38 +0800 Subject: [PATCH 043/129] =?UTF-8?q?MYSQL=20=E8=BF=9B=E5=BA=A6=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- study-summary/README-bilibili.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index a4fe84560..9f25d0301 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,3 +1,15 @@ +# 进度备忘 + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=18&spm_id_from=pageDriver + + +## 总结 +MySQL +1、 索引、联合索引 +2、 log日志 +3、 版本控制 +4、 + # 常用链接 @@ -12,7 +24,7 @@ https://search.bilibili.com/all?keyword=JAVA%E9%9D%A2%E8%AF%95%E9%A2%982021&from # [活动作品](https://www.bilibili.com/blackboard/techhunters3.html)2022年最新版Java面试题突击视频教程,不管工作几年还是应届生必看的Java面试必考真题【最强Java面试宝典】赶紧收藏起来! -ING(进度): https://www.bilibili.com/video/BV1nK4y1H7g9?p=14&spm_id_from=pageDriver + https://www.bilibili.com/video/BV1UU4y1u7fB?p=2&spm_id_from=pageDriver From d6978767f0d51213cd457fa5f71ba9c9e62ea79a Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sun, 19 Dec 2021 20:58:59 +0800 Subject: [PATCH 044/129] =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 16388 -> 16388 bytes study-summary/README-bilibili.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.DS_Store b/.DS_Store index b271d6d43a8b6bf71ad5a175d262f5085800f530..78528e9d0c4209b3fd907bec17706203f38dc868 100644 GIT binary patch delta 35 qcmZo^U~Fk%+;Ck|#L&c2N5RO%tX4;%+S15CN5Ry Date: Tue, 21 Dec 2021 10:08:55 +0800 Subject: [PATCH 045/129] Update README-security.md --- study-security/README-security.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/study-security/README-security.md b/study-security/README-security.md index 54ee88133..5609e6720 100644 --- a/study-security/README-security.md +++ b/study-security/README-security.md @@ -1,8 +1,6 @@ # Web Security # -Web 应用安全 - -很重要!!! +Web 应用安全,,,很重要!!! ## 安全类型 ## @@ -167,4 +165,4 @@ sign 签名,请求无法进行伪造 ## 参考链接 ## - security-guide-for-developers -[https://github.com/FallibleInc/security-guide-for-developers](https://github.com/FallibleInc/security-guide-for-developers "security-guide-for-developers") \ No newline at end of file +[https://github.com/FallibleInc/security-guide-for-developers](https://github.com/FallibleInc/security-guide-for-developers "security-guide-for-developers") From a651eaac0887f134a3c8fb74a4f244cfda585f3d Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Tue, 21 Dec 2021 10:15:19 +0800 Subject: [PATCH 046/129] link ref --- study-security/README-security.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/study-security/README-security.md b/study-security/README-security.md index 5609e6720..0b33c51ee 100644 --- a/study-security/README-security.md +++ b/study-security/README-security.md @@ -164,5 +164,7 @@ sign 签名,请求无法进行伪造 - 不安全的反序列化漏洞 ## 参考链接 ## +- https://github.com/CHYbeta/Web-Security-Learning - security-guide-for-developers [https://github.com/FallibleInc/security-guide-for-developers](https://github.com/FallibleInc/security-guide-for-developers "security-guide-for-developers") +- https://github.com/qazbnm456/awesome-web-security/blob/master/README-zh.md From 2f03fc8e18460a85e451e33f14e74b14973aa306 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Wed, 22 Dec 2021 14:36:50 +0800 Subject: [PATCH 047/129] Added tis-call-trace.drawio --- study-draw-io/tis-call-trace.drawio | 1 + 1 file changed, 1 insertion(+) create mode 100644 study-draw-io/tis-call-trace.drawio diff --git a/study-draw-io/tis-call-trace.drawio b/study-draw-io/tis-call-trace.drawio new file mode 100644 index 000000000..e62e0cd31 --- /dev/null +++ b/study-draw-io/tis-call-trace.drawio @@ -0,0 +1 @@ +UzV2zq1wL0osyPDNT0nNUTV2VTV2LsrPL4GwciucU3NyVI0MMlNUjV1UjYwMgFjVyA2HrCFY1qAgsSg1rwSLBiADYTaQg2Y1AA== \ No newline at end of file From 44e9777fb0f4eea0394e2bb9f15de2a0265a6e5d Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Wed, 22 Dec 2021 14:53:20 +0800 Subject: [PATCH 048/129] Update tis-call-trace.drawio --- study-draw-io/tis-call-trace.drawio | 83 ++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/study-draw-io/tis-call-trace.drawio b/study-draw-io/tis-call-trace.drawio index e62e0cd31..3ba3c76fb 100644 --- a/study-draw-io/tis-call-trace.drawio +++ b/study-draw-io/tis-call-trace.drawio @@ -1 +1,82 @@ -UzV2zq1wL0osyPDNT0nNUTV2VTV2LsrPL4GwciucU3NyVI0MMlNUjV1UjYwMgFjVyA2HrCFY1qAgsSg1rwSLBiADYTaQg2Y1AA== \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 68768b9eeaa058768be882e2178c5780e5dd3f0f Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Wed, 22 Dec 2021 14:54:25 +0800 Subject: [PATCH 049/129] Update tis-call-trace.drawio --- study-draw-io/tis-call-trace.drawio | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/study-draw-io/tis-call-trace.drawio b/study-draw-io/tis-call-trace.drawio index 3ba3c76fb..f2f89c3bb 100644 --- a/study-draw-io/tis-call-trace.drawio +++ b/study-draw-io/tis-call-trace.drawio @@ -1,4 +1,4 @@ - + From f4a826b0b352a77522f652645663509303d27cd7 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Fri, 24 Dec 2021 00:15:37 +0800 Subject: [PATCH 050/129] Update README-bilibili.md --- study-summary/README-bilibili.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 51fe02110..84ce3e885 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,6 +1,6 @@ # 进度备忘 -https://www.bilibili.com/video/BV1nK4y1H7g9?p=41&spm_id_from=pageDriver +https://www.bilibili.com/video/BV1nK4y1H7g9?p=44&spm_id_from=pageDriver ## 总结 From c56db23f591392fcebdcb162d5684c08ccb20361 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Fri, 24 Dec 2021 19:45:58 +0800 Subject: [PATCH 051/129] Update README-bilibili.md --- study-summary/README-bilibili.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 84ce3e885..2fad02926 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,6 +1,6 @@ # 进度备忘 -https://www.bilibili.com/video/BV1nK4y1H7g9?p=44&spm_id_from=pageDriver +https://www.bilibili.com/video/BV1nK4y1H7g9?p=50 ## 总结 From 575521bfd224f4b3c0ab8c47c7abfd81608f84f0 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sat, 25 Dec 2021 20:19:06 +0800 Subject: [PATCH 052/129] jol --- .DS_Store | Bin 16388 -> 18436 bytes pom.xml | 1 + study-jol/README.md | 9 ++ study-jol/pom.xml | 84 ++++++++++++++++++ .../java/com/bage/JOLSample_01_Basic.java | 30 +++++++ study-jol/src/test/java/com/bage/AppTest.java | 20 +++++ study-summary/README-bilibili.md | 3 + 7 files changed, 147 insertions(+) create mode 100644 study-jol/README.md create mode 100644 study-jol/pom.xml create mode 100644 study-jol/src/main/java/com/bage/JOLSample_01_Basic.java create mode 100644 study-jol/src/test/java/com/bage/AppTest.java diff --git a/.DS_Store b/.DS_Store index 78528e9d0c4209b3fd907bec17706203f38dc868..8766ed7198ca0444a983381bf7eb0348c9ecff4a 100644 GIT binary patch delta 564 zcmZo^U~HMdsKUU&!01$(V#vVY0Az9iF^Cr60SW^-3P9R`XQGO>=wzTM3s8cAp_Czo zp^`zDA&a4WvLMsq$p$totV|%;$t^mjtgJwm$YcQl)ya3wRxMUUCdf=sWOC-d9*$^c^!6!{(?wZO0sfYJ#ddUAnH>*l3~?92cfmVRdd delta 286 zcmZpfz}V8jsKUU&!01$(V#vT?0c3IjF^Cr60SW^-3P9R`d!mZAXfIHd1t`J5P|A?P zP|2XnkjqdxS&(V*WCIr#Rwj__WG!P`M%KwZ0^XB98s}^lV*1KDv4M9pI|mB~t1eK1 z9=O*6)@)a3XHuD?EF;6Tr zVU-1HRGF-2EVa4GxSM_QQ!$yz_Ch?9^BLteJah7slXCKtfGXI47zix5frKl%^EV4J gy=I=w@8ZkD2=O6U?c{Wx-p#%i2bhq}study-mockito study-java-agent-instrument untitled + study-jol \ No newline at end of file diff --git a/study-jol/README.md b/study-jol/README.md new file mode 100644 index 000000000..edd2a2451 --- /dev/null +++ b/study-jol/README.md @@ -0,0 +1,9 @@ +# study-jol # + +## 参考链接 ## +- Jol https://github.com/openjdk/jol + + + + + diff --git a/study-jol/pom.xml b/study-jol/pom.xml new file mode 100644 index 000000000..43cad8ce7 --- /dev/null +++ b/study-jol/pom.xml @@ -0,0 +1,84 @@ + + + + 4.0.0 + + com.bage + study-jol + 0.0.1-SNAPSHOT + + study-jol + + http://www.example.com + + + UTF-8 + 1.8 + 1.8 + 0.16 + + + + + junit + junit + 4.11 + test + + + + org.openjdk.jol + jol-core + ${jol.api.version} + + + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + + + diff --git a/study-jol/src/main/java/com/bage/JOLSample_01_Basic.java b/study-jol/src/main/java/com/bage/JOLSample_01_Basic.java new file mode 100644 index 000000000..016bd47d9 --- /dev/null +++ b/study-jol/src/main/java/com/bage/JOLSample_01_Basic.java @@ -0,0 +1,30 @@ +package com.bage; + +import org.openjdk.jol.info.ClassLayout; +import org.openjdk.jol.vm.VM; + +import static java.lang.System.out; + +/** + * @author Aleksey Shipilev + */ +public class JOLSample_01_Basic { + + /* + * This sample showcases the basic field layout. + * You can see a few notable things here: + * a) how much the object header consumes; + * b) how fields are laid out; + * c) how the external alignment beefs up the object size + */ + + public static void main(String[] args) { + out.println(VM.current().details()); + out.println(ClassLayout.parseClass(A.class).toPrintable()); + } + + public static class A { + boolean f; + } + +} \ No newline at end of file diff --git a/study-jol/src/test/java/com/bage/AppTest.java b/study-jol/src/test/java/com/bage/AppTest.java new file mode 100644 index 000000000..9216cfd04 --- /dev/null +++ b/study-jol/src/test/java/com/bage/AppTest.java @@ -0,0 +1,20 @@ +package com.bage; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Unit test for simple App. + */ +public class AppTest +{ + /** + * Rigorous Test :-) + */ + @Test + public void shouldAnswerWithTrue() + { + assertTrue( true ); + } +} diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 2fad02926..36cf2f2f9 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -2,6 +2,9 @@ https://www.bilibili.com/video/BV1nK4y1H7g9?p=50 +线程池 +https://www.bilibili.com/video/BV1nK4y1H7g9?p=58 + ## 总结 MySQL From 0478308fea44e7cf8f8449b01f771620f25ea102 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sun, 26 Dec 2021 23:46:59 +0800 Subject: [PATCH 053/129] progress update --- study-summary/README-bilibili.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 36cf2f2f9..ce195c626 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -5,6 +5,8 @@ https://www.bilibili.com/video/BV1nK4y1H7g9?p=50 线程池 https://www.bilibili.com/video/BV1nK4y1H7g9?p=58 +Spring +hhttps://www.bilibili.com/video/BV1nK4y1H7g9?p=66&spm_id_from=pageDriver ## 总结 MySQL From 607c7aefebb68cfcec9a7484010a1a6b9e6aa255 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Mon, 27 Dec 2021 19:27:37 +0800 Subject: [PATCH 054/129] Update README-bilibili.md --- study-summary/README-bilibili.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index ce195c626..d16a5e1f8 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -10,11 +10,19 @@ hhttps://www.bilibili.com/video/BV1nK4y1H7g9?p=66&spm_id_from=pageDriver ## 总结 MySQL -1、 索引、联合索引 +1、 索引、联合索引 2、 log日志 3、 版本控制 4、 +Java 锁 +自旋锁 》 偏向锁 》 重量锁 + +Java 线程池 +优化?? +注意事项 + + # 常用链接 From 4bc006f0adddc2c50a9b4d1528107ad64ad57a64 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 29 Dec 2021 21:19:54 +0800 Subject: [PATCH 055/129] Update README-bilibili.md --- study-summary/README-bilibili.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index d16a5e1f8..5b704e414 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -5,8 +5,12 @@ https://www.bilibili.com/video/BV1nK4y1H7g9?p=50 线程池 https://www.bilibili.com/video/BV1nK4y1H7g9?p=58 -Spring -hhttps://www.bilibili.com/video/BV1nK4y1H7g9?p=66&spm_id_from=pageDriver +Spring 手写 +https://www.bilibili.com/video/BV1nK4y1H7g9?p=68&spm_id_from=pageDriver + +常用点 +https://www.bilibili.com/video/BV1V44y1i7L8?p=2 + ## 总结 MySQL From 1abde75e40115fbc0c18ed5366f203aee7774f15 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Thu, 30 Dec 2021 00:30:54 +0800 Subject: [PATCH 056/129] =?UTF-8?q?bean=20=E7=94=9F=E5=91=BD=E5=91=A8?= =?UTF-8?q?=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- study-summary/README-bilibili.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 5b704e414..0b8d34148 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,5 +1,9 @@ # 进度备忘 + +Spring 生命周期 +https://www.bilibili.com/video/BV1nK4y1H7g9?p=69&spm_id_from=pageDriver + https://www.bilibili.com/video/BV1nK4y1H7g9?p=50 线程池 From 7d1bad4f7b2d603b45901134fdeccac556c28a84 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Fri, 31 Dec 2021 01:14:24 +0800 Subject: [PATCH 057/129] duration --- .../bage/study/java/java8/DurationTest.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 study-java/src/main/java/com/bage/study/java/java8/DurationTest.java diff --git a/study-java/src/main/java/com/bage/study/java/java8/DurationTest.java b/study-java/src/main/java/com/bage/study/java/java8/DurationTest.java new file mode 100644 index 000000000..3c84f9caf --- /dev/null +++ b/study-java/src/main/java/com/bage/study/java/java8/DurationTest.java @@ -0,0 +1,28 @@ +package com.bage.study.java.java8; + +import java.time.Duration; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.Period; + +/** + * Java 8的新特性 + * @author bage + * + */ +public class DurationTest { + + + public static void main(String[] args) { + LocalDateTime now = LocalDateTime.now(); + LocalDate now2 = LocalDate.now(); + + System.out.println(Duration.between(now, now.plusHours(2)).toString()); + System.out.println(Duration.between(now, now.plusDays(10)).toString()); + System.out.println(Duration.between(now, now.plusMinutes(2)).toString()); + + + System.out.println(Period.between(now2, now2.plusDays(10)).toString()); + + } +} From 73990db57dd00af3e0a159e945b25c37965d5a2c Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Fri, 7 Jan 2022 14:00:50 +0800 Subject: [PATCH 058/129] Update README.md --- study-flutter/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/study-flutter/README.md b/study-flutter/README.md index e3c417870..171ff987b 100644 --- a/study-flutter/README.md +++ b/study-flutter/README.md @@ -6,7 +6,8 @@ D:\softwares\SDK\emulator\emulator -avd Pixel2XLAPI29 -dns-server 10.0.3.2 flutter build apk --no-sound-null-safety ``` - +盛情域名??? +服务器 ?? ## Flutter 入门 From c32a7b357fcac9260faac9af60362cd8be5ee1ae Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Mon, 10 Jan 2022 17:06:57 +0800 Subject: [PATCH 059/129] Create PeriodTest.java --- .../com/bage/study/java/java8/PeriodTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 study-java/src/main/java/com/bage/study/java/java8/PeriodTest.java diff --git a/study-java/src/main/java/com/bage/study/java/java8/PeriodTest.java b/study-java/src/main/java/com/bage/study/java/java8/PeriodTest.java new file mode 100644 index 000000000..75307b0f0 --- /dev/null +++ b/study-java/src/main/java/com/bage/study/java/java8/PeriodTest.java @@ -0,0 +1,19 @@ +package com.bage.study.java.java8; + +import java.time.LocalDate; +import java.time.Period; + +/** + * @author bage + * + */ +public class PeriodTest { + + + public static void main(String[] args) { + LocalDate now = LocalDate.now(); + + System.out.println(Period.between(now, now.plusDays(2)).toString()); + + } +} From 9010cf8b6bbd358c3a9b7cd8afb8a14f791fc652 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Mon, 17 Jan 2022 23:17:40 +0800 Subject: [PATCH 060/129] Update README-bilibili.md --- study-summary/README-bilibili.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 0b8d34148..bc2de072c 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,5 +1,8 @@ # 进度备忘 +Spring AoP + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=74 Spring 生命周期 https://www.bilibili.com/video/BV1nK4y1H7g9?p=69&spm_id_from=pageDriver From bb5fb4b6c4f09b59a6006aa5efd7fd3e193c54df Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Tue, 18 Jan 2022 00:05:07 +0800 Subject: [PATCH 061/129] Update README-bilibili.md --- study-summary/README-bilibili.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index bc2de072c..8050e8f38 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -2,6 +2,8 @@ Spring AoP +https://www.bilibili.com/video/BV1nK4y1H7g9?p=77&spm_id_from=pageDriver + https://www.bilibili.com/video/BV1nK4y1H7g9?p=74 Spring 生命周期 @@ -33,6 +35,8 @@ Java 线程池 优化?? 注意事项 +条件短点 + # 常用链接 From 6ae563c0facd27a8ab502d4e9bf51c26f902736b Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Tue, 18 Jan 2022 22:07:24 +0800 Subject: [PATCH 062/129] debug --- .../com/bage/study/java/debug/DebugTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 study-java/src/main/java/com/bage/study/java/debug/DebugTest.java diff --git a/study-java/src/main/java/com/bage/study/java/debug/DebugTest.java b/study-java/src/main/java/com/bage/study/java/debug/DebugTest.java new file mode 100644 index 000000000..5db740bb5 --- /dev/null +++ b/study-java/src/main/java/com/bage/study/java/debug/DebugTest.java @@ -0,0 +1,19 @@ +package com.bage.study.java.debug; + +public class DebugTest { + + public static void main(String[] args) { + + int n = 10; + for (int i = 0; i < n; i++) { + System.out.println(i); + // debug + // 先 选好 断点 + // 在 右键 断点 + // 设置停留条件即可 + } + System.out.println("end "); + + } + +} From f0409c1afddfa1b0a93c23333c73b3e114f19d27 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 19 Jan 2022 00:07:10 +0800 Subject: [PATCH 063/129] jdk proxy --- .../com/bage/study/java/proxy/JdkProxyTest.java | 14 ++++++++++++++ study-summary/README-bilibili.md | 6 ++++++ 2 files changed, 20 insertions(+) create mode 100644 study-java/src/main/java/com/bage/study/java/proxy/JdkProxyTest.java diff --git a/study-java/src/main/java/com/bage/study/java/proxy/JdkProxyTest.java b/study-java/src/main/java/com/bage/study/java/proxy/JdkProxyTest.java new file mode 100644 index 000000000..029179f61 --- /dev/null +++ b/study-java/src/main/java/com/bage/study/java/proxy/JdkProxyTest.java @@ -0,0 +1,14 @@ +package com.bage.study.java.proxy; + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Proxy; + +public class JdkProxyTest { + + public static void main(String[] args) { + + + + } + +} diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 8050e8f38..34c3172af 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,5 +1,11 @@ # 进度备忘 +Spring MVC + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=90&spm_id_from=pageDriver + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=89 + Spring AoP https://www.bilibili.com/video/BV1nK4y1H7g9?p=77&spm_id_from=pageDriver From db4413eeae5f37d6b4c6ca229a70bc3cc60eca29 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Fri, 21 Jan 2022 16:16:04 +0800 Subject: [PATCH 064/129] Update README.md --- study-summary/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/study-summary/README.md b/study-summary/README.md index a1f516dc7..ba9fa82e6 100644 --- a/study-summary/README.md +++ b/study-summary/README.md @@ -10,6 +10,8 @@ Cauch 教练管理方式 裸心会 调查问卷 +代理: https://blog.csdn.net/lx1315998513/article/details/120641124 + ## 常用连接 https://github.com/0voice/interview_internal_reference From 104882e5dfcedf67a3dd7eabe98a6409adca54b6 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Mon, 24 Jan 2022 21:53:02 +0800 Subject: [PATCH 065/129] Update JdkProxyTest.java --- .../src/main/java/com/bage/study/java/proxy/JdkProxyTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/study-java/src/main/java/com/bage/study/java/proxy/JdkProxyTest.java b/study-java/src/main/java/com/bage/study/java/proxy/JdkProxyTest.java index 029179f61..4f437ca1e 100644 --- a/study-java/src/main/java/com/bage/study/java/proxy/JdkProxyTest.java +++ b/study-java/src/main/java/com/bage/study/java/proxy/JdkProxyTest.java @@ -6,7 +6,7 @@ public class JdkProxyTest { public static void main(String[] args) { - + } From bbf5e4b68884a66cf4a68af77ca2f296a11d0973 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 26 Jan 2022 10:25:16 +0800 Subject: [PATCH 066/129] dubbo --- .DS_Store | Bin 18436 -> 18436 bytes study-summary/README-bilibili.md | 10 ++++++++++ 2 files changed, 10 insertions(+) diff --git a/.DS_Store b/.DS_Store index 8766ed7198ca0444a983381bf7eb0348c9ecff4a..2905081272bad8e875519abba089c77c8b96ce79 100644 GIT binary patch delta 26 hcmZpfz}PZ@af6Z+yP2tuf{~%+WE)+_%~?{jbOC5y2dn@9 delta 22 dcmZpfz}PZ@af6c7WCfkD$=;H@n_H#obpcm=2TlM0 diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 34c3172af..3a7acc824 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,7 +1,17 @@ # 进度备忘 +dubbo + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=137&spm_id_from=pageDriver + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=134 + + + Spring MVC +https://www.bilibili.com/video/BV1nK4y1H7g9?p=91&spm_id_from=pageDriver + https://www.bilibili.com/video/BV1nK4y1H7g9?p=90&spm_id_from=pageDriver https://www.bilibili.com/video/BV1nK4y1H7g9?p=89 From 7a586762ee916532afb85dbb040b9e248de5c065 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Tue, 1 Feb 2022 21:54:01 +0800 Subject: [PATCH 067/129] dubbo --- study-summary/README-bilibili.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 3a7acc824..734b3e70c 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -2,6 +2,8 @@ dubbo +https://www.bilibili.com/video/BV1nK4y1H7g9?p=138&spm_id_from=pageDriver + https://www.bilibili.com/video/BV1nK4y1H7g9?p=137&spm_id_from=pageDriver https://www.bilibili.com/video/BV1nK4y1H7g9?p=134 From 483f07e3e918f9c5311a1bb31b7bfc1860496d79 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 2 Feb 2022 21:59:46 +0800 Subject: [PATCH 068/129] =?UTF-8?q?=E5=88=86=E5=B8=83=E5=BC=8F=20=E4=BA=8B?= =?UTF-8?q?=E7=89=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- study-summary/README-bilibili.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 734b3e70c..0521dff07 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,7 +1,15 @@ # 进度备忘 +分布式事务 + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=148 + dubbo +https://www.bilibili.com/video/BV1nK4y1H7g9?p=142&spm_id_from=pageDriver + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=140&spm_id_from=pageDriver + https://www.bilibili.com/video/BV1nK4y1H7g9?p=138&spm_id_from=pageDriver https://www.bilibili.com/video/BV1nK4y1H7g9?p=137&spm_id_from=pageDriver From 4421f259cd408b64733154228e88d36e7a10e942 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Thu, 3 Feb 2022 12:16:02 +0800 Subject: [PATCH 069/129] =?UTF-8?q?=E5=88=86=E5=B8=83=E5=BC=8FID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- study-summary/README-bilibili.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 0521dff07..5b7e9f05c 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,10 +1,14 @@ # 进度备忘 -分布式事务 +分布式ID + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=154 + +分布式事务【未完成】 https://www.bilibili.com/video/BV1nK4y1H7g9?p=148 -dubbo +dubbo【暂时段落】 https://www.bilibili.com/video/BV1nK4y1H7g9?p=142&spm_id_from=pageDriver From c4a8cec8a68828038835a7a83322846628f778e5 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Fri, 4 Feb 2022 16:22:43 +0800 Subject: [PATCH 070/129] Update README-bilibili.md --- study-summary/README-bilibili.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 5b7e9f05c..237e75d7a 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,5 +1,9 @@ # 进度备忘 +Spring Cloud + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=165 + 分布式ID https://www.bilibili.com/video/BV1nK4y1H7g9?p=154 From 9e54f3e93ccb9131c5343013576927983ade0b43 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Mon, 7 Feb 2022 11:20:55 +0800 Subject: [PATCH 071/129] Update README-bilibili.md --- study-summary/README-bilibili.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 237e75d7a..94343d31b 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,5 +1,11 @@ # 进度备忘 +JVM + +https://www.bilibili.com/video/BV1r3411Y7fd?spm_id_from=333.851.b_7265636f6d6d656e64.4 + + + Spring Cloud https://www.bilibili.com/video/BV1nK4y1H7g9?p=165 From c2a58393ff0cddea68b5b8f41dbbe9a68954fdc1 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 9 Feb 2022 22:24:54 +0800 Subject: [PATCH 072/129] tomcat --- .DS_Store | Bin 18436 -> 18436 bytes study-summary/README-bilibili.md | 4 ++++ 2 files changed, 4 insertions(+) diff --git a/.DS_Store b/.DS_Store index 2905081272bad8e875519abba089c77c8b96ce79..8766ed7198ca0444a983381bf7eb0348c9ecff4a 100644 GIT binary patch delta 22 dcmZpfz}PZ@af6c7WCfkD$=;H@n_H#obpcm=2TlM0 delta 26 hcmZpfz}PZ@af6Z+yP2tuf{~%+WE)+_%~?{jbOC5y2dn@9 diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 94343d31b..2689f81c2 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,5 +1,9 @@ # 进度备忘 +Tomcat + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=20 + JVM https://www.bilibili.com/video/BV1r3411Y7fd?spm_id_from=333.851.b_7265636f6d6d656e64.4 From a18c4f1bf2f535688484291aa7cd7712d90199d6 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Thu, 10 Feb 2022 00:06:15 +0800 Subject: [PATCH 073/129] Update README-bilibili.md --- study-summary/README-bilibili.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 2689f81c2..f10aee09e 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -2,6 +2,10 @@ Tomcat +https://www.bilibili.com/video/BV1nK4y1H7g9?p=25&spm_id_from=pageDriver + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=24&spm_id_from=pageDriver + https://www.bilibili.com/video/BV1nK4y1H7g9?p=20 JVM From 1ad21e3269f74ca9981dbba753bc3f54c3b257cf Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Fri, 11 Feb 2022 00:24:37 +0800 Subject: [PATCH 074/129] servlet --- pom.xml | 1 + study-servlet/pom.xml | 88 +++++++++++++++++++ study-servlet/src/main/java/com/bage/App.java | 13 +++ .../src/main/java/com/bage/HelloServlet.java | 27 ++++++ .../src/test/java/com/bage/AppTest.java | 20 +++++ 5 files changed, 149 insertions(+) create mode 100644 study-servlet/pom.xml create mode 100644 study-servlet/src/main/java/com/bage/App.java create mode 100644 study-servlet/src/main/java/com/bage/HelloServlet.java create mode 100644 study-servlet/src/test/java/com/bage/AppTest.java diff --git a/pom.xml b/pom.xml index a46c2b5ed..2b5bb9b34 100644 --- a/pom.xml +++ b/pom.xml @@ -150,6 +150,7 @@ study-java-agent-instrument untitled study-jol + study-servlet \ No newline at end of file diff --git a/study-servlet/pom.xml b/study-servlet/pom.xml new file mode 100644 index 000000000..9cbf20ed1 --- /dev/null +++ b/study-servlet/pom.xml @@ -0,0 +1,88 @@ + + + + + study + com.bage + 0.0.1-SNAPSHOT + + 4.0.0 + + study-servlet + + study-servlet + http://www.example.com + + + UTF-8 + 1.8 + 1.8 + + + + + junit + junit + 4.11 + test + + + + + javax.servlet + servlet-api + 3.0-alpha-1 + provided + + + + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + + + diff --git a/study-servlet/src/main/java/com/bage/App.java b/study-servlet/src/main/java/com/bage/App.java new file mode 100644 index 000000000..65b45b532 --- /dev/null +++ b/study-servlet/src/main/java/com/bage/App.java @@ -0,0 +1,13 @@ +package com.bage; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/study-servlet/src/main/java/com/bage/HelloServlet.java b/study-servlet/src/main/java/com/bage/HelloServlet.java new file mode 100644 index 000000000..bdd283c84 --- /dev/null +++ b/study-servlet/src/main/java/com/bage/HelloServlet.java @@ -0,0 +1,27 @@ +package com.bage; + +import javax.servlet.ServletException; +import javax.servlet.SingleThreadModel; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * SingleThreadModel 支持每个请求单独一个类实现, 不过不推荐 + */ + +public class HelloServlet extends HttpServlet implements SingleThreadModel { + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + + System.out.println("HelloServlet xxxx"); + + } + + @Override + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + super.doGet(req, resp); + } +} diff --git a/study-servlet/src/test/java/com/bage/AppTest.java b/study-servlet/src/test/java/com/bage/AppTest.java new file mode 100644 index 000000000..9216cfd04 --- /dev/null +++ b/study-servlet/src/test/java/com/bage/AppTest.java @@ -0,0 +1,20 @@ +package com.bage; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Unit test for simple App. + */ +public class AppTest +{ + /** + * Rigorous Test :-) + */ + @Test + public void shouldAnswerWithTrue() + { + assertTrue( true ); + } +} From 2e930185618ce134f9c321231d6cb9844b193cfc Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sat, 12 Feb 2022 22:47:12 +0800 Subject: [PATCH 075/129] tomcat --- study-summary/README-bilibili.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index f10aee09e..0b44a14c7 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -2,6 +2,8 @@ Tomcat +https://www.bilibili.com/video/BV1nK4y1H7g9?p=27&spm_id_from=pageDriver + https://www.bilibili.com/video/BV1nK4y1H7g9?p=25&spm_id_from=pageDriver https://www.bilibili.com/video/BV1nK4y1H7g9?p=24&spm_id_from=pageDriver From 10629d88fc069170c67047b1139f5dd01d38b199 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 16 Feb 2022 17:33:19 +0800 Subject: [PATCH 076/129] sso --- .DS_Store | Bin 18436 -> 20484 bytes study-java/.DS_Store | Bin 0 -> 6148 bytes .../readme-sso.md | 384 ++++++++++++++++++ 3 files changed, 384 insertions(+) create mode 100644 study-java/.DS_Store create mode 100644 study-spring-boot-sso-oauth2-server/readme-sso.md diff --git a/.DS_Store b/.DS_Store index 8766ed7198ca0444a983381bf7eb0348c9ecff4a..38feefa1305dd562b473cf007a49f24eeb686ee3 100644 GIT binary patch delta 663 zcmZpfz}T{YQHFtmfzhcn#gKu)1IXk6Vh}CB!@$7AIZ?(~bUu*B3KU>qC}l`tsASM( z$YLniEXcH&ak7C63oA2Fnq~4qJxxZ|$vJ{PlP75Ra~N4#=qMPO8cep)b!24&DiE41 zARs-tTuhZaCqD^fI?(X+$q9m{lV1xdZ5Co;V%f~j!NS2PyLpb-cE-uOMFb|ZOXvd4 zx-t2?xGhgva8X`PeqK6IC*$S-iHnRVHf+w4TFAOtfk~g0(QGr1LL%2>ZY4hUEQUme zGKNHu8H!vC#SA4#&Iik&7@DOO#WJzPjM04ZbG`eM@5t~?R%BEG(ac#4<&*ogC$XD@ zykuw&^im*yIYSAGZXN?h?#WNZWG34S@l4KVRG56&N@KIBzX}jR3M9 zpjX6!fug$kui!t%$y0^h!2xG(Xs)ARXlV!vI7VfV{N&xjis%~EVG@&_MARq$7WT&o zbVj%m32=O&IT&cUB-rwPk&}#*kDDr~07ck=7zjMLfrKk80WdHq026`%5Ib-Kwtp^fU~09%F0tBlGvUy@*A+sw|v!ojGwIp6jK z8ZLZS}XPGR_q&At~ z;LgM{S4OSP>PC#*o8@%2Gb4l@W!Zo(1Of+cAmIx0Ap?T~(5D7Gn*~{3Gf(FCu>^$& d10w?i$Y&rL=yfm$6fho>6MSZFmM~{$1^{TENVWg~ diff --git a/study-java/.DS_Store b/study-java/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ce9e716a9297cb86d7ddb4ef5a3abc5bde4760ff GIT binary patch literal 6148 zcmeHK%}xR_5N-jrV2m70vErCU%h}qZBH}VO5 z9cS8NBy#X%jLanMH`AGEcfMr%!x-bOaad!l%or2U5IHJK1c#TpayA%|;~b+w5UT*J zw_sp>e;x4K^DJbF-2{`b-ycV#)N$TiCN?WCCudgOv>ZjvT%O75%b?T@6 z!0Km8#hQS6i}(`l{I ztjc=hU{;mWX5FdEeWy8_6~*pe?eL^~_wYD>`l z%%kT~gv0{Z<~HwGvtv8Vbf`sDOaJa0vhd h_mPTr8oxvx;#`ZFL7WB0bvhtj1T-Pk5d*)#zz5W&PqzR7 literal 0 HcmV?d00001 diff --git a/study-spring-boot-sso-oauth2-server/readme-sso.md b/study-spring-boot-sso-oauth2-server/readme-sso.md new file mode 100644 index 000000000..c60e916fc --- /dev/null +++ b/study-spring-boot-sso-oauth2-server/readme-sso.md @@ -0,0 +1,384 @@ +# SSO # + + + +## 基本概念 ## + +### 什么是SSO ### +登陆 + +认证 + +授权 + +Single Sign On,单点登录,一次登录,处处【子系统】登录 + + + +### OAuth2.0相关概念 ### + +#### 四个职责划分 #### +- resource owner + + An entity capable of granting access to a protected resource. + When the resource owner is a person, it is referred to as an + end-user. + +- resource server + + The server hosting the protected resources, capable of accepting + and responding to protected resource requests using access tokens. + +- client + + An application making protected resource requests on behalf of the + resource owner and with its authorization. The term "client" does + not imply any particular implementation characteristics (e.g., + whether the application executes on a server, a desktop, or other + devices). + +- authorization server + + The server issuing access tokens to the client after successfully + authenticating the resource owner and obtaining authorization. + +#### 四种模式 #### +- 授权码模式 +老大,666,不会错 +- 密码模式 +传密码,不提倡 +- 简化模式 +不经过client的server端,用户透明,不建议 +- 客户端模式 +client + secret,不细化到用户,不会用 + +## 背景 ## +- 单体应用逐渐不能满足要求 +- 企业内部独立服务众多与统一账号管理存在矛盾 +- 集群以及多系统登录复杂性 + +## 实现方案 ## +### 自实现 ### +- 独立自主完成,全部自己实现一个单点登录 +### CAS ### +Central Authentication Service,耶鲁大学的统一鉴权服务 + +#### 优点 #### +- 开源,可定制化 +- Spring Webflow/Spring Boot Java server component +- 多种认证支持 (LDAP, Database, X.509, SPNEGO, JAAS, JWT, RADIUS, MongoDb, etc) +- 多种协议支持 (CAS, SAML, WS-Federation, OAuth2, OpenID, OpenID Connect, REST) +- 实时监控和跟踪应用程序行为,统计信息和日志。 +- 跨平台的客户端支持 (Java, .Net, PHP, Perl, Apache, etc) + +#### 不足 #### +- 基于cookie +- 客户端管理问题? + +#### 核心 #### +- CAS Server + TicketGrantingTicketCheckAction 校验ticket + AcceptUsersAuthenticationHandler 校验用户登录 +- CAS Clients + AuthenticationFilter 核心入口,校验登录 + 重定向等 + AbstractTicketValidationFilter(AuthenticationFilter调用) 校验ticket + CasHttpServletRequestWrapper + +#### 认证流程 #### +![Web flow diagram](https://apereo.github.io/cas/4.2.x/images/cas_flow_diagram.png) + +### Spring OAuth2.0 ### +Spring 的,基于 OAuth2.0 协议的, SSO实现方案 + +#### 优点 #### +- Spring 全家桶之一,与Spring配合默契,喜欢的样子它都有 +- 客户端统一管理 零成本 + +#### 不足 #### +- OAuth2.0 的Java 应用客户端 + +#### 核心 #### +- Spring Security + 实现 *AuthenticationProvider* 用户登录验证 + 实现 *UserDetailsService* 用户loadUserByUsername + 集成 *WebSecurityConfigurerAdapter* 装配 自定义用户登录验证 + URL Pattern +- Spring 集成 OAuth2.0 + *AuthorizationEndpoint* 认证登录 + *TokenEndpoint* 验证Token + *OAuth2AuthenticationProcessingFilter* is used to load the Authentication for the request given an authenticated access token. + + *ClientDetailsServiceConfigurer* 客户端信息配置 + *AuthorizationServerSecurityConfigurer*: defines the security constraints on the token endpoint. + *AuthorizationServerEndpointsConfigurer*: defines the authorization and token endpoints and the token services. + +#### 认证流程 #### +授权码模式 + + +--------+ +---------------+ + | |--(A)- Authorization Request ->| Resource | + | | | Owner | + | |<-(B)-- Authorization Grant ---| | + | | +---------------+ + | | + | | +---------------+ + | |--(C)-- Authorization Grant -->| Authorization | + | Client | | Server | + | |<-(D)----- Access Token -------| | + | | +---------------+ + | | + | | +---------------+ + | |--(E)----- Access Token ------>| Resource | + | | | Server | + | |<-(F)--- Protected Resource ---| | + +--------+ +---------------+ + + Figure 1: Abstract Protocol Flow + + 用户访问受保护资源,客户端验证用户登录状态,未登录,则进入步骤A + + (A) 客户端请求用户给予授权,页面跳转到登录页面,用户输入用户名、密码进行登录,登录成功后,则进入步骤B + + (B) 授权后,返回一个code + state(可选),进入步骤C + + (C) 客户端拿到授权码,凭借授权码code请求授权中心验证,进入步骤D + + (D) 若验证成功,则返回AccessToken.则进入步骤E + + (E) 客户端拿到AccessToken,带上,请求受保护资源. + + (F) 资源服务器验证token合法,则返回受保护的资源. + + + +### Spring OAuth2.0 SSO ### + +服务端-拦截规则 + +```java + @Override +protected void configure(HttpSecurity http) throws Exception { + http.authorizeRequests() + .antMatchers("/oauth/**","/login/**", "/logout").permitAll() + .anyRequest().authenticated() // 其他地址的访问均需验证权限 + .and() + .formLogin() + .loginPage("/login") + .and() + .logout().logoutSuccessUrl("/"); +} +``` +服务端-资源路径 + + @Override + public void configure(HttpSecurity http) throws Exception { + http.requestMatchers().antMatchers("/user/**") + .and() + .authorizeRequests() + .anyRequest().authenticated(); + } +服务端-客户端列表 + +```java +@Override +public void configure(ClientDetailsServiceConfigurer clients) throws Exception { + clients.jdbc(dataSource); + /* + clients.inMemory() + .withClient("sampleClientId") + .secret(passwordEncoder.encode("secret")) + .authorizedGrantTypes("authorization_code") + .scopes("user_info") + .autoApprove(true) + .redirectUris("http://localhost:8001/client1/login") + // .accessTokenValiditySeconds(3600) + ; // 1 hour +*/ +} +``` + +SQL + +```sql +INSERT INTO oauth_client_details + (client_id, client_secret, scope, authorized_grant_types, + web_server_redirect_uri, authorities, access_token_validity, + refresh_token_validity, additional_information, autoapprove) +VALUES + ('sampleClientId', '$2a$10$i7bPh8Npg8lsUTxOAwp7suAwMxTw8tNyRkvDJT8/uZGcSzdFocHS6', 'user_info', + 'password,authorization_code,refresh_token,client_credentials', 'http://localhost:8001/client1/login,http://localhost:8002/client2/login', null, 36000, 36000, null, true); +``` +客户端- application.yml + +```yml +server: + port: 8001 + servlet: + context-path: /client1 + +security: + oauth2: + client: + client-id: sampleClientId + client-secret: secret + access-token-uri: http://localhost:8080/oauth/token + user-authorization-uri: http://localhost:8080/oauth/authorize + resource: + user-info-uri: http://localhost:8080/user/me +``` + 客户端-拦截规则 + +```java +@EnableOAuth2Sso +@Configuration +@EnableGlobalMethodSecurity(prePostEnabled = true) +public class ClientSecurityConfig extends WebSecurityConfigurerAdapter { + @Override + public void configure(HttpSecurity http) throws Exception { + http.antMatcher("/**") + .authorizeRequests() + .antMatchers("/", "/login**", "/webjars/**", "/error**").permitAll() + .anyRequest() + .authenticated() + .and().logout().logoutSuccessUrl("/") + .and().csrf() + .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()); + ; + } +} +``` +完整代码 + + +- Auth Server [https://github.com/bage2014/study/tree/master/study-spring-boot-sso-oauth2-server](https://github.com/bage2014/study/tree/master/study-spring-boot-sso-oauth2-server) +- Client [https://github.com/bage2014/study/tree/master/study-spring-boot-sso-oauth2-client1](https://github.com/bage2014/study/tree/master/study-spring-boot-sso-oauth2-client1) + +Ctrip SSO [http://git.ctripcorp.com/global-rail-gds/gds-admin-application](http://git.ctripcorp.com/global-rail-gds/gds-admin-application) + +### JWT ### +核心实现 + +1. 登录过程 + + public String login(HttpServletRequest request){ + + String account = request.getParameter("account"); + Map map = new HashMap(); + map.put("account", account); + map.put("password", request.getParameter("password")); + map = userService.query(map); + + if(map != null ) { //登录成功 + + Key key = MacProvider.generateKey(); + Map cliams = new HashMap(); + cliams.put("jti", String.valueOf(System.currentTimeMillis())); + String jws = Jwts.builder() + .setClaims(cliams ) + .setIssuer("com.bage") // iss: 该JWT的签发者,是否使用是可选的 + .setSubject(account) // sub: 该JWT所面向的用户,是否使用是可选的; + //.setAudience(aud) // aud: 接收该JWT的一方,是否使用是可选的 + .setExpiration(DateUtils.getJwtsExpirationDate()) // exp(expires): 什么时候过期,这里是一个Unix时间戳,是否使用是可选的 + .setIssuedAt(DateUtils.now()) // iat(issued at): 在什么时候签发的(UNIX时间),是否使用是可选的 + //.setNotBefore(DateUtils.getNotBeforeDate()) // nbf (Not Before):如果当前时间在nbf里的时间之前,则Token不被接受;一般都会留一些余地,比如几分钟;是否使用是可选的 + .signWith(SignatureAlgorithm.HS512, key) + .compact(); + + System.out.println("jws:" + jws); + + RedisUtils.put(Constants.redis_key_jwt + "_" + account, jws); + RedisUtils.put(Constants.redis_key_jwtkey + "_" + account, key); + + map = new HashMap(); + map.put("jws", jws); + map.put("now", DateUtils.now()); + map.put("expirationDate", DateUtils.getJwtsExpirationDate()); + + return JsonUtils.toJson(map); + + } else { // 登录失败 + return ""; + } + } +2. 校验逻辑 + +```java +if(!isExcludeUri(request)) { + String claimsJws = request.getHeader("Authorization"); + System.out.println("参数compactJws:" + claimsJws); + // 签名验证 + try { + Claims claims = JwtsBuilder.decodeTokenClaims(claimsJws); + String subject = claims.getSubject(); + Key key = (Key) RedisUtils.get(Constants.redis_key_jwt + "_" + subject); + Jws jws = Jwts.parser().setSigningKey(key).parseClaimsJws(claimsJws); + System.out.println("jti:" + jws.getBody().get("jti")); + String currentCompactJws = RedisUtils.getString(Constants.redis_key_jwt + "_" + subject); + if(currentCompactJws == null || !currentCompactJws.equals(claimsJws)) { + System.out.println("签名不合法:\ncompactJws:" + claimsJws); + System.out.println("currentCompactJws:" + currentCompactJws); + checkJwtFail(request, response); + return ; + } + } catch (Exception e) { + e.printStackTrace(); + System.out.println("解析签名报错"); + checkJwtFail(request, response); + return ; + } + } + + chain.doFilter(request, response); +``` + +3. 区分请求类型 + +```java +private void checkJwtFail(HttpServletRequest request,HttpServletResponse response) { + try { + String requestType = request.getHeader("X-Requested-With"); + if("XMLHttpRequest".equals(requestType)){ // TODO 增加跨域请求校验 + System.out.println("AJAX请求.."); + response.getWriter().print("Authorization Failed"); + }else{ + System.out.println("非AJAX请求.."); + response.sendRedirect(request.getServletContext().getContextPath() + "/"); + //此时requestType为null + } + //request.getSession().removeAttribute(Constants.session_attribute_currentuser); + } catch (IOException e) { + e.printStackTrace(); + } +} +``` + +完整代码 + +单体应用 [https://github.com/bage2014/study/tree/master/study-jwt](https://github.com/bage2014/study/tree/master/study-jwt) + +## 总结 ## + +### SSO的本质 ### +- 共享登录信息(共用Session || JWT) +- 认证中心 + 客户端模式 + +### oauth2.0 与 SSO 的关系 ### +- Oauth2.0 是 一种协议,SSO是 一个功能 +- SSO可以基于 OAuth 2.0协议实现 +- Oauth2.0可以用于其他功能,比如资源授权 +### SSO实现方案的抉择 ### +- 合适的就是最好的 +- 企业之间 || Restful,推荐 Spring OAuth2.0 +### Spring OAuth2.0 JWT ### +- Session 弱化场景 +- 防重放 +- JWT失效时间控制 + +## 参考链接 ## +- 单点登录 CAS 官网 [https://www.apereo.org/projects/cas](https://www.apereo.org/projects/cas) +- cas 文档 [https://apereo.github.io/cas/4.2.x/index.html](https://apereo.github.io/cas/4.2.x/index.html) +- cas github地址 [https://github.com/apereo/cas](https://github.com/apereo/cas) +- CAS 登录过程源码解析 [https://segmentfault.com/a/1190000014001205?utm_source=channel-hottest](https://segmentfault.com/a/1190000014001205?utm_source=channel-hottest) +- Oauth2.0协议 [http://www.rfcreader.com/#rfc6749](http://www.rfcreader.com/#rfc6749) +- 阮一峰 理解OAuth 2.0 [http://www.ruanyifeng.com/blog/2014/05/oauth_2_0.html](http://www.ruanyifeng.com/blog/2014/05/oauth_2_0.html) +- Spring OAuth 2.0 官网 [https://projects.spring.io/spring-security-oauth/docs/oauth2.html](https://projects.spring.io/spring-security-oauth/docs/oauth2.html) +- 携程单点登录接入Conf [http://conf.ctripcorp.com/pages/viewpage.action?pageId=157466083](http://conf.ctripcorp.com/pages/viewpage.action?pageId=157466083)、[http://conf.ctripcorp.com/pages/viewpage.action?pageId=135658955](http://conf.ctripcorp.com/pages/viewpage.action?pageId=135658955) From 5fa3c62554b6eae1921cf2e07beedbfb6a3690c1 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Wed, 16 Feb 2022 17:34:10 +0800 Subject: [PATCH 077/129] Update .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b16b59ea8..f2645a07f 100644 --- a/.gitignore +++ b/.gitignore @@ -44,4 +44,4 @@ buildNumber.properties *.iml out gen -study-summary/.DS_Store +*/.DS_Store From 35bad92b919312202894f527b2d27c9734ca1fa5 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Thu, 17 Feb 2022 00:02:03 +0800 Subject: [PATCH 078/129] alibaba --- study-summary/README-bilibili.md | 40 +++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 0b44a14c7..21492804d 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,5 +1,31 @@ # 进度备忘 +Spring Cloud + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=170&spm_id_from=pageDriver + +Spring Cloud Nacos + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=167&spm_id_from=pageDriver + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=165 + + + +dubbo【暂时段落】 + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=142&spm_id_from=pageDriver + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=140&spm_id_from=pageDriver + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=138&spm_id_from=pageDriver + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=137&spm_id_from=pageDriver + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=134 + + + Tomcat https://www.bilibili.com/video/BV1nK4y1H7g9?p=27&spm_id_from=pageDriver @@ -16,9 +42,7 @@ https://www.bilibili.com/video/BV1r3411Y7fd?spm_id_from=333.851.b_7265636f6d6d65 -Spring Cloud -https://www.bilibili.com/video/BV1nK4y1H7g9?p=165 分布式ID @@ -28,18 +52,6 @@ https://www.bilibili.com/video/BV1nK4y1H7g9?p=154 https://www.bilibili.com/video/BV1nK4y1H7g9?p=148 -dubbo【暂时段落】 - -https://www.bilibili.com/video/BV1nK4y1H7g9?p=142&spm_id_from=pageDriver - -https://www.bilibili.com/video/BV1nK4y1H7g9?p=140&spm_id_from=pageDriver - -https://www.bilibili.com/video/BV1nK4y1H7g9?p=138&spm_id_from=pageDriver - -https://www.bilibili.com/video/BV1nK4y1H7g9?p=137&spm_id_from=pageDriver - -https://www.bilibili.com/video/BV1nK4y1H7g9?p=134 - Spring MVC From 7bb571d8eb3273fc840ebac38948b0eac4ec3ccf Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Fri, 18 Feb 2022 01:07:06 +0800 Subject: [PATCH 079/129] alibaba --- .DS_Store | Bin 20484 -> 20484 bytes .gitignore | 1 + study-summary/README-bilibili.md | 4 +++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.DS_Store b/.DS_Store index 38feefa1305dd562b473cf007a49f24eeb686ee3..3bb782c82ab015890dc4a163909323238dde2619 100644 GIT binary patch delta 27 jcmZo!z}T{Yal0o2^ApS^)q_n+J3N diff --git a/.gitignore b/.gitignore index f2645a07f..b512a8cb7 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ buildNumber.properties out gen */.DS_Store +.DS_Store diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 21492804d..3363bca43 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -2,9 +2,11 @@ Spring Cloud +https://www.bilibili.com/video/BV1nK4y1H7g9?p=173&spm_id_from=pageDriver + https://www.bilibili.com/video/BV1nK4y1H7g9?p=170&spm_id_from=pageDriver -Spring Cloud Nacos +Spring Cloud Nacoss https://www.bilibili.com/video/BV1nK4y1H7g9?p=167&spm_id_from=pageDriver From 1f1b44cfe4cc459b63b5683f1657530debe2217a Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sun, 20 Feb 2022 23:33:15 +0800 Subject: [PATCH 080/129] remark --- .DS_Store | Bin 20484 -> 20484 bytes study-summary/README-bilibili.md | 2 ++ 2 files changed, 2 insertions(+) diff --git a/.DS_Store b/.DS_Store index 3bb782c82ab015890dc4a163909323238dde2619..590199743ba65a999dec0a00cdb7e6279a79cdc0 100644 GIT binary patch delta 39 vcmZo!z}T{Yal Date: Tue, 22 Feb 2022 00:41:13 +0800 Subject: [PATCH 081/129] readme --- study-summary/README-bilibili.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 340190010..093d6147e 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -4,6 +4,12 @@ Spring Cloud +https://www.bilibili.com/video/BV1nK4y1H7g9?p=178&spm_id_from=pageDriver + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=175 + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=174&spm_id_from=pageDriver + https://www.bilibili.com/video/BV1nK4y1H7g9?p=173&spm_id_from=pageDriver https://www.bilibili.com/video/BV1nK4y1H7g9?p=170&spm_id_from=pageDriver From 76944afb3a21332beb31c55d423e870855ffb4ef Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 23 Feb 2022 22:53:35 +0800 Subject: [PATCH 082/129] spring boot --- study-summary/README-bilibili.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 093d6147e..87dc9683c 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -2,8 +2,16 @@ 注册中心、分布式事务、网管 +Spring Boot + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=185 + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=184 + Spring Cloud +https://www.bilibili.com/video/BV1nK4y1H7g9?p=182 + https://www.bilibili.com/video/BV1nK4y1H7g9?p=178&spm_id_from=pageDriver https://www.bilibili.com/video/BV1nK4y1H7g9?p=175 From bb3fa6a6592ffe3587a70a7da177d9484ddac50b Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Fri, 25 Feb 2022 22:12:58 +0800 Subject: [PATCH 083/129] spring init --- .DS_Store | Bin 20484 -> 20484 bytes study-summary/README-bilibili.md | 4 ++++ 2 files changed, 4 insertions(+) diff --git a/.DS_Store b/.DS_Store index 590199743ba65a999dec0a00cdb7e6279a79cdc0..f9abedcbb5a7a0daef924c426c61d2106be09242 100644 GIT binary patch delta 22 dcmZo!z}T{Yal>a3c1sf-1tT-#&A&vrtN~nI2V(#L delta 22 dcmZo!z}T{Yal>a3c4IRg1!E(_&A&vrtN~mL2U-9C diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 87dc9683c..2a41b3131 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -4,6 +4,10 @@ Spring Boot +https://www.bilibili.com/video/BV1nK4y1H7g9?p=189 + +https://www.bilibili.com/video/BV1nK4y1H7g9?p=186 + https://www.bilibili.com/video/BV1nK4y1H7g9?p=185 https://www.bilibili.com/video/BV1nK4y1H7g9?p=184 From 903388ed69a198f4b06a754c33fd14fb697a8b6f Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 2 Mar 2022 21:26:23 +0800 Subject: [PATCH 084/129] sharding sphere --- .DS_Store | Bin 20484 -> 20484 bytes study-summary/README-bilibili.md | 6 ++++++ 2 files changed, 6 insertions(+) diff --git a/.DS_Store b/.DS_Store index f9abedcbb5a7a0daef924c426c61d2106be09242..590199743ba65a999dec0a00cdb7e6279a79cdc0 100644 GIT binary patch delta 22 dcmZo!z}T{Yal>a3c4IRg1!E(_&A&vrtN~mL2U-9C delta 22 dcmZo!z}T{Yal>a3c1sf-1tT-#&A&vrtN~nI2V(#L diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 2a41b3131..c4501994f 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -2,6 +2,12 @@ 注册中心、分布式事务、网管 +ShardingSphere + +https://www.bilibili.com/video/BV1XU4y177De?from=search&seid=5629134683248808430&spm_id_from=333.337.0.0 + +https://www.bilibili.com/video/BV1uz4y1S7ov?p=2 + Spring Boot https://www.bilibili.com/video/BV1nK4y1H7g9?p=189 From e803ed843459b00f92b907d12a1b7cc9025c0943 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Tue, 8 Mar 2022 23:14:25 +0800 Subject: [PATCH 085/129] QA --- .DS_Store | Bin 20484 -> 20484 bytes study-summary/README-bilibili.md | 6 ++++++ 2 files changed, 6 insertions(+) diff --git a/.DS_Store b/.DS_Store index 590199743ba65a999dec0a00cdb7e6279a79cdc0..a9c034f60294a0aa54170129f30cbc44f660897c 100644 GIT binary patch delta 22 dcmZo!z}T{Yal>a3b~95Q1tUwN&A&vrtN~n82V(#L delta 22 dcmZo!z}T{Yal>a3c4IRg1!E(_&A&vrtN~mL2U-9C diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index c4501994f..d767c3817 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,5 +1,11 @@ # 进度备忘 +问答 + +https://www.bilibili.com/video/BV1iV411p7LU?p=9&spm_id_from=pageDriver + +https://www.bilibili.com/video/BV1iV411p7LU?from=search&seid=7880316255452534004&spm_id_from=333.337.0.0 + 注册中心、分布式事务、网管 ShardingSphere From 77c4e8f493b8b00b1f63051f54bb370ef85cb7e6 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 9 Mar 2022 00:30:13 +0800 Subject: [PATCH 086/129] reverse --- study-summary/README-bilibili.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index d767c3817..19327e43e 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -2,6 +2,8 @@ 问答 +https://www.bilibili.com/video/BV1iV411p7LU?p=24&spm_id_from=pageDriver + https://www.bilibili.com/video/BV1iV411p7LU?p=9&spm_id_from=pageDriver https://www.bilibili.com/video/BV1iV411p7LU?from=search&seid=7880316255452534004&spm_id_from=333.337.0.0 From e7b2f1f5cb17a84c360bbcd68da3cdb97224d92e Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Thu, 10 Mar 2022 00:13:37 +0800 Subject: [PATCH 087/129] revert nodes --- .../study/algorithm/leetcode/RevertNodes.java | 39 +++++++++++++++++++ study-summary/README-bilibili.md | 2 + 2 files changed, 41 insertions(+) create mode 100644 study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/RevertNodes.java diff --git a/study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/RevertNodes.java b/study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/RevertNodes.java new file mode 100644 index 000000000..13fe5a4f8 --- /dev/null +++ b/study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/RevertNodes.java @@ -0,0 +1,39 @@ +package com.bage.study.algorithm.leetcode; + +import java.util.Objects; + +/** + * https://leetcode-cn.com/problems/UHnkqh/ + */ +public class RevertNodes { +} + +/** + * Definition for singly-linked list. + * public class ListNode { + * int val; + * ListNode next; + * ListNode() {} + * ListNode(int val) { this.val = val; } + * ListNode(int val, ListNode next) { this.val = val; this.next = next; } + * } + */ +class Solution { + public ListNode reverseList(ListNode head) { + if(Objects.isNull(head) || Objects.isNull(head.next)){ + return head; + } + ListNode listNode = reverseList(head.next); + head.next.next = head; + head.next = null; + return listNode; + } +}ß + + class ListNode { + int val; + ListNode next; + ListNode() {} + ListNode(int val) { this.val = val; } + ListNode(int val, ListNode next) { this.val = val; this.next = next; } + } diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 19327e43e..24bb701e6 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -2,6 +2,8 @@ 问答 +https://www.bilibili.com/video/BV1iV411p7LU?p=30&spm_id_from=pageDriver + https://www.bilibili.com/video/BV1iV411p7LU?p=24&spm_id_from=pageDriver https://www.bilibili.com/video/BV1iV411p7LU?p=9&spm_id_from=pageDriver From 2cc7034f654ff1d7767d407b49b20bb55378c723 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Fri, 11 Mar 2022 09:44:42 +0800 Subject: [PATCH 088/129] bug fix --- .../com/bage/study/algorithm/leetcode/RevertNodes.java | 2 +- study-summary/README-bilibili.md | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/RevertNodes.java b/study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/RevertNodes.java index 13fe5a4f8..8b11f3a5e 100644 --- a/study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/RevertNodes.java +++ b/study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/RevertNodes.java @@ -28,7 +28,7 @@ public ListNode reverseList(ListNode head) { head.next = null; return listNode; } -}ß +} class ListNode { int val; diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 24bb701e6..494124406 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,5 +1,13 @@ # 进度备忘 + + +https://leetcode-cn.com/problems/UHnkqh/ + + + + + 问答 https://www.bilibili.com/video/BV1iV411p7LU?p=30&spm_id_from=pageDriver From fe3c13ae33455b6d5be7a257c5aa9e532ff5e05f Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Mon, 14 Mar 2022 23:11:58 +0800 Subject: [PATCH 089/129] sum --- .../algorithm/leetcode/SortedArraySum.java | 19 +++++++++++++++++++ study-summary/README-bilibili.md | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/SortedArraySum.java diff --git a/study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/SortedArraySum.java b/study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/SortedArraySum.java new file mode 100644 index 000000000..7ea6c3c56 --- /dev/null +++ b/study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/SortedArraySum.java @@ -0,0 +1,19 @@ +package com.bage.study.algorithm.leetcode; + +import java.util.Objects; + +/** + * https://leetcode-cn.com/problems/kLl5u1/ + * SortedArraySum + */ +public class SortedArraySum { + public ListNode reverseList(ListNode head) { + if(Objects.isNull(head) || Objects.isNull(head.next)){ + return head; + } + ListNode listNode = reverseList(head.next); + head.next.next = head; + head.next = null; + return listNode; + } +} diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 494124406..f72f9b8f8 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -10,6 +10,8 @@ https://leetcode-cn.com/problems/UHnkqh/ 问答 +https://www.bilibili.com/video/BV1iV411p7LU?p=31 + https://www.bilibili.com/video/BV1iV411p7LU?p=30&spm_id_from=pageDriver https://www.bilibili.com/video/BV1iV411p7LU?p=24&spm_id_from=pageDriver From cdadce72dc2ecff088d5bae7c6d0768bccc8a163 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Tue, 15 Mar 2022 22:37:40 +0800 Subject: [PATCH 090/129] Update README-bilibili.md --- study-summary/README-bilibili.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index f72f9b8f8..d611d2d92 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -10,6 +10,10 @@ https://leetcode-cn.com/problems/UHnkqh/ 问答 +https://www.bilibili.com/video/BV1iV411p7LU?p=33 + +https://www.bilibili.com/video/BV1iV411p7LU?p=32 + https://www.bilibili.com/video/BV1iV411p7LU?p=31 https://www.bilibili.com/video/BV1iV411p7LU?p=30&spm_id_from=pageDriver From 4472efbd91471196e23e58f742f566b4c78b7934 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 16 Mar 2022 00:16:21 +0800 Subject: [PATCH 091/129] tree --- .../study/algorithm/leetcode/MinDeepTree.java | 24 +++++++++++++++++++ study-summary/README-bilibili.md | 10 ++++++++ 2 files changed, 34 insertions(+) create mode 100644 study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/MinDeepTree.java diff --git a/study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/MinDeepTree.java b/study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/MinDeepTree.java new file mode 100644 index 000000000..040f92cb5 --- /dev/null +++ b/study-algorithm/src/main/java/com/bage/study/algorithm/leetcode/MinDeepTree.java @@ -0,0 +1,24 @@ +package com.bage.study.algorithm.leetcode; + +import java.util.Objects; + + +/** + * https://leetcode-cn.com/problems/minimum-depth-of-binary-tree/ + * // todo ddd + */ +public class MinDeepTree { + public ListNode reverseList(ListNode head) { + if(Objects.isNull(head) || Objects.isNull(head.next)){ + return head; + } + ListNode listNode = reverseList(head.next); + head.next.next = head; + head.next = null; + return listNode; + } +} + +class TreeNode { + TreeNode next; + } diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index d611d2d92..121dfb21b 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -10,6 +10,16 @@ https://leetcode-cn.com/problems/UHnkqh/ 问答 +https://www.bilibili.com/video/BV1iV411p7LU?p=39 + +https://www.bilibili.com/video/BV1iV411p7LU?p=38 + +https://www.bilibili.com/video/BV1iV411p7LU?p=36 + +https://www.bilibili.com/video/BV1iV411p7LU?p=35 + +https://www.bilibili.com/video/BV1iV411p7LU?p=34&spm_id_from=pageDriver + https://www.bilibili.com/video/BV1iV411p7LU?p=33 https://www.bilibili.com/video/BV1iV411p7LU?p=32 From bd6f64cbff756e11e8743a363ad10d907bd61e53 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Tue, 22 Mar 2022 23:01:06 +0800 Subject: [PATCH 092/129] QA --- .DS_Store | Bin 20484 -> 20484 bytes study-summary/README-bilibili.md | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.DS_Store b/.DS_Store index a9c034f60294a0aa54170129f30cbc44f660897c..32dabfd51e9c5e6dfece1ea61238882c238f8331 100644 GIT binary patch delta 63 zcmZo!z}T{Yae_bN!i@pD`B~)|7#Kt*KeUnFtSwN&I+;&IVDfrV?#Y*&`X_%9i3GDn Rh50wn7xm}d%&qWK9{`}w6+r+1 delta 51 zcmV-30L=e{paF!S0gz7tpRrK84+R|n000z|;XE6&D-d)AlgtwkldlyEv)2|h39*13 J0kaDr`7gWK5fcCa diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 121dfb21b..cf18911f6 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -4,9 +4,9 @@ https://leetcode-cn.com/problems/UHnkqh/ +问答 - - +https://www.bilibili.com/video/BV1iV411p7LU?p=134 问答 From 7fe5f09de679867d73ef924e24830fe8f9ef6462 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Mon, 4 Apr 2022 14:47:07 +0800 Subject: [PATCH 093/129] jmeter --- .DS_Store | Bin 20484 -> 20484 bytes study-summary/README-bilibili.md | 6 ++++++ 2 files changed, 6 insertions(+) diff --git a/.DS_Store b/.DS_Store index 32dabfd51e9c5e6dfece1ea61238882c238f8331..c32eaaf582787a8e93adb813802957950d308a6f 100644 GIT binary patch delta 30 mcmZo!z}T{Yal>a3c4IRg1!E(_$$?^lljTIXH;0L?vjPB{tqFAi delta 22 ecmZo!z}T{Yal>bk$zEa+ljTIXH;0L?vjPBQ`UoQc diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index cf18911f6..359d8e354 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,5 +1,11 @@ # 进度备忘 +压测JMetter + +https://www.bilibili.com/video/BV1st411Y7QW?spm_id_from=333.337.search-card.all.click + + + https://leetcode-cn.com/problems/UHnkqh/ From 806d34041001b23c8c9c76616c4ae7ad4ef56d49 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sun, 17 Apr 2022 12:51:48 +0800 Subject: [PATCH 094/129] log masking --- .DS_Store | Bin 20484 -> 20484 bytes study-jmeter/README.md | 1 + study-log-logback/README.md | 3 +- .../log/logback/MaskingPatternLayout.java | 42 ++++++++++++++++++ .../src/main/resources/logback-test.xml | 36 +++++++++++++++ .../bage/study/log/logback/LogAppTest.java | 13 ++++++ study-summary/README-bilibili.md | 2 +- 7 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 study-log-logback/src/main/java/com/bage/study/log/logback/MaskingPatternLayout.java diff --git a/.DS_Store b/.DS_Store index c32eaaf582787a8e93adb813802957950d308a6f..a4b24e56fe66168cfef6970fa673f10dd40605b0 100644 GIT binary patch delta 56 zcmV-80LTA?paF!S0gz7tqOnlB9|1SB3?M)ZlZ-PC2WkLq0A&DllMxdWvrH_P1G5V- OEDw_pFVwROK=}{;HxY#Z delta 58 zcmZo!z}T{Yae_bN!i@pD maskPatterns = new ArrayList<>(); + + public void addMaskPattern(String maskPattern) { + maskPatterns.add(maskPattern); + multilinePattern = Pattern.compile(maskPatterns.stream().collect(Collectors.joining("|")), Pattern.MULTILINE); + } + + @Override + public String doLayout(IAccessEvent event) { + return super.doLayout(event); + } + + private String maskMessage(String message) { + if (multilinePattern == null) { + return message; + } + StringBuilder sb = new StringBuilder(message); + Matcher matcher = multilinePattern.matcher(sb); + while (matcher.find()) { + IntStream.rangeClosed(1, matcher.groupCount()).forEach(group -> { + if (matcher.group(group) != null) { + IntStream.range(matcher.start(group), matcher.end(group)).forEach(i -> sb.setCharAt(i, '*')); + } + }); + } + return sb.toString(); + } +} diff --git a/study-log-logback/src/main/resources/logback-test.xml b/study-log-logback/src/main/resources/logback-test.xml index 654a771bf..8627d5492 100644 --- a/study-log-logback/src/main/resources/logback-test.xml +++ b/study-log-logback/src/main/resources/logback-test.xml @@ -6,6 +6,42 @@ + + + + + \"ssn\"\s*:\s*\"(.*?)\" + \"email\"\s*:\s*\"(.*?)\" + + diff --git a/study-log-logback/src/test/java/com/bage/study/log/logback/LogAppTest.java b/study-log-logback/src/test/java/com/bage/study/log/logback/LogAppTest.java index aea114717..ecae73de0 100644 --- a/study-log-logback/src/test/java/com/bage/study/log/logback/LogAppTest.java +++ b/study-log-logback/src/test/java/com/bage/study/log/logback/LogAppTest.java @@ -22,4 +22,17 @@ public void test() { LOG.error("I am programming."); } + @org.junit.Test + public void testMasking() { + // Throw some logging statements in your code somewhere where you know they'll be fired right away when you run your app. For example: + String json = "{\n" + + " \"user_id\":\"87656\",\n" + + " \"ssn\":\"123-12-345\",\n" + + " \"city\":\"Chicago\",\n" + + " \"Country\":\"U.S.\",\n" + + " \"email\":\"bage@qq.com\"\n" + + " }"; + LOG.info(json); + + } } diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 359d8e354..08a58ceab 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -4,7 +4,7 @@ https://www.bilibili.com/video/BV1st411Y7QW?spm_id_from=333.337.search-card.all.click - +https://www.bilibili.com/video/BV1hL4y1B7Et?spm_id_from=333.337.search-card.all.click From aa2e96759d642b86baf6ef492f0919ffbe7541f8 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Mon, 18 Apr 2022 20:44:24 +0800 Subject: [PATCH 095/129] Mac --- study-summary/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/study-summary/README.md b/study-summary/README.md index ba9fa82e6..296a2088c 100644 --- a/study-summary/README.md +++ b/study-summary/README.md @@ -12,6 +12,9 @@ Cauch 教练管理方式 代理: https://blog.csdn.net/lx1315998513/article/details/120641124 +## Mac 使用技巧 +https://zhuanlan.zhihu.com/p/89987302 + ## 常用连接 https://github.com/0voice/interview_internal_reference From eb260d97e5499802a7a216a069ddbd7aee9d8750 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 20 Apr 2022 21:04:42 +0800 Subject: [PATCH 096/129] log masking --- study-log-logback/pom.xml | 6 + .../log/logback/MaskingPatternLayout.java | 15 +- .../bage/study/log/logback/mask/MaskRule.java | 148 ++++++++++++++++++ .../study/log/logback/mask/MaskRules.java | 21 +++ .../logback/mask/MaskingMessageProvider.java | 23 +++ .../src/main/resources/logback-test.xml | 10 +- .../src/main/resources/logback.xml | 34 ++++ .../bage/study/log/logback/LogAppTest.java | 1 + 8 files changed, 246 insertions(+), 12 deletions(-) create mode 100644 study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskRule.java create mode 100644 study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskRules.java create mode 100644 study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskingMessageProvider.java diff --git a/study-log-logback/pom.xml b/study-log-logback/pom.xml index 123d06a09..24e17000d 100644 --- a/study-log-logback/pom.xml +++ b/study-log-logback/pom.xml @@ -46,5 +46,11 @@ test + + net.logstash.logback + logstash-logback-encoder + 4.11 + + diff --git a/study-log-logback/src/main/java/com/bage/study/log/logback/MaskingPatternLayout.java b/study-log-logback/src/main/java/com/bage/study/log/logback/MaskingPatternLayout.java index 8ed3d013a..3372d623b 100644 --- a/study-log-logback/src/main/java/com/bage/study/log/logback/MaskingPatternLayout.java +++ b/study-log-logback/src/main/java/com/bage/study/log/logback/MaskingPatternLayout.java @@ -1,7 +1,8 @@ package com.bage.study.log.logback; -import ch.qos.logback.access.PatternLayout; -import ch.qos.logback.access.spi.IAccessEvent; +import ch.qos.logback.classic.PatternLayout; +import ch.qos.logback.classic.spi.ILoggingEvent; + import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; @@ -19,11 +20,15 @@ public void addMaskPattern(String maskPattern) { multilinePattern = Pattern.compile(maskPatterns.stream().collect(Collectors.joining("|")), Pattern.MULTILINE); } +// @Override +// public String doLayout(IAccessEvent event) { +// return super.doLayout(event); +// } + @Override - public String doLayout(IAccessEvent event) { - return super.doLayout(event); + public String doLayout(ILoggingEvent event) { + return maskMessage(super.doLayout(event)); } - private String maskMessage(String message) { if (multilinePattern == null) { return message; diff --git a/study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskRule.java b/study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskRule.java new file mode 100644 index 000000000..81759f97a --- /dev/null +++ b/study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskRule.java @@ -0,0 +1,148 @@ +package com.bage.study.log.logback.mask; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static java.util.regex.Pattern.DOTALL; +import static java.util.regex.Pattern.MULTILINE; +import static java.util.regex.Pattern.compile; + +/** + * Rule to masks sensitive information in logs. + */ +public class MaskRule { + private final String name; + private final Pattern pattern; + private final int unmasked; + + /** + * + * @param name a friendly name for the rule. + * @param prefix a literal prefix preceding the actual search pattern. + * @param suffix a literal suffix preceding the actual search pattern. + * @param pattern a regular expression pattern to identify the personally identifiable information. + * @param unmasked the number of characters to leave unmasked. + */ + MaskRule(String name, String prefix, String suffix, String pattern, int unmasked) { + this.name = parse(name); + this.pattern = parse(prefix, suffix, pattern); + this.unmasked = unmasked; + } + + private String parse(String name) { + if (nullOrBlank(name)) { + throw new IllegalArgumentException("Name cannot be null blank!"); + } + return name.trim(); + } + + private static String repeat(String input, int times) { + if (times <= 0) return ""; + else if (times % 2 == 0) return repeat(input + input, times / 2); + else return input + repeat(input + input, times / 2); + } + + private static Pattern parse(String prefix, String suffix, String pattern) { + String parsedPrefix = nullOrBlank(prefix) ? "" : "(?<=" + prefix + ")(?:\\s*)"; + String parsedSuffix = nullOrBlank(suffix) ? "" : "(?:\\s*)(?=" + suffix + ")"; + return compile(parsedPrefix + validated(pattern) + parsedSuffix, DOTALL | MULTILINE); + } + + private static String validated(String pattern) { + if (nullOrBlank(pattern)) { + throw new IllegalArgumentException("Need a non-blank pattern value!"); + } + return pattern.startsWith("(") ? pattern : "(" + pattern + ")"; + } + + private static boolean nullOrBlank(String input) { + return input == null || "".equals(input.trim()); + } + + /** + * Applies the masking rule to the input. + * @param input the PII that needs to be masked. + * @return the masked version of the input. + */ + public String apply(String input) { + Matcher matcher = pattern.matcher(input); + if (matcher.find()) { + String match = matcher.group(1); + String mask = repeat("X", Math.min(match.length(), match.length() - unmasked)); + String replacement = mask + match.substring(mask.length()); + return input.replace(match, replacement); + } + return input; + } + + /** + * Helper to create a new rule instance. + * @see MaskRule + * @see ch.qos.logback.classic.joran.JoranConfigurator + */ + + + public static class Definition { + private String name; + private String prefix = ""; + private String suffix = ""; + private String pattern; + private int unmasked = 0; + + public Definition(String name, String pattern) { + this(name, "", "", pattern, 0); + } + + public Definition(String name, String prefix, String suffix, String pattern, int unmasked) { + this.name = name; + this.prefix = prefix; + this.suffix = suffix; + this.pattern = pattern; + this.unmasked = unmasked; + } + + public MaskRule rule() { + return new MaskRule(name, prefix, suffix, pattern, unmasked); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPrefix() { + return prefix; + } + + public void setPrefix(String prefix) { + this.prefix = prefix; + } + + public String getSuffix() { + return suffix; + } + + public void setSuffix(String suffix) { + this.suffix = suffix; + } + + public String getPattern() { + return pattern; + } + + public void setPattern(String pattern) { + this.pattern = pattern; + } + + public int getUnmasked() { + return unmasked; + } + + public void setUnmasked(int unmasked) { + this.unmasked = unmasked; + } + } +} \ No newline at end of file diff --git a/study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskRules.java b/study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskRules.java new file mode 100644 index 000000000..c200ec146 --- /dev/null +++ b/study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskRules.java @@ -0,0 +1,21 @@ +package com.bage.study.log.logback.mask; + +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.function.BinaryOperator; + +public class MaskRules { + private static final BinaryOperator NO_OP = (in, out) -> { + throw new UnsupportedOperationException("Only needed for parallel streams!"); + }; + + private final Set rules = new LinkedHashSet<>(); + + public void addRule(MaskRule.Definition definition) { + rules.add(definition.rule()); + } + + public String apply(String input) { + return rules.stream().reduce(input, (out, rule) -> rule.apply(out), NO_OP); + } +} \ No newline at end of file diff --git a/study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskingMessageProvider.java b/study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskingMessageProvider.java new file mode 100644 index 000000000..9d0fe4dc9 --- /dev/null +++ b/study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskingMessageProvider.java @@ -0,0 +1,23 @@ +package com.bage.study.log.logback.mask; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import com.fasterxml.jackson.core.JsonGenerator; +import net.logstash.logback.composite.JsonWritingUtils; +import net.logstash.logback.composite.loggingevent.MessageJsonProvider; + +import java.io.IOException; + +public class MaskingMessageProvider extends MessageJsonProvider { + + private MaskRules rules; + + @Override + public void writeTo(JsonGenerator generator, ILoggingEvent event) throws IOException { + JsonWritingUtils.writeStringField(generator, getFieldName(), rules.apply(event.getFormattedMessage())); + } + + @SuppressWarnings("unused") + public void setRules(MaskRules rules) { + this.rules = rules; + } +} \ No newline at end of file diff --git a/study-log-logback/src/main/resources/logback-test.xml b/study-log-logback/src/main/resources/logback-test.xml index 8627d5492..cf92889b9 100644 --- a/study-log-logback/src/main/resources/logback-test.xml +++ b/study-log-logback/src/main/resources/logback-test.xml @@ -6,20 +6,16 @@ - + diff --git a/study-log-logback/src/main/resources/logback.xml b/study-log-logback/src/main/resources/logback.xml index bd3d85a7d..625744c54 100644 --- a/study-log-logback/src/main/resources/logback.xml +++ b/study-log-logback/src/main/resources/logback.xml @@ -11,6 +11,40 @@ %X{myTag} %d{HH:mm:ss.SSS} [%thread] %-5level %logger{32} - %msg%n + + + + + UTC + + + + + ssn + \d{3}-?\d{2}-?\d{4} + + + + + + + { + "severity": "%level", + "thread": "%thread", + "class": "%logger{40}" + } + + + + + + + + \"ssn\"\s*:\s*\"(.*?)\" + \"email\"\s*:\s*\"(.*?)\" + + + diff --git a/study-log-logback/src/test/java/com/bage/study/log/logback/LogAppTest.java b/study-log-logback/src/test/java/com/bage/study/log/logback/LogAppTest.java index ecae73de0..22aabec4d 100644 --- a/study-log-logback/src/test/java/com/bage/study/log/logback/LogAppTest.java +++ b/study-log-logback/src/test/java/com/bage/study/log/logback/LogAppTest.java @@ -22,6 +22,7 @@ public void test() { LOG.error("I am programming."); } + @org.junit.Test public void testMasking() { // Throw some logging statements in your code somewhere where you know they'll be fired right away when you run your app. For example: From d94d1636c55296d26203514254f35c47b7efcf59 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Thu, 21 Apr 2022 09:50:19 +0800 Subject: [PATCH 097/129] rename --- pom.xml | 2 +- study-file-online-preview/pom.xml | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 2b5bb9b34..ef927d741 100644 --- a/pom.xml +++ b/pom.xml @@ -148,7 +148,7 @@ study-jmockit study-mockito study-java-agent-instrument - untitled + study-file-online-preview study-jol study-servlet diff --git a/study-file-online-preview/pom.xml b/study-file-online-preview/pom.xml index 17ddd126a..1243963f1 100644 --- a/study-file-online-preview/pom.xml +++ b/study-file-online-preview/pom.xml @@ -17,10 +17,6 @@ - - - - From dbafea5932e7279a555deda0a2ef03069f328b10 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Tue, 26 Apr 2022 20:27:33 +0800 Subject: [PATCH 098/129] logback test --- .DS_Store | Bin 20484 -> 22532 bytes study-log-logback/README.md | 2 + study-log-logback/pom.xml | 2 +- .../logback/mask/MaskingMessageProvider.java | 1 - .../bage/study/log/logback/LogAppTest.java | 13 ---- .../bage/study/log/logback/MaskLogTest.java | 28 ++++++++ .../{main => test}/resources/logback-test.xml | 61 +++++++++++++++--- 7 files changed, 83 insertions(+), 24 deletions(-) create mode 100644 study-log-logback/src/test/java/com/bage/study/log/logback/MaskLogTest.java rename study-log-logback/src/{main => test}/resources/logback-test.xml (53%) diff --git a/.DS_Store b/.DS_Store index a4b24e56fe66168cfef6970fa673f10dd40605b0..1e752a94d48ab3df0beeb7fe1d879a91ce1fb1af 100644 GIT binary patch delta 364 zcmXv~JxD@P6h8O;`Jm@-H6&86LLX9^VF*Erl!n3^0wG)jL5a``45C$9UwW3tpr)qa z3_)8{dk{1QwKNvCG!%6%)Ns!CoxjU>zuuYXU5OX~h}CXm5nzL<$ssXhaog<2vf~$A z>D&P5LIVyV1>4Z+@10}D)pV7I8d5qgbbK!-@g+Ym3}!XFEk^OPV9{_wG010XrXJ_r zNfadqJv%^0>rH_bCycvl7M=VQ&4s@FB1e|};6u;J4k9P`F;h0ARBd8IGbwVeM7Lpu23#JprKnp(c?FXqC}l`tsASM( z$YLniEXcH&ak4=O3oA2Fnq{(~p(Z2icyljU9eC(m^EWMrGXM$l#Q2j`^CLQG67 zo7p*7I2h$Oe-M=B+pNI!gptvFGmpYm_Q^V8e4A}FkF!l?F%p=p%qTS3#87;*ngJgp zKhRtxV7@ura4jzjP(*UFfP?zvL`JR6{0^FolOJjyLsKdQc88rC|K=@Dovf347=tH! z3JYzP7wBc2tZS*H0yKjiVzLJ}kamT6mVrS5=xGBWcHjp3?>X~i{t!zAMquzjRD&5H c7k~sn;RK=sCTE09oP5A>&g4h#(HM3C00_fHr~m)} diff --git a/study-log-logback/README.md b/study-log-logback/README.md index fbb676310..600cec8a0 100644 --- a/study-log-logback/README.md +++ b/study-log-logback/README.md @@ -1,6 +1,8 @@ # study-log-logback # logback 基本使用 +todo: setRules null + ## 参考链接 ## diff --git a/study-log-logback/pom.xml b/study-log-logback/pom.xml index 24e17000d..02b3c2ed1 100644 --- a/study-log-logback/pom.xml +++ b/study-log-logback/pom.xml @@ -14,7 +14,7 @@ UTF-8 1.8 1.8 - 1.0.13 + 1.2.3 diff --git a/study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskingMessageProvider.java b/study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskingMessageProvider.java index 9d0fe4dc9..707bbdef6 100644 --- a/study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskingMessageProvider.java +++ b/study-log-logback/src/main/java/com/bage/study/log/logback/mask/MaskingMessageProvider.java @@ -16,7 +16,6 @@ public void writeTo(JsonGenerator generator, ILoggingEvent event) throws IOExcep JsonWritingUtils.writeStringField(generator, getFieldName(), rules.apply(event.getFormattedMessage())); } - @SuppressWarnings("unused") public void setRules(MaskRules rules) { this.rules = rules; } diff --git a/study-log-logback/src/test/java/com/bage/study/log/logback/LogAppTest.java b/study-log-logback/src/test/java/com/bage/study/log/logback/LogAppTest.java index 22aabec4d..df07015a3 100644 --- a/study-log-logback/src/test/java/com/bage/study/log/logback/LogAppTest.java +++ b/study-log-logback/src/test/java/com/bage/study/log/logback/LogAppTest.java @@ -23,17 +23,4 @@ public void test() { } - @org.junit.Test - public void testMasking() { - // Throw some logging statements in your code somewhere where you know they'll be fired right away when you run your app. For example: - String json = "{\n" + - " \"user_id\":\"87656\",\n" + - " \"ssn\":\"123-12-345\",\n" + - " \"city\":\"Chicago\",\n" + - " \"Country\":\"U.S.\",\n" + - " \"email\":\"bage@qq.com\"\n" + - " }"; - LOG.info(json); - - } } diff --git a/study-log-logback/src/test/java/com/bage/study/log/logback/MaskLogTest.java b/study-log-logback/src/test/java/com/bage/study/log/logback/MaskLogTest.java new file mode 100644 index 000000000..f42d14e28 --- /dev/null +++ b/study-log-logback/src/test/java/com/bage/study/log/logback/MaskLogTest.java @@ -0,0 +1,28 @@ +package com.bage.study.log.logback; + +// Add the following to the imports section of your java code: +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * LogAppTest + */ +public class MaskLogTest { + + private static final Logger LOG = LoggerFactory.getLogger(MaskLogTest.class); + + + @org.junit.Test + public void testMasking() { + // Throw some logging statements in your code somewhere where you know they'll be fired right away when you run your app. For example: + String json = "{\n" + + " \"user_id\":\"87656\",\n" + + " \"ssn\":\"123-12-3453\",\n" + + " \"city\":\"Chicago\",\n" + + " \"Country\":\"U.S.\",\n" + + " \"email\":\"bage@qq.com\"\n" + + " }"; + LOG.info(json); + } + +} diff --git a/study-log-logback/src/main/resources/logback-test.xml b/study-log-logback/src/test/resources/logback-test.xml similarity index 53% rename from study-log-logback/src/main/resources/logback-test.xml rename to study-log-logback/src/test/resources/logback-test.xml index cf92889b9..97c3f7b9a 100644 --- a/study-log-logback/src/main/resources/logback-test.xml +++ b/study-log-logback/src/test/resources/logback-test.xml @@ -4,14 +4,13 @@ - - + UTC - + ssn @@ -31,19 +30,60 @@ + - - - \"ssn\"\s*:\s*\"(.*?)\" - \"email\"\s*:\s*\"(.*?)\" - + + + + + + UTC + + + + + ssn + \d{3}-?\d{2}-?\d{4} + + + + + + + { + "severity": "%level", + "thread": "%thread", + "class": "%logger{40}" + } + + + + - + + \"ssn\"\s*:\s*\"(.*?)\" + \"email\"\s*:\s*\"(.*?)\" %X{myTag} %d{HH:mm:ss.SSS} [%thread] %-5level %logger{32} - %msg%n @@ -72,7 +112,10 @@ + + From 6b37c9431fb0482ff1fb3518a17adf315996dcee Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sat, 30 Apr 2022 13:30:36 +0800 Subject: [PATCH 099/129] mac jdk 8 --- study-itext/pom.xml | 47 +------------------------------- study-summary/README-bilibili.md | 6 ++++ 2 files changed, 7 insertions(+), 46 deletions(-) diff --git a/study-itext/pom.xml b/study-itext/pom.xml index 6c771d85f..22d84d440 100644 --- a/study-itext/pom.xml +++ b/study-itext/pom.xml @@ -37,7 +37,7 @@ net.sf.cssbox pdf2dom - 1.6 + 1.8 @@ -65,49 +65,4 @@ - - - - - - maven-clean-plugin - 3.1.0 - - - - maven-resources-plugin - 3.0.2 - - - maven-compiler-plugin - 3.8.0 - - - maven-surefire-plugin - 2.22.1 - - - maven-jar-plugin - 3.0.2 - - - maven-install-plugin - 2.5.2 - - - maven-deploy-plugin - 2.8.2 - - - - maven-site-plugin - 3.7.1 - - - maven-project-info-reports-plugin - 3.0.0 - - - - diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 08a58ceab..91dc09f7c 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,5 +1,11 @@ # 进度备忘 +Spring + +https://www.bilibili.com/video/BV1y541127Yg?spm_id_from=333.851.b_7265636f6d6d656e64.6 + + + 压测JMetter https://www.bilibili.com/video/BV1st411Y7QW?spm_id_from=333.337.search-card.all.click From 7510206af3d6f4bc1e371e77e920aad320898d34 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sat, 30 Apr 2022 14:09:30 +0800 Subject: [PATCH 100/129] mac compile fix --- pom.xml | 4 ++++ study-jvm/pom.xml | 2 -- study-jvm/src/main/java/SimpleDebugger.java | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ef927d741..4fe2c355f 100644 --- a/pom.xml +++ b/pom.xml @@ -138,7 +138,9 @@ study-summary study-id-generator study-stream-m3u8 + study-hystrix study-resilience4j study-ews-java-api @@ -147,7 +149,9 @@ study-sftp study-jmockit study-mockito + study-file-online-preview study-jol study-servlet diff --git a/study-jvm/pom.xml b/study-jvm/pom.xml index fb0a1ab2b..ddec8f88c 100644 --- a/study-jvm/pom.xml +++ b/study-jvm/pom.xml @@ -34,8 +34,6 @@ UTF-8 1.8 1.8 - 1.7 - 1.7 diff --git a/study-jvm/src/main/java/SimpleDebugger.java b/study-jvm/src/main/java/SimpleDebugger.java index a8206a9ad..cf998ec44 100644 --- a/study-jvm/src/main/java/SimpleDebugger.java +++ b/study-jvm/src/main/java/SimpleDebugger.java @@ -1,3 +1,4 @@ + import com.sun.jdi.*; import com.sun.jdi.connect.Connector; import com.sun.jdi.connect.LaunchingConnector; From 1b0f17fc21d38e00f5f6eff1091b413067bd04ec Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sun, 1 May 2022 12:43:01 +0800 Subject: [PATCH 101/129] mac docker --- .DS_Store | Bin 22532 -> 22532 bytes study-docker/README.md | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/.DS_Store b/.DS_Store index 1e752a94d48ab3df0beeb7fe1d879a91ce1fb1af..bf7afa6bf3ae594e55948342f68ee958d0b53c74 100644 GIT binary patch delta 273 zcmZqKz}T{Zae}|-G6n_)Rt5$E28L3G6oyI$U4|@%+{uDWizgd|u&^=%WmzWg)0Lad zsn5>}RL3AXc><&A|J93s@)5w&r6`0cuEQ$e#Q_cru5nv5Ag? ziLue-dt#20i&Z5jFLmPIyjsfPrChqpkF0Z%3ZZLQG#-CpPeI zX6InxU{sx~Xs0>3S3zL&bb%87i48%UxfK?$PF7bH*nCCJm~-+83BJiM^mr%hG4fC5 zH+annv;YjuCi@#oZ8kQX!Z+E}UUPCfqoQCoLncE>S#VKaPJUiGP!Z!~9)ovq4Fa3v z94@o70L9fOgB Date: Mon, 2 May 2022 15:30:51 +0800 Subject: [PATCH 102/129] jmeter ping test --- .DS_Store | Bin 22532 -> 22532 bytes study-jmeter/jmx/jmeter-ping.jmx | 98 ++++++++++++++++++ study-jmeter/pom.xml | 87 +++++++--------- study-jmeter/src/main/java/com/bage/App.java | 13 --- .../com/bage/study/jmeter/Application.java | 12 +++ .../com/bage/study/jmeter/PingController.java | 18 ++++ .../src/test/java/com/bage/AppTest.java | 20 ---- 7 files changed, 165 insertions(+), 83 deletions(-) create mode 100644 study-jmeter/jmx/jmeter-ping.jmx delete mode 100644 study-jmeter/src/main/java/com/bage/App.java create mode 100644 study-jmeter/src/main/java/com/bage/study/jmeter/Application.java create mode 100644 study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java delete mode 100644 study-jmeter/src/test/java/com/bage/AppTest.java diff --git a/.DS_Store b/.DS_Store index bf7afa6bf3ae594e55948342f68ee958d0b53c74..14c9e05addf8637897304bac93e03477e4ac5df9 100644 GIT binary patch delta 178 zcmZqKz}T{Zae@>R6X!%3W5(qZ1GX<#U}BtX5W+Hd_XURodFCiCJXAzP1a-N-^_2Y zgMX5~2scDr07ywrZnRU~Z0hibeKWho0d}CII0FMzUjRs*D+7Z74+8@e=VqAz9TpBo P1_mHvVAvcGvV|D{UU4WH delta 164 zcmZqKz}T{Zae@>RBgaG;W5#6@1GY~#2w|Db&7?e8%YdJeb#lDD=41or=E<)dq&Ew3 zh_Y-}V0p{9nVsW^+T=a@o|Apl`6kO6@J`lay1~i-1m=?!4aGM57%b(V+@R~g2@( + + + + + false + true + false + + + + + + + + continue + + false + 5 + + 10 + 3 + false + + + true + + + + + pang + + + Assertion.response_data + false + 16 + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + + + + 127.0.0.1 + 8080 + http + + /ping + GET + true + false + true + false + + + + + + + + + diff --git a/study-jmeter/pom.xml b/study-jmeter/pom.xml index c1e330165..8ff5e3530 100644 --- a/study-jmeter/pom.xml +++ b/study-jmeter/pom.xml @@ -15,64 +15,51 @@ http://www.example.com + UTF-8 1.8 1.8 + 2.0.1.RELEASE - - junit - junit - 4.11 - test + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-log4j2 + + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-test + + + + + org.springframework.boot + spring-boot-dependencies + ${spring.boot.base.version} + pom + import + + + + - - - - - - maven-clean-plugin - 3.1.0 - - - - maven-resources-plugin - 3.0.2 - - - maven-compiler-plugin - 3.8.0 - - - maven-surefire-plugin - 2.22.1 - - - maven-jar-plugin - 3.0.2 - - - maven-install-plugin - 2.5.2 - - - maven-deploy-plugin - 2.8.2 - - - - maven-site-plugin - 3.7.1 - - - maven-project-info-reports-plugin - 3.0.0 - - - - diff --git a/study-jmeter/src/main/java/com/bage/App.java b/study-jmeter/src/main/java/com/bage/App.java deleted file mode 100644 index 65b45b532..000000000 --- a/study-jmeter/src/main/java/com/bage/App.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.bage; - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/Application.java b/study-jmeter/src/main/java/com/bage/study/jmeter/Application.java new file mode 100644 index 000000000..7fbdbc784 --- /dev/null +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/Application.java @@ -0,0 +1,12 @@ +package com.bage.study.jmeter; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } +} diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java b/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java new file mode 100644 index 000000000..44f4bb04e --- /dev/null +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java @@ -0,0 +1,18 @@ +package com.bage.study.jmeter; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + +import java.time.LocalDateTime; + +@RestController +public class PingController { + + @RequestMapping("/ping") + public @ResponseBody String ping() { + System.out.println(LocalDateTime.now().toString()); + return "pang"; + } + +} diff --git a/study-jmeter/src/test/java/com/bage/AppTest.java b/study-jmeter/src/test/java/com/bage/AppTest.java deleted file mode 100644 index 9216cfd04..000000000 --- a/study-jmeter/src/test/java/com/bage/AppTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.bage; - -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -/** - * Unit test for simple App. - */ -public class AppTest -{ - /** - * Rigorous Test :-) - */ - @Test - public void shouldAnswerWithTrue() - { - assertTrue( true ); - } -} From 1f37453d360822ca7ada24167b4eaebaf5177a5a Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Mon, 2 May 2022 15:33:43 +0800 Subject: [PATCH 103/129] Update .gitignore --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b512a8cb7..efda2ecd4 100644 --- a/.gitignore +++ b/.gitignore @@ -44,5 +44,4 @@ buildNumber.properties *.iml out gen -*/.DS_Store -.DS_Store +*DS_Store From 507c65284dd65775fa8a68e6a65e1142ea67afd7 Mon Sep 17 00:00:00 2001 From: bage2014 <893542907@qq.com> Date: Mon, 2 May 2022 15:37:03 +0800 Subject: [PATCH 104/129] Delete .DS_Store --- .DS_Store | Bin 22532 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 14c9e05addf8637897304bac93e03477e4ac5df9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22532 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 J^A)ZC{|j}Byj%bP From f009cd6e5b20817f07e036218ba9ca6b5669b769 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Mon, 2 May 2022 15:40:29 +0800 Subject: [PATCH 105/129] todo --- study-jmeter/README.md | 2 ++ .../com/bage/study/jmeter/MySQLController.java | 18 ++++++++++++++++++ .../com/bage/study/jmeter/PingController.java | 5 +++-- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java diff --git a/study-jmeter/README.md b/study-jmeter/README.md index c04fbe407..02d2c9601 100644 --- a/study-jmeter/README.md +++ b/study-jmeter/README.md @@ -1,6 +1,8 @@ # study-jmeter # study-jmeter学习笔记 +todo: 链接 MySQL + ## 参考链接 ## - 官网 [http://jmeter.apache.org/](http://jmeter.apache.org/) - 中文网 http://www.jmeter.com.cn/ diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java b/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java new file mode 100644 index 000000000..c98d1676a --- /dev/null +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java @@ -0,0 +1,18 @@ +package com.bage.study.jmeter; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; + +import java.time.LocalDateTime; + +@RestController +public class MySQLController { + + @RequestMapping("/ping") + public @ResponseBody String ping() { + System.out.println(LocalDateTime.now()); + return "pang"; + } + +} diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java b/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java index 44f4bb04e..0f405f1f2 100644 --- a/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java @@ -7,11 +7,12 @@ import java.time.LocalDateTime; @RestController +@RequestMapping("/db") public class PingController { - @RequestMapping("/ping") + @RequestMapping("/mysql") public @ResponseBody String ping() { - System.out.println(LocalDateTime.now().toString()); + System.out.println(LocalDateTime.now()); return "pang"; } From 42a2fdedb94126a712fe76d2a2033a52e9c80686 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 4 May 2022 01:36:29 +0800 Subject: [PATCH 106/129] db query --- study-jmeter/pom.xml | 68 +++++++++++++++++-- .../com/bage/study/jmeter/AppConstants.java | 5 ++ .../com/bage/study/jmeter/Application.java | 7 +- .../java/com/bage/study/jmeter/Customer.java | 12 ++++ .../com/bage/study/jmeter/CustomerRepo.java | 54 +++++++++++++++ .../bage/study/jmeter/DataSourceConfig.java | 58 ++++++++++++++++ .../bage/study/jmeter/MySQLController.java | 19 +++++- .../com/bage/study/jmeter/PingController.java | 3 +- 8 files changed, 214 insertions(+), 12 deletions(-) create mode 100644 study-jmeter/src/main/java/com/bage/study/jmeter/AppConstants.java create mode 100644 study-jmeter/src/main/java/com/bage/study/jmeter/Customer.java create mode 100644 study-jmeter/src/main/java/com/bage/study/jmeter/CustomerRepo.java create mode 100644 study-jmeter/src/main/java/com/bage/study/jmeter/DataSourceConfig.java diff --git a/study-jmeter/pom.xml b/study-jmeter/pom.xml index 8ff5e3530..a05928cb4 100644 --- a/study-jmeter/pom.xml +++ b/study-jmeter/pom.xml @@ -21,8 +21,22 @@ 1.8 1.8 2.0.1.RELEASE + + 3.4.6 + 1.3.2 + 8.0.13 + + 1.18.20 + + 1.2.12 + 1.4.0 + + 1.3.0.Final + + + org.springframework.boot spring-boot-starter-web @@ -33,20 +47,60 @@ org.springframework.boot - spring-boot-starter-log4j2 + spring-boot-starter-test - org.springframework.boot spring-boot-starter-thymeleaf + + + - org.springframework.boot - spring-boot-starter-test + org.mybatis + mybatis + ${mybatis.version} + + + org.mybatis + mybatis-spring + ${mybatis-spring.version} + + + org.mybatis.spring.boot + mybatis-spring-boot-autoconfigure + ${mybatis-spring.version} + + org.mybatis.spring.boot + mybatis-spring-boot-starter + ${mybatis-spring.version} + + + mysql + mysql-connector-java + ${mysql.version} + + + + + org.mapstruct + mapstruct + ${org.mapstruct.version} + + + org.mapstruct + mapstruct-jdk8 + ${org.mapstruct.version} + + + + + org.projectlombok + lombok + ${lombok.version} + + diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/AppConstants.java b/study-jmeter/src/main/java/com/bage/study/jmeter/AppConstants.java new file mode 100644 index 000000000..430edd793 --- /dev/null +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/AppConstants.java @@ -0,0 +1,5 @@ +package com.bage.study.jmeter; + +public class AppConstants { + public static final String APP_PREF = "jmeter"; +} diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/Application.java b/study-jmeter/src/main/java/com/bage/study/jmeter/Application.java index 7fbdbc784..5fbb9bba4 100644 --- a/study-jmeter/src/main/java/com/bage/study/jmeter/Application.java +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/Application.java @@ -2,8 +2,13 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; -@SpringBootApplication + +@SpringBootApplication( + scanBasePackageClasses = Application.class, + exclude = {DataSourceAutoConfiguration.class} +) public class Application { public static void main(String[] args) { diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/Customer.java b/study-jmeter/src/main/java/com/bage/study/jmeter/Customer.java new file mode 100644 index 000000000..fa6100ad2 --- /dev/null +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/Customer.java @@ -0,0 +1,12 @@ +package com.bage.study.jmeter; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class Customer { + private long id; + private String firstName, lastName; + +} \ No newline at end of file diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/CustomerRepo.java b/study-jmeter/src/main/java/com/bage/study/jmeter/CustomerRepo.java new file mode 100644 index 000000000..a63b86d38 --- /dev/null +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/CustomerRepo.java @@ -0,0 +1,54 @@ +package com.bage.study.jmeter; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +@Component +public class CustomerRepo { + private static final Logger log = LoggerFactory.getLogger(CustomerRepo.class); + @Autowired + JdbcTemplate jdbcTemplate; + +// @PostConstruct + public void init() { + + log.info("Creating tables"); + +// jdbcTemplate.execute("DROP TABLE customers IF EXISTS"); +// jdbcTemplate.execute("CREATE TABLE customers(" + +// "id SERIAL, first_name VARCHAR(255), last_name VARCHAR(255))"); + + // Split up the array of whole names into an array of first/last names + List splitUpNames = Arrays.asList("John Woo", "Jeff Dean", "Josh Bloch", "Josh Long").stream() + .map(name -> name.split(" ")) + .collect(Collectors.toList()); + + // Use a Java 8 stream to print out each tuple of the list + splitUpNames.forEach(name -> log.info(String.format("Inserting customer record for %s %s", name[0], name[1]))); + + // Uses JdbcTemplate's batchUpdate operation to bulk load data + jdbcTemplate.batchUpdate("INSERT INTO customers(first_name, last_name) VALUES (?,?)", splitUpNames); + + log.info("Querying for customer records where first_name = 'Josh':"); + jdbcTemplate.query( + "SELECT id, first_name, last_name FROM customers WHERE first_name = ?", new Object[]{"Josh"}, + (rs, rowNum) -> new Customer(rs.getLong("id"), rs.getString("first_name"), rs.getString("last_name")) + ).forEach(customer -> log.info(customer.toString())); + } + + public List query() { + return jdbcTemplate.query( + "SELECT id, first_name, last_name FROM customers WHERE first_name = ?", new Object[]{"Josh"}, + (rs, rowNum) -> new Customer(rs.getLong("id"), rs.getString("first_name"), rs.getString("last_name")) + ); + + } +} \ No newline at end of file diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/DataSourceConfig.java b/study-jmeter/src/main/java/com/bage/study/jmeter/DataSourceConfig.java new file mode 100644 index 000000000..6929f25a5 --- /dev/null +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/DataSourceConfig.java @@ -0,0 +1,58 @@ +package com.bage.study.jmeter; + +import com.zaxxer.hikari.HikariDataSource; +import org.apache.ibatis.session.SqlSessionFactory; +import org.mybatis.spring.SqlSessionFactoryBean; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.jdbc.DataSourceBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; + +import javax.sql.DataSource; + +@Configuration +@MapperScan(basePackages = "com.bage.auth.server.*.mapper", sqlSessionFactoryRef = AppConstants.APP_PREF + "SqlSessionFactory") +public class DataSourceConfig { + + + @Bean(AppConstants.APP_PREF + "DataSource") + public DataSource dataSource() { + DataSourceBuilder builder = DataSourceBuilder.create().type(HikariDataSource.class); + HikariDataSource hikariDataSource = builder + .driverClassName("com.mysql.cj.jdbc.Driver") + .url("jdbc:mysql://127.0.0.1:3306/mydb?useSSL=false&characterEncoding=utf8&allowPublicKeyRetrieval=true") + .username("bage") + .password("bage") + .build(); + hikariDataSource.setAutoCommit(true);//update自动提交设置 + hikariDataSource.setConnectionTestQuery("select 1");//连接查询语句设置 + hikariDataSource.setConnectionTimeout(5000);//连接超时时间设置 + hikariDataSource.setIdleTimeout(3000);//连接空闲生命周期设置 + hikariDataSource.setIsolateInternalQueries(false);//执行查询启动设置 + hikariDataSource.setMaximumPoolSize(500);//连接池允许的最大连接数量 + hikariDataSource.setMaxLifetime(1800000);//检查空余连接优化连接池设置时间,单位毫秒 + hikariDataSource.setMinimumIdle(10);//连接池保持最小空余连接数量 + hikariDataSource.setPoolName(AppConstants.APP_PREF + "HikariPool");//连接池名称 + return builder.build(); + } + + @Bean(AppConstants.APP_PREF + "SqlSessionFactory") + public SqlSessionFactory sqlSessionFactory(@Qualifier(AppConstants.APP_PREF + "DataSource") DataSource datasource) throws Exception { + SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean(); + Resource[] resources = new PathMatchingResourcePatternResolver().getResources("classpath*:mapper/com/bage/auth/server/*.xml"); + sqlSessionFactoryBean.setMapperLocations(resources); + sqlSessionFactoryBean.setDataSource(datasource); + return sqlSessionFactoryBean.getObject(); + } + + @Bean(AppConstants.APP_PREF + "TransactionManager") + DataSourceTransactionManager transactionManager(@Qualifier(AppConstants.APP_PREF + "DataSource") DataSource datasource) { + return new DataSourceTransactionManager(datasource); + } + + +} diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java b/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java index c98d1676a..1725c865e 100644 --- a/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java @@ -4,13 +4,28 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; import java.time.LocalDateTime; @RestController +@RequestMapping("/mysql") public class MySQLController { - @RequestMapping("/ping") - public @ResponseBody String ping() { + + @Resource + private CustomerRepo repo; + + @RequestMapping("/query") + public @ResponseBody + Object query() { + System.out.println(LocalDateTime.now()); + return repo.query(); + } + + @RequestMapping("/init") + public @ResponseBody + String init() { + repo.init(); System.out.println(LocalDateTime.now()); return "pang"; } diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java b/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java index 0f405f1f2..552a79a1b 100644 --- a/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java @@ -7,10 +7,9 @@ import java.time.LocalDateTime; @RestController -@RequestMapping("/db") public class PingController { - @RequestMapping("/mysql") + @RequestMapping("/ping") public @ResponseBody String ping() { System.out.println(LocalDateTime.now()); return "pang"; From 2a5d063659fa53b5010940ba12bb4a8bdb544bc4 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 4 May 2022 01:59:36 +0800 Subject: [PATCH 107/129] mysql pressure test --- study-jmeter/README.md | 29 +++++ study-jmeter/jmx/jmeter-ping.jmx | 110 +++++++++++++++++- .../com/bage/study/jmeter/CustomerRepo.java | 4 +- .../bage/study/jmeter/MySQLController.java | 8 +- 4 files changed, 145 insertions(+), 6 deletions(-) diff --git a/study-jmeter/README.md b/study-jmeter/README.md index 02d2c9601..175d5eb53 100644 --- a/study-jmeter/README.md +++ b/study-jmeter/README.md @@ -71,3 +71,32 @@ KB/Sec:每秒从服务器端接收到的数据量,相当于LoadRunner中的T - JMeter Exception: java.net.BindException: Address already in use: connect [http://twit88.com/blog/2008/07/28/jmeter-exception-javanetbindexception-departmentAddress-already-in-use-connect/](http://twit88.com/blog/2008/07/28/jmeter-exception-javanetbindexception-departmentAddress-already-in-use-connect/) - Address already in use : connect 的解决办法 [https://blog.csdn.net/qq_31441637/article/details/80422901](https://blog.csdn.net/qq_31441637/article/details/80422901) + + + + +## 简单压测 + +### 数据库压测 + +数据库连接数 + +``` +登陆 root +mysql -uroot -p + +查看当前最大连接数 +show variables like 'max_connections'; + +设置最大连接数 +set global max_connections=10; +``` + + + + + + + + + diff --git a/study-jmeter/jmx/jmeter-ping.jmx b/study-jmeter/jmx/jmeter-ping.jmx index 9cd8b9752..f3acf04ca 100644 --- a/study-jmeter/jmx/jmeter-ping.jmx +++ b/study-jmeter/jmx/jmeter-ping.jmx @@ -1,7 +1,7 @@ - + false true @@ -93,6 +93,114 @@ + + continue + + false + 3 + + 20 + 3 + false + + + true + + + + + + + 127.0.0.1 + 8080 + http + + /mysql/query + GET + true + false + true + false + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/CustomerRepo.java b/study-jmeter/src/main/java/com/bage/study/jmeter/CustomerRepo.java index a63b86d38..da614f76b 100644 --- a/study-jmeter/src/main/java/com/bage/study/jmeter/CustomerRepo.java +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/CustomerRepo.java @@ -44,9 +44,9 @@ public void init() { ).forEach(customer -> log.info(customer.toString())); } - public List query() { + public List query(String key) { return jdbcTemplate.query( - "SELECT id, first_name, last_name FROM customers WHERE first_name = ?", new Object[]{"Josh"}, + "SELECT id, first_name, last_name FROM customers WHERE first_name = ?", new Object[]{key}, (rs, rowNum) -> new Customer(rs.getLong("id"), rs.getString("first_name"), rs.getString("last_name")) ); diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java b/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java index 1725c865e..40580a824 100644 --- a/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java @@ -6,20 +6,22 @@ import javax.annotation.Resource; import java.time.LocalDateTime; +import java.util.Random; @RestController @RequestMapping("/mysql") public class MySQLController { - + Random random = new Random(); @Resource private CustomerRepo repo; @RequestMapping("/query") public @ResponseBody Object query() { - System.out.println(LocalDateTime.now()); - return repo.query(); + String key = String.valueOf(System.currentTimeMillis() - random.nextInt()); + System.out.println(LocalDateTime.now() + "; " + key); + return repo.query(key); } @RequestMapping("/init") From 229a6adcf197ecdb63f83d5e2c8301ac3224f55d Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Thu, 5 May 2022 00:05:05 +0800 Subject: [PATCH 108/129] thread --- study-docker/README.md | 53 +++++++++++++++++-- .../java/multhread/MyThreadPoolExecutor.java | 3 +- .../bage/study/java/multhread/ThreadTest.java | 16 ++++++ study-jmeter/README.md | 11 ++-- study-jmeter/jmx/jmeter-ping.jmx | 8 +-- .../bage/study/jmeter/DataSourceConfig.java | 5 +- .../bage/study/jmeter/MySQLController.java | 12 +++-- .../com/bage/study/jmeter/PingController.java | 2 +- 8 files changed, 88 insertions(+), 22 deletions(-) create mode 100644 study-java/src/main/java/com/bage/study/java/multhread/ThreadTest.java diff --git a/study-docker/README.md b/study-docker/README.md index f16224283..5ad0ec85d 100644 --- a/study-docker/README.md +++ b/study-docker/README.md @@ -162,9 +162,10 @@ Start a mysql server instance Mac: docker run --name bage-mysql -v /Users/bage/bage/docker-data/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=bage -p 3306:3306 -d mysql/mysql-server - - - + + +​ +​ 其中 --name 起名 bage-mysql @@ -409,6 +410,7 @@ Docker Pull Command + 访问 http://{ip}:9092/_cat/health @@ -711,6 +713,7 @@ start a instance + ### 安装配置 logstash ### 版本匹配 https://www.elastic.co/cn/support/matrix#matrix_compatibility 参考链接:[https://www.elastic.co/guide/en/logstash/current/docker.html](https://www.elastic.co/guide/en/logstash/current/docker.html)、[https://hub.docker.com/_/logstash?tab=description](https://hub.docker.com/_/logstash?tab=description)、[https://www.elastic.co/guide/en/logstash/current/docker-config.html](https://www.elastic.co/guide/en/logstash/current/docker-config.html) @@ -738,7 +741,44 @@ setting max_map_count sudo sysctl -w vm.max_map_count=262144 vi /home/bage/data/logstash/file-beats.conf - +[Mac: /Users/bage/bage/docker-data/elk/logstash/beats-input.conf] + +``` +# 数据输入配置:port -> 端口号;codec -> 输入格式。这里以logback为例。 +input { + tcp { + port => 5044 + codec=>json_lines + } +} + +# 数据输出配置:hosts -> 主机集合;index -> 你将要创建的索引名称。这里es为例。 +output { + elasticsearch { + hosts => ["127.0.0.1:9200"] + index => "%{[appName]}-%{+YYYY.MM.dd}" + } +} +``` + +``` +# 数据输入配置:port -> 端口号;codec -> 输入格式。这里以logback为例。 +input { + tcp { + port => 5044 + codec=>json_lines + } +} + +# 数据输出配置:hosts -> 主机集合;index -> 你将要创建的索引名称。这里es为例。 +output { + elasticsearch { + hosts => ["127.0.0.1:9200"] + index => "%{[appName]}-%{+YYYY.MM.dd}" + } +} +``` + # 数据输入配置:port -> 端口号;codec -> 输入格式。这里以logback为例。 input { tcp { @@ -759,7 +799,10 @@ vi /home/bage/data/logstash/file-beats.conf start a instance docker run -v /home/bage/data/logstash/file-beats.conf:/etc/logstash/conf.d/02-beats-input.conf -p 8056:5601 -p 8092:9200 -p 8044:5044 -it --name elk sebp/elk:700 - + + Mac: + docker run -v /Users/bage/bage/docker-data/elk/es:/var/lib/elasticsearch /Users/bage/bage/docker-data/elk/logstash/beats-input.conf:/etc/logstash/conf.d/02-beats-input.conf -p 8056:5601 -p 8092:9200 -p 8044:5044 -it --name elk sebp/elk:700 + 访问 diff --git a/study-java/src/main/java/com/bage/study/java/multhread/MyThreadPoolExecutor.java b/study-java/src/main/java/com/bage/study/java/multhread/MyThreadPoolExecutor.java index e93f00cf3..91677a544 100644 --- a/study-java/src/main/java/com/bage/study/java/multhread/MyThreadPoolExecutor.java +++ b/study-java/src/main/java/com/bage/study/java/multhread/MyThreadPoolExecutor.java @@ -80,7 +80,8 @@ public void run() { // SynchronousQueue, // LinkedBlockingDeque, // ArrayBlockingQueue; - + +// threadPoolExecutor.shutdownNow(); } } diff --git a/study-java/src/main/java/com/bage/study/java/multhread/ThreadTest.java b/study-java/src/main/java/com/bage/study/java/multhread/ThreadTest.java new file mode 100644 index 000000000..6cb5b250c --- /dev/null +++ b/study-java/src/main/java/com/bage/study/java/multhread/ThreadTest.java @@ -0,0 +1,16 @@ +package com.bage.study.java.multhread; + +/** + * 多线程顺序执行实现 + * + * @author bage + */ +public class ThreadTest { + + public static void main(String[] args) throws Exception { + Thread thread1 = new ThreadSeq1(); + thread1.start(); + } + +} + diff --git a/study-jmeter/README.md b/study-jmeter/README.md index 175d5eb53..b2d60336a 100644 --- a/study-jmeter/README.md +++ b/study-jmeter/README.md @@ -79,6 +79,10 @@ KB/Sec:每秒从服务器端接收到的数据量,相当于LoadRunner中的T ### 数据库压测 +请求入口 + +http://localhost:8080/mysql/query?key=josh + 数据库连接数 ``` @@ -90,12 +94,11 @@ show variables like 'max_connections'; 设置最大连接数 set global max_connections=10; -``` - - - +查看当前连接情况 +show status like 'Threads%'; +``` diff --git a/study-jmeter/jmx/jmeter-ping.jmx b/study-jmeter/jmx/jmeter-ping.jmx index f3acf04ca..4ca95331a 100644 --- a/study-jmeter/jmx/jmeter-ping.jmx +++ b/study-jmeter/jmx/jmeter-ping.jmx @@ -16,10 +16,10 @@ continue false - 5 + 1 - 10 - 3 + 1 + 1 false @@ -99,7 +99,7 @@ false 3 - 20 + 40 3 false diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/DataSourceConfig.java b/study-jmeter/src/main/java/com/bage/study/jmeter/DataSourceConfig.java index 6929f25a5..1909fcea1 100644 --- a/study-jmeter/src/main/java/com/bage/study/jmeter/DataSourceConfig.java +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/DataSourceConfig.java @@ -33,10 +33,11 @@ public DataSource dataSource() { hikariDataSource.setConnectionTimeout(5000);//连接超时时间设置 hikariDataSource.setIdleTimeout(3000);//连接空闲生命周期设置 hikariDataSource.setIsolateInternalQueries(false);//执行查询启动设置 - hikariDataSource.setMaximumPoolSize(500);//连接池允许的最大连接数量 + hikariDataSource.setMaximumPoolSize(8);//连接池允许的最大连接数量 hikariDataSource.setMaxLifetime(1800000);//检查空余连接优化连接池设置时间,单位毫秒 - hikariDataSource.setMinimumIdle(10);//连接池保持最小空余连接数量 + hikariDataSource.setMinimumIdle(2);//连接池保持最小空余连接数量 hikariDataSource.setPoolName(AppConstants.APP_PREF + "HikariPool");//连接池名称 +// hikariDataSource.setLogWriter(); return builder.build(); } diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java b/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java index 40580a824..5f6f81e03 100644 --- a/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java @@ -1,11 +1,13 @@ package com.bage.study.jmeter; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.time.LocalDateTime; +import java.util.Objects; import java.util.Random; @RestController @@ -17,16 +19,16 @@ public class MySQLController { private CustomerRepo repo; @RequestMapping("/query") - public @ResponseBody - Object query() { - String key = String.valueOf(System.currentTimeMillis() - random.nextInt()); + public Object query(@RequestParam(required = false) String key) { + if (Objects.isNull(key)) { + key = String.valueOf(System.currentTimeMillis() - random.nextInt()); + } System.out.println(LocalDateTime.now() + "; " + key); return repo.query(key); } @RequestMapping("/init") - public @ResponseBody - String init() { + public String init() { repo.init(); System.out.println(LocalDateTime.now()); return "pang"; diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java b/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java index 552a79a1b..2010fb622 100644 --- a/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/PingController.java @@ -10,7 +10,7 @@ public class PingController { @RequestMapping("/ping") - public @ResponseBody String ping() { + public String ping() { System.out.println(LocalDateTime.now()); return "pang"; } From 2cfa8cfe12948d894d295d251f456fa847064bb1 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sat, 7 May 2022 00:50:25 +0800 Subject: [PATCH 109/129] Update README-bilibili.md --- study-summary/README-bilibili.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 91dc09f7c..3af0b3550 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -1,5 +1,29 @@ # 进度备忘 + + +面试汇总: + +https://github.com/Snailclimb/JavaGuide + +https://hadyang.com/interview/docs/architecture/distributed/dubbo/ + +https://github.com/yuanguangxin/LeetCode + +https://github.com/gzc426/Java-Interview/tree/master/docs + +https://github.com/Snailclimb/JavaGuide-Interview/tree/master/docs + +https://github.com/itdevbooks/tech + + + +当前进度:11 + +https://zhuanlan.zhihu.com/p/64147696 + + + Spring https://www.bilibili.com/video/BV1y541127Yg?spm_id_from=333.851.b_7265636f6d6d656e64.6 From d3de9296c59dbdc650e13261e455c4ce6003b8de Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sun, 8 May 2022 23:33:09 +0800 Subject: [PATCH 110/129] kfk --- study-summary/README-bilibili.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 3af0b3550..0a286b614 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -4,6 +4,8 @@ 面试汇总: +Kayak: https://github.com/Snailclimb/JavaGuide-Interview/blob/master/docs/e-3kafka.md + https://github.com/Snailclimb/JavaGuide https://hadyang.com/interview/docs/architecture/distributed/dubbo/ From b88091a01570a9643cc0d31478e9eca68cd61736 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Mon, 9 May 2022 00:02:28 +0800 Subject: [PATCH 111/129] todo --- study-todo/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/study-todo/README.md b/study-todo/README.md index 4a723193e..a12a03700 100644 --- a/study-todo/README.md +++ b/study-todo/README.md @@ -1,7 +1,19 @@ # study-TODO # 代办事项: +Kayak +PacificA : kafka采用的一致性协议 + + + + + +压测 + + + +线上问题定位 From 1d8726333386ca9d553ce65c0242177b3872fcd1 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 11 May 2022 21:36:56 +0800 Subject: [PATCH 112/129] tomcat --- study-summary/README-bilibili.md | 26 +++++++++++++++++++++++++- study-summary/README-mq.md | 6 ++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 study-summary/README-mq.md diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 0a286b614..ba0f9f95e 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -4,7 +4,31 @@ 面试汇总: -Kayak: https://github.com/Snailclimb/JavaGuide-Interview/blob/master/docs/e-3kafka.md + + +Tomcat + +https://baijiahao.baidu.com/s?id=1707755764671407613&wfr=spider&for=pc + +https://blog.csdn.net/zps66/article/details/117673727 + + + +场景设计: + +https://github.com/Snailclimb/JavaGuide-Interview/blob/master/docs/f-2%E7%B3%BB%E7%BB%9F%E8%AE%BE%E8%AE%A1%E9%9D%A2%E8%AF%95%E6%8C%87%E5%8C%97.md + + + +Kafaka: + +https://github.com/Snailclimb/JavaGuide-Interview/blob/master/docs/e-3kafka.md + +https://blog.csdn.net/yanpenglei/article/details/121862772 + +https://zhuanlan.zhihu.com/p/469002514 + + https://github.com/Snailclimb/JavaGuide diff --git a/study-summary/README-mq.md b/study-summary/README-mq.md new file mode 100644 index 000000000..00c6382b5 --- /dev/null +++ b/study-summary/README-mq.md @@ -0,0 +1,6 @@ +# Study-mq # + + +Kafaka: + +参考链接: https://blog.csdn.net/u012588879/article/details/122957237 \ No newline at end of file From 3c685ebb75fa1b1f139a9ad92daa4913fda6ca89 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sat, 14 May 2022 01:36:30 +0800 Subject: [PATCH 113/129] db log --- study-summary/README-bilibili.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index ba0f9f95e..6ea7f6dac 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -6,12 +6,22 @@ +DB Log : + +https://www.baidu.com/baidu?tn=monline_7_dg&ie=utf-8&wd=%E6%95%B0%E6%8D%AE%E5%BA%93%E6%97%A5%E5%BF%97 + + + Tomcat https://baijiahao.baidu.com/s?id=1707755764671407613&wfr=spider&for=pc +http://www.javashuo.com/article/p-feodoefp-md.html + https://blog.csdn.net/zps66/article/details/117673727 +https://server.it168.com/a2017/0901/3168/000003168567.shtml + 场景设计: From a846a95e2fcdbb7af474bc88a7be97ab54703bf5 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sun, 15 May 2022 22:04:48 +0800 Subject: [PATCH 114/129] db index --- study-sql/src/main/resources/init.sql | 9 +++++++++ study-sql/src/main/resources/schema.sql | 10 ++++++++++ study-summary/README-bilibili.md | 6 ++++++ 3 files changed, 25 insertions(+) create mode 100644 study-sql/src/main/resources/init.sql create mode 100644 study-sql/src/main/resources/schema.sql diff --git a/study-sql/src/main/resources/init.sql b/study-sql/src/main/resources/init.sql new file mode 100644 index 000000000..9eb068cd3 --- /dev/null +++ b/study-sql/src/main/resources/init.sql @@ -0,0 +1,9 @@ + +-- index +alter table sl_test add key idx_first_name(first_name); +show indexes from sl_test; + +-- init data +insert sl_test(id,sex,birth,age,first_name,last_name) values (1,'男','2022-01-01 00:00:00',1,'bage','lu'); +insert sl_test(id,sex,birth,age,first_name,last_name) values (2,'女','2020-01-01 00:00:00',3,'bage3','lu'); + diff --git a/study-sql/src/main/resources/schema.sql b/study-sql/src/main/resources/schema.sql new file mode 100644 index 000000000..c88f3a30a --- /dev/null +++ b/study-sql/src/main/resources/schema.sql @@ -0,0 +1,10 @@ + +CREATE TABLE sl_test( +id SERIAL, +sex varchar(64), +birth date, +age int, +first_name VARCHAR(64), +last_name VARCHAR(64) +); + diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 6ea7f6dac..0beba4829 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -6,6 +6,12 @@ +MySQL + +https://www.cnblogs.com/setalone/p/14851000.html + +索引下推:https://baijiahao.baidu.com/s?id=1716515482593299829&wfr=spider&for=pc + DB Log : https://www.baidu.com/baidu?tn=monline_7_dg&ie=utf-8&wd=%E6%95%B0%E6%8D%AE%E5%BA%93%E6%97%A5%E5%BF%97 From 8ce3707b0a67cfcbb9d34fbd6c9a6212a9c0e4a8 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Tue, 17 May 2022 21:40:41 +0800 Subject: [PATCH 115/129] spring cloud --- study-summary/README-bilibili.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 0beba4829..1be4ff81f 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -4,6 +4,10 @@ 面试汇总: +Spring Cloud: + +http://c.biancheng.net/springcloud/ + MySQL From 3a5352a1c2c8f33cc5c33b6d4d5612143d2a34f3 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 18 May 2022 03:15:30 +0800 Subject: [PATCH 116/129] lombok access --- pom.xml | 1 + .../main/java/com/bage/study/lombok/App.java | 22 ----------- .../com/bage/study/lombok/UserAccess.java | 13 +++++++ .../java/com/bage/study/lombok/AppTest.java | 38 ------------------- .../com/bage/study/lombok/UserAccessTest.java | 14 +++++++ .../java/com/bage/study/lombok/UserTest.java | 13 +++++++ study-summary/README-bilibili.md | 2 + 7 files changed, 43 insertions(+), 60 deletions(-) delete mode 100644 study-lombok/src/main/java/com/bage/study/lombok/App.java create mode 100644 study-lombok/src/main/java/com/bage/study/lombok/UserAccess.java delete mode 100644 study-lombok/src/test/java/com/bage/study/lombok/AppTest.java create mode 100644 study-lombok/src/test/java/com/bage/study/lombok/UserAccessTest.java create mode 100644 study-lombok/src/test/java/com/bage/study/lombok/UserTest.java diff --git a/pom.xml b/pom.xml index 4fe2c355f..db6429800 100644 --- a/pom.xml +++ b/pom.xml @@ -155,6 +155,7 @@ study-file-online-preview study-jol study-servlet + study-lombok \ No newline at end of file diff --git a/study-lombok/src/main/java/com/bage/study/lombok/App.java b/study-lombok/src/main/java/com/bage/study/lombok/App.java deleted file mode 100644 index 27e6f661d..000000000 --- a/study-lombok/src/main/java/com/bage/study/lombok/App.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.bage.study.lombok; - -import lombok.val; - -import java.util.HashSet; - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - val sets = new HashSet(); - - sets = new HashSet(); - - System.out.println(new User("id","name").getId()); - System.out.println( "Hello World!" ); - } -} diff --git a/study-lombok/src/main/java/com/bage/study/lombok/UserAccess.java b/study-lombok/src/main/java/com/bage/study/lombok/UserAccess.java new file mode 100644 index 000000000..699dc1829 --- /dev/null +++ b/study-lombok/src/main/java/com/bage/study/lombok/UserAccess.java @@ -0,0 +1,13 @@ +package com.bage.study.lombok; + +import lombok.*; +import lombok.experimental.Accessors; + +@Data +@Accessors(fluent = true) +public class UserAccess { + + private String id; + private String name; + +} diff --git a/study-lombok/src/test/java/com/bage/study/lombok/AppTest.java b/study-lombok/src/test/java/com/bage/study/lombok/AppTest.java deleted file mode 100644 index 500356155..000000000 --- a/study-lombok/src/test/java/com/bage/study/lombok/AppTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.bage.study.lombok; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Unit test for simple App. - */ -public class AppTest - extends TestCase -{ - /** - * Create the test case - * - * @param testName name of the test case - */ - public AppTest( String testName ) - { - super( testName ); - } - - /** - * @return the suite of tests being tested - */ - public static Test suite() - { - return new TestSuite( AppTest.class ); - } - - /** - * Rigourous Test :-) - */ - public void testApp() - { - assertTrue( true ); - } -} diff --git a/study-lombok/src/test/java/com/bage/study/lombok/UserAccessTest.java b/study-lombok/src/test/java/com/bage/study/lombok/UserAccessTest.java new file mode 100644 index 000000000..9b8b76031 --- /dev/null +++ b/study-lombok/src/test/java/com/bage/study/lombok/UserAccessTest.java @@ -0,0 +1,14 @@ +package com.bage.study.lombok; + +import junit.framework.TestCase; + +/** + * Unit test for simple App. + */ +public class UserAccessTest extends TestCase { + public void testApp(){ + UserAccess userAccess = new UserAccess(); + userAccess.id("id").name("name"); + System.out.println(userAccess); + } +} diff --git a/study-lombok/src/test/java/com/bage/study/lombok/UserTest.java b/study-lombok/src/test/java/com/bage/study/lombok/UserTest.java new file mode 100644 index 000000000..26d8d3140 --- /dev/null +++ b/study-lombok/src/test/java/com/bage/study/lombok/UserTest.java @@ -0,0 +1,13 @@ +package com.bage.study.lombok; + +import junit.framework.TestCase; + +/** + * Unit test for simple App. + */ +public class UserTest extends TestCase { + public void testApp(){ + String id = new User().getId(); + System.out.println(id); + } +} diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 1be4ff81f..0bf07d5ae 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -6,6 +6,8 @@ Spring Cloud: +http://c.biancheng.net/springcloud/eureka.html + http://c.biancheng.net/springcloud/ From 0c4cb7aa25ab41ee0550bf88c7c8100b324d8c1a Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 18 May 2022 03:43:22 +0800 Subject: [PATCH 117/129] spring cloud --- study-summary/README-bilibili.md | 4 ++++ study-todo/README.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/study-summary/README-bilibili.md b/study-summary/README-bilibili.md index 0bf07d5ae..e38b02462 100644 --- a/study-summary/README-bilibili.md +++ b/study-summary/README-bilibili.md @@ -10,6 +10,10 @@ http://c.biancheng.net/springcloud/eureka.html http://c.biancheng.net/springcloud/ +https://blog.csdn.net/yanpenglei/article/details/121994645 + +https://blog.csdn.net/m0_48795607/article/details/115917190 + MySQL diff --git a/study-todo/README.md b/study-todo/README.md index a12a03700..f537fb543 100644 --- a/study-todo/README.md +++ b/study-todo/README.md @@ -17,5 +17,9 @@ PacificA : kafka采用的一致性协议 +Spring Cloud Alibaba 相关环境搭建 + +Docker 版本 + From 6c97d989d9428aa2196ed4c32a59f0e26a89a27b Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sun, 22 May 2022 13:18:40 +0800 Subject: [PATCH 118/129] todo --- study-todo/README.md | 122 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/study-todo/README.md b/study-todo/README.md index f537fb543..b8ac52a28 100644 --- a/study-todo/README.md +++ b/study-todo/README.md @@ -23,3 +23,125 @@ Docker 版本 + + +Mac 搭建vue环境 + +https://www.jianshu.com/p/a056e41833a7 + + + +## 安装HomeBrew + +https://docs.brew.sh + + + +安装 + +```bash +/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +``` + + + +验证 + +```undefined +brew -v +``` + + + +异常处理 + +```undefined +==> Homebrew has enabled anonymous aggregate formulae and cask analytics. +Read the analytics documentation (and how to opt-out) here: + https://docs.brew.sh/Analytics +No analytics data has been sent yet (nor will any be during this install run). + +==> Homebrew is run entirely by unpaid volunteers. Please consider donating: + https://github.com/Homebrew/brew#donations + +==> Next steps: +- Run these two commands in your terminal to add Homebrew to your PATH: + echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/bage/.zprofile + eval "$(/opt/homebrew/bin/brew shellenv)" +- Run brew help to get started +- Further documentation: + https://docs.brew.sh +``` + + + +补充安装 + +```undefined +echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/bage/.zprofile + +eval "$(/opt/homebrew/bin/brew shellenv)" +``` + + + +## 安装 node + +安装 + +```undefined +brew install nodejs +``` + +验证 + +```undefined +node -v +``` + + + + + +## 安装 vue + +安装 + +```undefined +npm install --global vue-cli + +npm install --global vue-cli@3.0.1 +``` + +验证 + +```undefined +vue -V +``` + +适当更新版本 + +```undefined +npm install -g npm@8.10.0 +``` + + + +## 安装 yarn + +安装 + +```undefined +brew install yarn +``` + +验证 + +```undefined +yarn -V +``` + + + + + From a7b30e9de48040b04d6ff532b392119d5ae2affc Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sun, 22 May 2022 22:23:17 +0800 Subject: [PATCH 119/129] MySQL pressure test --- study-jmeter/README-MySQL.md | 35 +++ study-jmeter/README.md | 31 +-- study-jmeter/jmx/jmeter-mysql.jmx | 233 ++++++++++++++++++ .../bage/study/jmeter/MySQLController.java | 37 --- .../jmeter/{ => mysql}/CustomerRepo.java | 21 +- .../jmeter/{ => mysql}/DataSourceConfig.java | 5 +- .../study/jmeter/mysql/MySQLController.java | 58 +++++ 7 files changed, 349 insertions(+), 71 deletions(-) create mode 100644 study-jmeter/README-MySQL.md create mode 100644 study-jmeter/jmx/jmeter-mysql.jmx delete mode 100644 study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java rename study-jmeter/src/main/java/com/bage/study/jmeter/{ => mysql}/CustomerRepo.java (75%) rename study-jmeter/src/main/java/com/bage/study/jmeter/{ => mysql}/DataSourceConfig.java (95%) create mode 100644 study-jmeter/src/main/java/com/bage/study/jmeter/mysql/MySQLController.java diff --git a/study-jmeter/README-MySQL.md b/study-jmeter/README-MySQL.md new file mode 100644 index 000000000..de3e13e6f --- /dev/null +++ b/study-jmeter/README-MySQL.md @@ -0,0 +1,35 @@ +# study-jmeter-MySQL # +study-jmeter-MySQL学习笔记 + +## 参考链接 ## + + + +## 简单压测 + +### 数据库压测 + +请求入口 + +http://localhost:8080/mysql/query?key=josh + +数据库连接数 + +``` +登陆 root +mysql -uroot -p + +查看当前最大连接数 +show variables like 'max_connections'; + +设置最大连接数 +set global max_connections=10; + +查看当前连接情况 +show status like 'Threads%'; + +``` + + + + diff --git a/study-jmeter/README.md b/study-jmeter/README.md index b2d60336a..e3cdf3007 100644 --- a/study-jmeter/README.md +++ b/study-jmeter/README.md @@ -1,7 +1,7 @@ # study-jmeter # study-jmeter学习笔记 -todo: 链接 MySQL +MySQL 压力测试: [README-MySQL.md](README-MySQL.md) ## 参考链接 ## - 官网 [http://jmeter.apache.org/](http://jmeter.apache.org/) @@ -74,32 +74,3 @@ KB/Sec:每秒从服务器端接收到的数据量,相当于LoadRunner中的T - -## 简单压测 - -### 数据库压测 - -请求入口 - -http://localhost:8080/mysql/query?key=josh - -数据库连接数 - -``` -登陆 root -mysql -uroot -p - -查看当前最大连接数 -show variables like 'max_connections'; - -设置最大连接数 -set global max_connections=10; - -查看当前连接情况 -show status like 'Threads%'; - -``` - - - - diff --git a/study-jmeter/jmx/jmeter-mysql.jmx b/study-jmeter/jmx/jmeter-mysql.jmx new file mode 100644 index 000000000..74507514d --- /dev/null +++ b/study-jmeter/jmx/jmeter-mysql.jmx @@ -0,0 +1,233 @@ + + + + + + false + true + false + + + + + + + + continue + + false + 100 + + 100 + 1 + false + + + true + + + + + + + 127.0.0.1 + 8080 + http + + /mysql/query + GET + true + false + true + false + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + + continue + + false + 100 + + 100 + 1 + false + + + true + + + + + + + 127.0.0.1 + 8080 + http + + /mysql/insert + POST + true + false + true + false + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + true + + + + + + + + + diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java b/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java deleted file mode 100644 index 5f6f81e03..000000000 --- a/study-jmeter/src/main/java/com/bage/study/jmeter/MySQLController.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.bage.study.jmeter; - -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import java.time.LocalDateTime; -import java.util.Objects; -import java.util.Random; - -@RestController -@RequestMapping("/mysql") -public class MySQLController { - - Random random = new Random(); - @Resource - private CustomerRepo repo; - - @RequestMapping("/query") - public Object query(@RequestParam(required = false) String key) { - if (Objects.isNull(key)) { - key = String.valueOf(System.currentTimeMillis() - random.nextInt()); - } - System.out.println(LocalDateTime.now() + "; " + key); - return repo.query(key); - } - - @RequestMapping("/init") - public String init() { - repo.init(); - System.out.println(LocalDateTime.now()); - return "pang"; - } - -} diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/CustomerRepo.java b/study-jmeter/src/main/java/com/bage/study/jmeter/mysql/CustomerRepo.java similarity index 75% rename from study-jmeter/src/main/java/com/bage/study/jmeter/CustomerRepo.java rename to study-jmeter/src/main/java/com/bage/study/jmeter/mysql/CustomerRepo.java index da614f76b..c0e783f78 100644 --- a/study-jmeter/src/main/java/com/bage/study/jmeter/CustomerRepo.java +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/mysql/CustomerRepo.java @@ -1,14 +1,16 @@ -package com.bage.study.jmeter; +package com.bage.study.jmeter.mysql; +import com.bage.study.jmeter.Customer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Component; -import javax.annotation.PostConstruct; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; @Component @@ -49,6 +51,21 @@ public List query(String key) { "SELECT id, first_name, last_name FROM customers WHERE first_name = ?", new Object[]{key}, (rs, rowNum) -> new Customer(rs.getLong("id"), rs.getString("first_name"), rs.getString("last_name")) ); + } + + public int insert(List list) { + if(Objects.isNull(list)){ + return 0; + } + List splitUpNames = new ArrayList<>(); + for (Customer customer : list) { + Object[] objs = new Object[2]; + objs[0] = customer.getFirstName(); + objs[1] = customer.getLastName(); + splitUpNames.add(objs); + } + int[] res = jdbcTemplate.batchUpdate("INSERT INTO customers(first_name, last_name) VALUES (?,?)", splitUpNames); + return Arrays.stream(res).sum(); } } \ No newline at end of file diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/DataSourceConfig.java b/study-jmeter/src/main/java/com/bage/study/jmeter/mysql/DataSourceConfig.java similarity index 95% rename from study-jmeter/src/main/java/com/bage/study/jmeter/DataSourceConfig.java rename to study-jmeter/src/main/java/com/bage/study/jmeter/mysql/DataSourceConfig.java index 1909fcea1..e63259a02 100644 --- a/study-jmeter/src/main/java/com/bage/study/jmeter/DataSourceConfig.java +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/mysql/DataSourceConfig.java @@ -1,5 +1,6 @@ -package com.bage.study.jmeter; +package com.bage.study.jmeter.mysql; +import com.bage.study.jmeter.AppConstants; import com.zaxxer.hikari.HikariDataSource; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionFactoryBean; @@ -33,7 +34,7 @@ public DataSource dataSource() { hikariDataSource.setConnectionTimeout(5000);//连接超时时间设置 hikariDataSource.setIdleTimeout(3000);//连接空闲生命周期设置 hikariDataSource.setIsolateInternalQueries(false);//执行查询启动设置 - hikariDataSource.setMaximumPoolSize(8);//连接池允许的最大连接数量 + hikariDataSource.setMaximumPoolSize(2);//连接池允许的最大连接数量 hikariDataSource.setMaxLifetime(1800000);//检查空余连接优化连接池设置时间,单位毫秒 hikariDataSource.setMinimumIdle(2);//连接池保持最小空余连接数量 hikariDataSource.setPoolName(AppConstants.APP_PREF + "HikariPool");//连接池名称 diff --git a/study-jmeter/src/main/java/com/bage/study/jmeter/mysql/MySQLController.java b/study-jmeter/src/main/java/com/bage/study/jmeter/mysql/MySQLController.java new file mode 100644 index 000000000..848226818 --- /dev/null +++ b/study-jmeter/src/main/java/com/bage/study/jmeter/mysql/MySQLController.java @@ -0,0 +1,58 @@ +package com.bage.study.jmeter.mysql; + +import com.bage.study.jmeter.Customer; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Random; + +@RestController +@RequestMapping("/mysql") +public class MySQLController { + + Random random = new Random(); + @Resource + private CustomerRepo repo; + + @RequestMapping("/query") + public Object query(@RequestParam(required = false) String key) { + if (Objects.isNull(key)) { + key = String.valueOf(System.currentTimeMillis() - random.nextInt()); + } + System.out.println("query:" + LocalDateTime.now() + "; " + key); + return repo.query(key); + } + + @RequestMapping("/insert") + public Object insert(@RequestParam(value = "prefix",required = false) String prefix, + @RequestParam(value = "size",required = false) Integer size) { + if (Objects.isNull(prefix)) { + prefix = String.valueOf(System.currentTimeMillis()); + prefix = prefix.substring(prefix.length() - 10); + } + if (Objects.isNull(size)) { + size = 1; + } + List list = new ArrayList<>(); + for (int i = 0; i < size; i++) { + list.add(new Customer(i, prefix + "" + random.nextInt(100),prefix + "" + random.nextInt(100))); + } + int result = repo.insert(list); + System.out.println("insert:" + "; " + prefix + "; actual = " + result + ", expect = " + list.size()); + return result; + } + + @RequestMapping("/init") + public String init() { + repo.init(); + System.out.println("init:" + LocalDateTime.now()); + return "pang"; + } + +} From 51a0143bc944cfe5a31c1d2d7914b519f3d2139f Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Mon, 23 May 2022 00:39:09 +0800 Subject: [PATCH 120/129] Jmeter config --- study-jmeter/README-MySQL.md | 51 ++++++++++++++++++++++++++++++- study-jmeter/jmx/jmeter-mysql.jmx | 18 ++++++----- 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/study-jmeter/README-MySQL.md b/study-jmeter/README-MySQL.md index de3e13e6f..02b717721 100644 --- a/study-jmeter/README-MySQL.md +++ b/study-jmeter/README-MySQL.md @@ -19,7 +19,7 @@ http://localhost:8080/mysql/query?key=josh 登陆 root mysql -uroot -p -查看当前最大连接数 +查看当前最大连接数[默认151?] show variables like 'max_connections'; 设置最大连接数 @@ -33,3 +33,52 @@ show status like 'Threads%'; + +### 过滤结果 + +只看错误结果树 + +勾选 Error + + + +### 常见错误 + +Jmeter 报错 + +``` +java.net.SocketException: Socket closed + +``` + +解决思路 + +参考链接: https://blog.csdn.net/weixin_44898291/article/details/119023467 + +如果在 HTTP Request Sampler 的 Basic 里勾选了Use KeepAlive,那么建议在 Advanced 页签下: + +1、Implementation 选为 HttpClient4 + +2、Timeouts 中的 Connect 一般设置一个10~60秒的值,表示连接的空闲超时时间,避免由于没收到被压测端的响应回来的 Keep-Alive 的 Header 导致的连接断开 + +这个值的单位是毫秒:15s*1000=15000s + + +Jmeter 报错 + +``` +java.net.SocketException: Too many open files + +``` + +解决思路 + +参考链接: https://www.jianshu.com/p/d6f7d1557f20 + +``` +查看 +launchctl limit + +更新 +sudo launchctl limit maxfiles 4096 unlimited +``` \ No newline at end of file diff --git a/study-jmeter/jmx/jmeter-mysql.jmx b/study-jmeter/jmx/jmeter-mysql.jmx index 74507514d..c6d079024 100644 --- a/study-jmeter/jmx/jmeter-mysql.jmx +++ b/study-jmeter/jmx/jmeter-mysql.jmx @@ -16,9 +16,9 @@ continue false - 100 + 2 - 100 + 2000 1 false @@ -41,12 +41,13 @@ true false - + HttpClient4 + 60000 - false + true saveConfig @@ -124,9 +125,9 @@ continue false - 100 + 2 - 100 + 1000 1 false @@ -149,12 +150,13 @@ true false - + HttpClient4 + 60000 - false + true saveConfig From f84753504462a061ee8555c9c4b89e1112e11338 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Tue, 24 May 2022 20:46:55 +0800 Subject: [PATCH 121/129] spring retisy --- study-summary/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/study-summary/README.md b/study-summary/README.md index 296a2088c..6ca1a98c4 100644 --- a/study-summary/README.md +++ b/study-summary/README.md @@ -12,6 +12,14 @@ Cauch 教练管理方式 代理: https://blog.csdn.net/lx1315998513/article/details/120641124 +## 员工找回?M + +Spring Security ,干掉profile 目录等 + +Spring Security 使用自定义 数据库表结构 + + + ## Mac 使用技巧 https://zhuanlan.zhihu.com/p/89987302 From 5402b9c1c355ac5ab1e452b06af39a1417484b76 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 25 May 2022 02:22:01 +0800 Subject: [PATCH 122/129] mac port --- study-summary/README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/study-summary/README.md b/study-summary/README.md index 6ca1a98c4..9715805b9 100644 --- a/study-summary/README.md +++ b/study-summary/README.md @@ -12,7 +12,9 @@ Cauch 教练管理方式 代理: https://blog.csdn.net/lx1315998513/article/details/120641124 -## 员工找回?M + + +## 员工找回 Spring Security ,干掉profile 目录等 @@ -23,6 +25,18 @@ Spring Security 使用自定义 数据库表结构 ## Mac 使用技巧 https://zhuanlan.zhihu.com/p/89987302 + + +查看端口占用: + +lsof -i:1234 + + + +58826 + + + ## 常用连接 https://github.com/0voice/interview_internal_reference From a366869b2365cc72a8bfecfdd669dcf671bd3816 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Wed, 25 May 2022 20:44:48 +0800 Subject: [PATCH 123/129] vue mac environment --- study-todo/README.md | 120 ----------------------------------- study-vue/README-vue-mac.md | 123 ++++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 120 deletions(-) create mode 100644 study-vue/README-vue-mac.md diff --git a/study-todo/README.md b/study-todo/README.md index b8ac52a28..5e1da918f 100644 --- a/study-todo/README.md +++ b/study-todo/README.md @@ -25,123 +25,3 @@ Docker 版本 -Mac 搭建vue环境 - -https://www.jianshu.com/p/a056e41833a7 - - - -## 安装HomeBrew - -https://docs.brew.sh - - - -安装 - -```bash -/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -``` - - - -验证 - -```undefined -brew -v -``` - - - -异常处理 - -```undefined -==> Homebrew has enabled anonymous aggregate formulae and cask analytics. -Read the analytics documentation (and how to opt-out) here: - https://docs.brew.sh/Analytics -No analytics data has been sent yet (nor will any be during this install run). - -==> Homebrew is run entirely by unpaid volunteers. Please consider donating: - https://github.com/Homebrew/brew#donations - -==> Next steps: -- Run these two commands in your terminal to add Homebrew to your PATH: - echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/bage/.zprofile - eval "$(/opt/homebrew/bin/brew shellenv)" -- Run brew help to get started -- Further documentation: - https://docs.brew.sh -``` - - - -补充安装 - -```undefined -echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/bage/.zprofile - -eval "$(/opt/homebrew/bin/brew shellenv)" -``` - - - -## 安装 node - -安装 - -```undefined -brew install nodejs -``` - -验证 - -```undefined -node -v -``` - - - - - -## 安装 vue - -安装 - -```undefined -npm install --global vue-cli - -npm install --global vue-cli@3.0.1 -``` - -验证 - -```undefined -vue -V -``` - -适当更新版本 - -```undefined -npm install -g npm@8.10.0 -``` - - - -## 安装 yarn - -安装 - -```undefined -brew install yarn -``` - -验证 - -```undefined -yarn -V -``` - - - - - diff --git a/study-vue/README-vue-mac.md b/study-vue/README-vue-mac.md new file mode 100644 index 000000000..a74ee48bc --- /dev/null +++ b/study-vue/README-vue-mac.md @@ -0,0 +1,123 @@ +# study-vue-Mac # + + +Mac 搭建vue环境 + +https://www.jianshu.com/p/a056e41833a7 + + + +## 安装HomeBrew + +https://docs.brew.sh + + + +安装 + +```bash +/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +``` + + + +验证 + +```undefined +brew -v +``` + + + +异常处理 + +```undefined +==> Homebrew has enabled anonymous aggregate formulae and cask analytics. +Read the analytics documentation (and how to opt-out) here: + https://docs.brew.sh/Analytics +No analytics data has been sent yet (nor will any be during this install run). + +==> Homebrew is run entirely by unpaid volunteers. Please consider donating: + https://github.com/Homebrew/brew#donations + +==> Next steps: +- Run these two commands in your terminal to add Homebrew to your PATH: + echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/bage/.zprofile + eval "$(/opt/homebrew/bin/brew shellenv)" +- Run brew help to get started +- Further documentation: + https://docs.brew.sh +``` + + + +补充安装 + +```undefined +echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/bage/.zprofile + +eval "$(/opt/homebrew/bin/brew shellenv)" +``` + + + +## 安装 node + +安装 + +```undefined +brew install nodejs +``` + +验证 + +```undefined +node -v +``` + + + + + +## 安装 vue + +安装 + +```undefined +npm install --global vue-cli + +npm install --global vue-cli@3.0.1 +``` + +验证 + +```undefined +vue -V +``` + +适当更新版本 + +```undefined +npm install -g npm@8.10.0 +``` + + + +## 安装 yarn + +安装 + +```undefined +brew install yarn +``` + +验证 + +```undefined +yarn -V +``` + + + + + From 38091dc8c1a0e203e0f4a6744e0d6651fa6b5114 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Thu, 26 May 2022 00:26:00 +0800 Subject: [PATCH 124/129] message --- study-todo/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/study-todo/README.md b/study-todo/README.md index 5e1da918f..af1b18fd6 100644 --- a/study-todo/README.md +++ b/study-todo/README.md @@ -23,5 +23,13 @@ Docker 版本 +API 方法 VS Logic 直接调用 + +Message Bus 抽取发送邮件方法 + + + + + From 81a09a076dcb6535e9aa3ef375d59a80ac03e1d4 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Fri, 27 May 2022 14:38:44 +0800 Subject: [PATCH 125/129] vue admin --- study-todo/README.md | 16 ++++++++++++++++ study-vue/README-vue-mac.md | 16 ++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/study-todo/README.md b/study-todo/README.md index af1b18fd6..ed0df9bb3 100644 --- a/study-todo/README.md +++ b/study-todo/README.md @@ -29,6 +29,22 @@ Message Bus 抽取发送邮件方法 +Auth Server 设置自定义User ID字段 + + + +yarn 配置淘宝 链接 + + + +vue 选型 + +目前采用: element plus + +https://element-plus.gitee.io/zh-CN/guide/design.html + + + diff --git a/study-vue/README-vue-mac.md b/study-vue/README-vue-mac.md index a74ee48bc..2a6c23443 100644 --- a/study-vue/README-vue-mac.md +++ b/study-vue/README-vue-mac.md @@ -87,6 +87,9 @@ node -v npm install --global vue-cli npm install --global vue-cli@3.0.1 + +npm config set registry https://registry.npm.taobao.org + ``` 验证 @@ -109,6 +112,17 @@ npm install -g npm@8.10.0 ```undefined brew install yarn + +yarn global add vue-cli + +``` + +设置淘宝镜像 + +``` +yarn config set registry http://registry.npm.taobao.org/ + + ``` 验证 @@ -119,5 +133,3 @@ yarn -V - - From 63fbe0128033b10ac159bdcaf25e4481faf1bb37 Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Fri, 27 May 2022 21:53:51 +0800 Subject: [PATCH 126/129] vue route --- study-todo/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/study-todo/README.md b/study-todo/README.md index ed0df9bb3..c000ca09b 100644 --- a/study-todo/README.md +++ b/study-todo/README.md @@ -45,6 +45,16 @@ https://element-plus.gitee.io/zh-CN/guide/design.html +vue 使用route + +https://cn.vuejs.org/v2/guide/routing.html + +https://router.vuejs.org/zh/guide/#javascript + +https://github.com/chrisvfritz/vue-2.0-simple-routing-example/ + + + From ea004804ed30a511658abaa060b989fcefda990e Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sat, 28 May 2022 16:18:59 +0800 Subject: [PATCH 127/129] docker elk --- study-docker/README.md | 56 +++++++++++++++++++---- study-todo/README.md | 101 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 149 insertions(+), 8 deletions(-) diff --git a/study-docker/README.md b/study-docker/README.md index 5ad0ec85d..d89a22fa2 100644 --- a/study-docker/README.md +++ b/study-docker/README.md @@ -41,6 +41,30 @@ Most users set up Docker’s repositories and install from them, for ease of ins 配置开机启动 > systemctl enable docker + + +docker hub 设置国内镜像地址 + +https://www.csdn.net/tags/NtzaMgzsNDA4Ni1ibG9n.html + +在任务栏点击 Docker Desktop 应用图标 -> Perferences,在左侧导航菜单选择 Docker Engine,在右侧像下边一样编辑 json 文件。修改完成之后,点击 Apply & Restart 按钮,Docker 就会重启并应用配置的镜像地址了。 + +```json +{ + "registry-mirrors": [ + "https://9cpn8tt6.mirror.aliyuncs.com", + "https://hub-mirror.c.163.com", + "https://registry.docker-cn.com" + ] +} +``` + +验证 + +``` +docker info +``` + ## 常用命令 ## ### Docker ### @@ -397,23 +421,27 @@ Docker Pull Command Docker Pull Command docker pull elasticsearch:7.5.1 + + Mac M1 + docker pull elasticsearch:7.16.2 + + 启动 docker run --network myapp --name elasticsearch -p 9092:9200 -p 8093:9300 -e "discovery.type=single-node" elasticsearch:7.5.1 + + Mac + docker run --network myapp --name elasticsearch -p 9092:9200 -p 8093:9300 -e "discovery.type=single-node" elasticsearch:7.11.1 - - - - - - - 访问 http://{ip}:9092/_cat/health + + http://127.0.0.1:9092/_cat/health + http://127.0.0.1:8093/_cat/health ### 安装部署 zipkin ### @@ -714,6 +742,7 @@ start a instance + ### 安装配置 logstash ### 版本匹配 https://www.elastic.co/cn/support/matrix#matrix_compatibility 参考链接:[https://www.elastic.co/guide/en/logstash/current/docker.html](https://www.elastic.co/guide/en/logstash/current/docker.html)、[https://hub.docker.com/_/logstash?tab=description](https://hub.docker.com/_/logstash?tab=description)、[https://www.elastic.co/guide/en/logstash/current/docker-config.html](https://www.elastic.co/guide/en/logstash/current/docker-config.html) @@ -721,6 +750,9 @@ start a instance Docker Pull Command docker pull logstash:7.5.1 + + Mac M1 + docker pull logstash:7.16.2 start a instance[not enough space] @@ -741,6 +773,7 @@ setting max_map_count sudo sysctl -w vm.max_map_count=262144 vi /home/bage/data/logstash/file-beats.conf + [Mac: /Users/bage/bage/docker-data/elk/logstash/beats-input.conf] ``` @@ -801,8 +834,11 @@ start a instance docker run -v /home/bage/data/logstash/file-beats.conf:/etc/logstash/conf.d/02-beats-input.conf -p 8056:5601 -p 8092:9200 -p 8044:5044 -it --name elk sebp/elk:700 Mac: - docker run -v /Users/bage/bage/docker-data/elk/es:/var/lib/elasticsearch /Users/bage/bage/docker-data/elk/logstash/beats-input.conf:/etc/logstash/conf.d/02-beats-input.conf -p 8056:5601 -p 8092:9200 -p 8044:5044 -it --name elk sebp/elk:700 + docker run -v /Users/bage/bage/docker-data/elk/logstash/beats-input.conf:/etc/logstash/conf.d/02-beats-input.conf -p 8056:5601 -p 8092:9200 -p 8044:5044 -it --name elk sebp/elk:700 + Mac[多目录挂载问题]: + docker run -e MAX_MAP_COUNT="262144" -v /Users/bage/bage/docker-data/elk/es:/var/lib/elasticsearch -v /Users/bage/bage/docker-data/elk/logstash/beats-input.conf:/etc/logstash/conf.d/02-beats-input.conf -p 8056:5601 -p 8092:9200 -p 8044:5044 -it --name elk sebp/elk:700 + 访问 @@ -824,6 +860,10 @@ kibana Docker Pull Command docker pull kibana:7.5.1 + + Mac + docker pull kibana:7.16.2 + start a instance diff --git a/study-todo/README.md b/study-todo/README.md index c000ca09b..30cd5132d 100644 --- a/study-todo/README.md +++ b/study-todo/README.md @@ -55,7 +55,108 @@ https://github.com/chrisvfritz/vue-2.0-simple-routing-example/ +统一校验登陆状态; +后端,,, + +文件上传-待自测 + +、消息服务 ,进行实现 + + + +### docker 安装ELK + +#### 设置国内镜像 + +参考链接: https://www.csdn.net/tags/NtzaMgzsNDA4Ni1ibG9n.html + +**操作步骤** + +Docker Desktop 应用图标 -> Perferences,在左侧导航菜单选择 Docker Engine,在右侧像下边一样编辑 json 文件。修改完成之后,点击 Apply & Restart 按钮,Docker 就会重启并应用配置的镜像地址了。 + +```json +{ + "registry-mirrors": [ + "https://9cpn8tt6.mirror.aliyuncs.com", + "https://hub-mirror.c.163.com", + "https://registry.docker-cn.com" + ] +} +``` + +验证 + +``` +docker info +``` + +## + +### 安装ES + +Docker Pull Command + +``` +docker pull elasticsearch:7.16.2 + +``` + +启动 + +``` +docker run --network myapp --name elasticsearch -p 9092:9200 -p 8093:9300 -e "discovery.type=single-node" elasticsearch:7.16.2 +``` + + 访问 + +``` +http://127.0.0.1:9092/_cat/health +http://127.0.0.1:8093/_cat/health +``` + +### 安装kibana + +Docker Pull Command + +``` +docker pull kibana:7.16.2 + +``` + +start a instance + +``` +docker run --network myapp -it -d -e ELASTICSEARCH_URL=http://elasticsearch:9092/ --name kibana -p 9056:5601 kibana:7.16.2 +``` + +自定义配置文件 + +``` +-v /usr/local/es/es.yml:/usr/share/elasticsearch/config/elasticsearch.yml +``` + +visit + +``` +http://192.168.146.133:5601/app/kibana +``` + +### 安装 logstash + +Docker Pull Command + +``` +docker pull logstash:7.16.2 +``` + +start a instance[not enough space] + +``` +docker run --name logstash --rm -it -v /home/bage/data/pipeline/:/usr/share/logstash/pipeline/ logstash:7.16.2 +``` + +### From f403ff943ec7973c14387e424688d5104a7f4b7f Mon Sep 17 00:00:00 2001 From: bage <893542907@qq.com> Date: Sun, 29 May 2022 00:27:42 +0800 Subject: [PATCH 128/129] spring boot log 2 elk --- pom.xml | 1 + study-docker/README.md | 33 ---- study-spring-boot-elk/pom.xml | 84 ++++++++++ .../main/java/com/bage/ElkApplication.java | 55 ++++++ .../src/main/resources/application.yml | 3 + .../src/main/resources/logback.xml | 65 ++++++++ study-todo/README.md | 157 ++++++++++++++++-- 7 files changed, 355 insertions(+), 43 deletions(-) create mode 100644 study-spring-boot-elk/pom.xml create mode 100644 study-spring-boot-elk/src/main/java/com/bage/ElkApplication.java create mode 100644 study-spring-boot-elk/src/main/resources/application.yml create mode 100644 study-spring-boot-elk/src/main/resources/logback.xml diff --git a/pom.xml b/pom.xml index db6429800..0942fd85d 100644 --- a/pom.xml +++ b/pom.xml @@ -156,6 +156,7 @@ study-jol study-servlet study-lombok + study-spring-boot-elk \ No newline at end of file diff --git a/study-docker/README.md b/study-docker/README.md index d89a22fa2..ac0d1e7e8 100644 --- a/study-docker/README.md +++ b/study-docker/README.md @@ -794,39 +794,7 @@ output { } ``` -``` -# 数据输入配置:port -> 端口号;codec -> 输入格式。这里以logback为例。 -input { - tcp { - port => 5044 - codec=>json_lines - } -} -# 数据输出配置:hosts -> 主机集合;index -> 你将要创建的索引名称。这里es为例。 -output { - elasticsearch { - hosts => ["127.0.0.1:9200"] - index => "%{[appName]}-%{+YYYY.MM.dd}" - } -} -``` - - # 数据输入配置:port -> 端口号;codec -> 输入格式。这里以logback为例。 - input { - tcp { - port => 5044 - codec=>json_lines - } - } - - # 数据输出配置:hosts -> 主机集合;index -> 你将要创建的索引名称。这里es为例。 - output { - elasticsearch { - hosts => ["127.0.0.1:9200"] - index => "%{[appName]}-%{+YYYY.MM.dd}" - } - } start a instance @@ -839,7 +807,6 @@ start a instance Mac[多目录挂载问题]: docker run -e MAX_MAP_COUNT="262144" -v /Users/bage/bage/docker-data/elk/es:/var/lib/elasticsearch -v /Users/bage/bage/docker-data/elk/logstash/beats-input.conf:/etc/logstash/conf.d/02-beats-input.conf -p 8056:5601 -p 8092:9200 -p 8044:5044 -it --name elk sebp/elk:700 - 访问 ES diff --git a/study-spring-boot-elk/pom.xml b/study-spring-boot-elk/pom.xml new file mode 100644 index 000000000..1f8087af1 --- /dev/null +++ b/study-spring-boot-elk/pom.xml @@ -0,0 +1,84 @@ + + + + 4.0.0 + + com.bage + study-spring-boot-elk + 0.0.1-SNAPSHOT + + study-spring-boot-elk + + http://www.example.com + + + + UTF-8 + 1.8 + 1.8 + 2.0.1.RELEASE + springio + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-log4j2 + + + org.springframework.boot + spring-boot-starter-test + + + + + net.logstash.logback + logstash-logback-encoder + 5.1 + + + + + + + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring.boot.base.version} + pom + import + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + diff --git a/study-spring-boot-elk/src/main/java/com/bage/ElkApplication.java b/study-spring-boot-elk/src/main/java/com/bage/ElkApplication.java new file mode 100644 index 000000000..36b145dc7 --- /dev/null +++ b/study-spring-boot-elk/src/main/java/com/bage/ElkApplication.java @@ -0,0 +1,55 @@ +/* + * Copyright 2013-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.bage; + + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.web.client.RestTemplate; + +import java.time.LocalDateTime; + +/** + * @author lrh + */ +@SpringBootApplication +public class ElkApplication implements CommandLineRunner { + + private static final Logger log = LoggerFactory.getLogger(ElkApplication.class); + + + public static void main(String[] args) { + SpringApplication.run(ElkApplication.class, args); + } + + @Bean + public RestTemplate restTemplate() { + return new RestTemplate(); + } + + @Override + public void run(String... args) throws Exception { + for (int i = 0; i < 1000; i++) { + Thread.sleep(3000L); + log.info("run: {}", LocalDateTime.now().toString()); + } + } +} \ No newline at end of file diff --git a/study-spring-boot-elk/src/main/resources/application.yml b/study-spring-boot-elk/src/main/resources/application.yml new file mode 100644 index 000000000..6cae837b9 --- /dev/null +++ b/study-spring-boot-elk/src/main/resources/application.yml @@ -0,0 +1,3 @@ +spring: + application: + name: hello-hhh diff --git a/study-spring-boot-elk/src/main/resources/logback.xml b/study-spring-boot-elk/src/main/resources/logback.xml new file mode 100644 index 000000000..4122587df --- /dev/null +++ b/study-spring-boot-elk/src/main/resources/logback.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + INFO + + + + ${CONSOLE_LOG_PATTERN} + utf8 + + + + + + 127.0.0.1:8044 + + + + + UTC + + + + { + "severity": "%level", + "appName":"${springAppName:-}", + "service": "${springAppName:-}", + "trace": "%X{X-B3-TraceId:-}", + "span": "%X{X-B3-SpanId:-}", + "exportable": "%X{X-Span-Export:-}", + "pid": "${PID:-}", + "thread": "%thread", + "class": "%logger{40}", + "rest": "%message" + } + + + + + + + + + + + + + \ No newline at end of file diff --git a/study-todo/README.md b/study-todo/README.md index 30cd5132d..b367d614a 100644 --- a/study-todo/README.md +++ b/study-todo/README.md @@ -63,6 +63,12 @@ https://github.com/chrisvfritz/vue-2.0-simple-routing-example/ 、消息服务 ,进行实现 +spring boot 日子打到ELK - done + + + + + ### docker 安装ELK @@ -100,21 +106,52 @@ Docker Pull Command ``` docker pull elasticsearch:7.16.2 +``` + +创建基础目录 + +``` +mkdir /Users/bage/bage/docker-data/es + +bage % pwd +/Users/bage/bage/docker-data/es + +bage % ls +config data nodes plugins +``` + +编辑文件 + +``` +vi /Users/bage/bage/docker-data/es/config/elasticearch.yml + + ``` 启动 ``` -docker run --network myapp --name elasticsearch -p 9092:9200 -p 8093:9300 -e "discovery.type=single-node" elasticsearch:7.16.2 +docker run --network myapp --name bage-es -p 9092:9200 -p 8093:9300 \ +-e "discovery.type=single-node" \ +-v /Users/bage/bage/docker-data/es/config/elasticearch.yml:/usr/share/elasticsearch/config/elasticearch.yml \ +-v /Users/bage/bage/docker-data/es/data:/usr/share/elasticsearch/data \ +-v /Users/bage/bage/docker-data/es/plugins:/usr/share/elasticsearch/plugins \ +-d elasticsearch:7.16.2 + ``` 访问 ``` http://127.0.0.1:9092/_cat/health -http://127.0.0.1:8093/_cat/health +http://127.0.0.1:9092 + +查看索引 +http://localhost:9092/_cat/indices?v&pretty ``` + + ### 安装kibana Docker Pull Command @@ -124,39 +161,139 @@ docker pull kibana:7.16.2 ``` -start a instance +创建基础目录 ``` -docker run --network myapp -it -d -e ELASTICSEARCH_URL=http://elasticsearch:9092/ --name kibana -p 9056:5601 kibana:7.16.2 +mkdir /Users/bage/bage/docker-data/kibana + +bage % pwd +/Users/bage/bage/docker-data/kibana + +bage % ls +config ``` -自定义配置文件 +编辑文件[暂时不使用] ``` --v /usr/local/es/es.yml:/usr/share/elasticsearch/config/elasticsearch.yml +/Users/bage/bage/docker-data/kibana/config/kibana.yml + +server.port: 8056 +server.host: "0.0.0.0" +elasticsearch.url: "http://bage-es:9092" + +``` + +start a instance + +``` +docker run --network myapp -d --link bage-es:elasticsearch -p 9056:5601 --name bage-kibana \ +-d kibana:7.16.2 + ``` visit ``` -http://192.168.146.133:5601/app/kibana +http://127.0.0.1:9056/app/kibana + +http://127.0.0.1:9056/app/kibana#/dev_tools/console ``` +**kibana里建立索引** + +通过kiban菜单去建立索引:Management>Index patterns>Create index pattern,这里会显示可用的索引名称。 + +可以直接搜索 index 找到 Create index pattern + + + +选择对应的索引 + + + +Discover 里面创建 看板 + ### 安装 logstash +参考链接 https://www.elastic.co/guide/en/logstash/7.17/docker.html + +https://github.com/elastic/logstash/blob/7.17/config/logstash.yml + Docker Pull Command ``` docker pull logstash:7.16.2 ``` -start a instance[not enough space] +创建基础目录 + +``` +mkdir /Users/bage/bage/docker-data/logstash + +bage % pwd +/Users/bage/bage/docker-data/logstash + +bage % ls +pipeline config ``` -docker run --name logstash --rm -it -v /home/bage/data/pipeline/:/usr/share/logstash/pipeline/ logstash:7.16.2 + +编辑文件 + ``` +vi /Users/bage/bage/docker-data/logstash/config/logstash.yml -### +http.host: "0.0.0.0" +# xpack.monitoring.elasticsearch.hosts: ["http://bage-es:9092"] +monitoring.elasticsearch.hosts: ["http://bage-es:9092"] +# path.config: /usr/share/logstash/config/conf.d/*.conf +# path.logs: /usr/share/logstash/logs +``` + + + +``` +vi /Users/bage/bage/docker-data/logstash/pipeline/logstash.conf + +# Sample Logstash configuration for creating a simple +# Beats -> Logstash -> Elasticsearch pipeline. + +input { + tcp { + mode => "server" + port => 5044 + codec => json_lines + stat_interval => "5" + } +} + +output { + elasticsearch { + hosts => ["http://bage-es:9200"] + index => "{{indexName}}" + #user => "elastic" + #password => "changeme" + } +} + +``` + +start a instance + +``` +docker run --network myapp --name=bage-logstash \ +-p 8056:5601 \ +-p 8044:5044 \ +-v /Users/bage/bage/docker-data/logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml \ +-v /Users/bage/bage/docker-data/logstash/pipeline/:/usr/share/logstash/pipeline/ \ +-d logstash:7.16.2 + + +docker run --name bage-logstash --network myapp -p 8056:5601 --link bage-es:elasticsearch -d logstash:7.16.2 + +``` +### 访问 From 0d58883ef249cc5a6a903d966183235c2f7b9676 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 28 May 2022 16:28:27 +0000 Subject: [PATCH 129/129] Bump spring-core in /study-springmvc-xml Bumps [spring-core](https://github.com/spring-projects/spring-framework) from 4.3.9.RELEASE to 5.2.22.RELEASE. - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v4.3.9.RELEASE...v5.2.22.RELEASE) --- updated-dependencies: - dependency-name: org.springframework:spring-core dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- study-springmvc-xml/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/study-springmvc-xml/pom.xml b/study-springmvc-xml/pom.xml index c6b62aabb..36c97ee5b 100644 --- a/study-springmvc-xml/pom.xml +++ b/study-springmvc-xml/pom.xml @@ -14,7 +14,7 @@ UTF-8 - 4.3.9.RELEASE + 5.2.22.RELEASE UTF-8 3.0-alpha-1 2.1