Browse Source
Merge in CORE/base-third from ~ELIJAH/base-third:feature/10.0 to feature/10.0 * commit 'c31c9160cd586194f43fe457604611dd410929a1': KERNEL-7725 feat: websocket提供全局拦截器feature/10.0
Elijah
4 years ago
4 changed files with 136 additions and 1 deletions
@ -0,0 +1,27 @@
|
||||
package com.fr.third.socketio.listener.interceptor; |
||||
|
||||
import com.fr.third.socketio.AckRequest; |
||||
import com.fr.third.socketio.SocketIOClient; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Desc |
||||
* |
||||
* @author Elijah |
||||
* created on 2021-04-26 |
||||
*/ |
||||
public interface EventInterceptor extends Interceptor { |
||||
default void before(SocketIOClient client, List<Object> params, AckRequest ackRequest){ |
||||
before(client); |
||||
} |
||||
|
||||
default void after(SocketIOClient client, List<Object> params, AckRequest ackRequest){ |
||||
after(client); |
||||
} |
||||
|
||||
default boolean accept(String eventName, SocketIOClient client, List<Object> param){ |
||||
return accept(client); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,23 @@
|
||||
package com.fr.third.socketio.listener.interceptor; |
||||
|
||||
import com.fr.third.socketio.SocketIOClient; |
||||
|
||||
/** |
||||
* Desc |
||||
* |
||||
* @author Elijah |
||||
* created on 2021-05-06 |
||||
*/ |
||||
public interface Interceptor { |
||||
default void before(SocketIOClient client){ |
||||
|
||||
} |
||||
|
||||
default void after(SocketIOClient client){ |
||||
|
||||
} |
||||
|
||||
default boolean accept(SocketIOClient client){ |
||||
return true; |
||||
} |
||||
} |
Loading…
Reference in new issue