+ * PS: 这里约定传递的消息为JSON字符串 方便传递更多参数!
+ */
+ @OnMessage
+ public void onSocketMessage(Session session, String jsonStr) {
+ }
+
+ /**
+ * 当关闭连接:1.移除会话对象 2.更新在线人数
+ */
+ @OnClose
+ public void onClose(Session session) {
+ onlineSessions.remove(session.getId());
+ System.out.println("websocket客户端"+session.getId()+"断开连接");
+ }
+
+ /**
+ * 当通信发生异常:打印错误日志
+ */
+ @OnError
+ public void onError(Session session, Throwable error) {
+ error.printStackTrace();
+ }
+
+ /**
+ * 公共方法:发送信息给所有人
+ */
+ public void sendSocketMessageToAll(String msg) {
+ onlineSessions.forEach((id, session) -> {
+ try {
+ session.getBasicRemote().sendText(msg);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ });
+ }
+}
diff --git a/src/main/resources/static/echarts.min.js b/src/main/resources/static/echarts.min.js
new file mode 100644
index 0000000..93526e1
--- /dev/null
+++ b/src/main/resources/static/echarts.min.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).echarts={})}(this,function(t){"use strict";var m=function(t,e){return(m=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}))(t,e)};function u(t,e){function n(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var v=function(){return(v=Object.assign||function(t){for(var e,n=1,i=arguments.length;n>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",r[u]+":0",i[1-l]+":auto",r[1-u]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}}return n}(e,o),o,r);if(e)return e(t,n,i),!0}return!1}function ue(t){return"CANVAS"===t.nodeName.toUpperCase()}var he="undefined"!=typeof window&&!!window.addEventListener,ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,pe=[];function de(t,e,n,i){return n=n||{},i||!w.canvasSupported?fe(t,e,n):w.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):fe(t,e,n),n}function fe(t,e,n){if(w.domSupported&&t.getBoundingClientRect){var i,r=e.clientX,e=e.clientY;if(ue(t))return i=t.getBoundingClientRect(),n.zrX=r-i.left,void(n.zrY=e-i.top);if(le(pe,t,r,e))return n.zrX=pe[0],void(n.zrY=pe[1])}n.zrX=n.zrY=0}function ge(t){return t||window.event}function ye(t,e,n){var i;return null==(e=ge(e)).zrX&&((i=e.type)&&0<=i.indexOf("touch")?(i=("touchend"!==i?e.targetTouches:e.changedTouches)[0])&&de(t,i,e,n):(de(t,e,e,n),i=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,t=t.deltaY;return null!=n&&null!=t?3*(0!==t?Math.abs(t):Math.abs(n))*(0 e)return t[i];return t[n-1]}var Xp,qp="\0_ec_inner",jp=(u(s,Xp=lc),s.prototype.init=function(t,e,n,i,r,o){i=i||{},this.option=null,this._theme=new lc(i),this._locale=new lc(r),this._optionManager=o},s.prototype.setOption=function(t,e,n){e=$p(e);this._optionManager.setOption(t,n,e),this._resetOption(null,e)},s.prototype.resetOption=function(t,e){return this._resetOption(t,$p(e))},s.prototype._resetOption=function(t,e){var n,i=!1,r=this._optionManager;return t&&"recreate"!==t||(n=r.mountOption("recreate"===t),this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(n,e)):Hp(this,n),i=!0),"timeline"!==t&&"media"!==t||this.restoreData(),t&&"recreate"!==t&&"timeline"!==t||(n=r.getTimelineOption(this))&&(i=!0,this._mergeOption(n,e)),t&&"recreate"!==t&&"media"!==t||(n=r.getMediaOption(this)).length&&N(n,function(t){i=!0,this._mergeOption(t,e)},this),i},s.prototype.mergeOption=function(t){this._mergeOption(t,null)},s.prototype._mergeOption=function(i,t){var r=this.option,u=this._componentsMap,h=this._componentsCount,n=[],o=L(),c=t&&t.replaceMergeMainTypeMap;Op(this).datasetMap=L(),N(i,function(t,e){null!=t&&(g.hasClass(e)?e&&(n.push(e),o.set(e,!0)):r[e]=null==r[e]?C(t):p(r[e],t,!0))}),c&&c.each(function(t,e){g.hasClass(e)&&!o.get(e)&&(n.push(e),o.set(e,!0))}),g.topologicalTravel(n,g.getAllClassMainTypes(),function(o){var t=function(t,e,n){return(e=(e=zp.get(e))&&e(t))?n.concat(e):n}(this,o,Rr(i[o])),e=u.get(o),n=e?c&&c.get(o)?"replaceMerge":"normalMerge":"replaceAll",e=zr(e,t,n),a=(Ur(e,o,g),r[o]=null,u.set(o,null),h.set(o,0),[]),s=[],l=0;N(e,function(t,e){var n=t.existing,i=t.newOption;if(i){var r=g.getClass(o,t.keyInfo.subType,!("series"===o));if(!r)return;n&&n.constructor===r?(n.name=t.keyInfo.name,n.mergeOption(i,this),n.optionUpdated(i,!1)):(e=I({componentIndex:e},t.keyInfo),I(n=new r(i,this,this,e),e),t.brandNew&&(n.__requireNewView=!0),n.init(i,this,this),n.optionUpdated(null,!0))}else n&&(n.mergeOption({},this),n.optionUpdated({},!1));n?(a.push(n.option),s.push(n),l++):(a.push(void 0),s.push(void 0))},this),r[o]=a,u.set(o,s),h.set(o,l),"series"===o&&Fp(this)},this),this._seriesIndices||Fp(this)},s.prototype.getOption=function(){var a=C(this.option);return N(a,function(t,e){if(g.hasClass(e)){for(var n=Rr(t),i=n.length,r=!1,o=i-1;0<=o;o--)n[o]&&!Wr(n[o])?r=!0:(n[o]=null,r||i--);n.length=i,a[e]=n}}),delete a[qp],a},s.prototype.getTheme=function(){return this._theme},s.prototype.getLocaleModel=function(){return this._locale},s.prototype.getLocale=function(t){return this.getLocaleModel().get(t)},s.prototype.setUpdatePayload=function(t){this._payload=t},s.prototype.getUpdatePayload=function(){return this._payload},s.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){t=n[e||0];if(t)return t;if(null==e)for(var i=0;i=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},jn.prototype.clone=function(){return new jn(this.x,this.y,this.width,this.height)},jn.prototype.copy=function(t){jn.copy(this,t)},jn.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},jn.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},jn.prototype.isZero=function(){return 0===this.width||0===this.height},jn.create=function(t){return new jn(t.x,t.y,t.width,t.height)},jn.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},jn.applyTransform=function(t,e,n){var i,r,o,a;n?n[1]<1e-5&&-1e-5
@@ -390,15 +403,7 @@
-
-
-
-
-
-
-
-