diff --git a/src/org/redkale/net/http/RestOnMessage.java b/src/org/redkale/net/http/RestOnMessage.java
new file mode 100644
index 000000000..c664f5068
--- /dev/null
+++ b/src/org/redkale/net/http/RestOnMessage.java
@@ -0,0 +1,39 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.redkale.net.http;
+
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * 标记在RestWebSocket的接收消息方法上
+ *
+ *
+ * 详情见: https://redkale.org
+ *
+ * @author zhangjx
+ */
+@Inherited
+@Documented
+@Target({METHOD})
+@Retention(RUNTIME)
+public @interface RestOnMessage {
+
+ /**
+ * 请求的方法名, 不能含特殊字符
+ *
+ * @return String
+ */
+ String name() default "";
+
+ /**
+ * 备注描述
+ *
+ * @return String
+ */
+ String comment() default "";
+}
diff --git a/src/org/redkale/net/http/RestOnOpen.java b/src/org/redkale/net/http/RestOnOpen.java
new file mode 100644
index 000000000..8f97b3970
--- /dev/null
+++ b/src/org/redkale/net/http/RestOnOpen.java
@@ -0,0 +1,32 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.redkale.net.http;
+
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * 标记在RestWebSocket的方法上
+ *
+ *
+ * 详情见: https://redkale.org + * + * @author zhangjx + */ +@Inherited +@Documented +@Target({METHOD}) +@Retention(RUNTIME) +public @interface RestOnOpen { + + /** + * 备注描述 + * + * @return String + */ + String comment() default ""; +} diff --git a/src/org/redkale/net/http/RestWebSocket.java b/src/org/redkale/net/http/RestWebSocket.java new file mode 100644 index 000000000..1e7d149cc --- /dev/null +++ b/src/org/redkale/net/http/RestWebSocket.java @@ -0,0 +1,52 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.redkale.net.http; + +import java.lang.annotation.*; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * 只能依附在WebSocket类上,name默认为Service的类名小写并去掉Service字样及后面的字符串 (如HelloWebSocket/HelloWebSocketImpl,的默认路径为 hello)。 + *
+ * 详情见: https://redkale.org
+ *
+ * @author zhangjx
+ */
+@Inherited
+@Documented
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface RestWebSocket {
+
+ /**
+ * 模块名, 只能是模块名,不能含特殊字符, 只能小写字母+数字,且不能以数字开头
+ *
+ * @return 模块名
+ */
+ String name() default "";
+
+ /**
+ * 是否屏蔽该类的转换
+ *
+ * @return 默认false
+ */
+ boolean ignore() default false;
+
+ /**
+ * 同@WebServlet的repair属性
+ *
+ * @return 默认true
+ */
+ boolean repair() default true;
+
+ /**
+ * 备注描述
+ *
+ * @return 备注描述
+ */
+ String comment() default "";
+}
diff --git a/src/org/redkale/net/http/WebSocket.java b/src/org/redkale/net/http/WebSocket.java
index eb85ccee8..6d3be2774 100644
--- a/src/org/redkale/net/http/WebSocket.java
+++ b/src/org/redkale/net/http/WebSocket.java
@@ -368,7 +368,7 @@ public abstract class WebSocket
- * 详情见: https://redkale.org
- *
- * @author zhangjx
- */
-public interface WebSocketService {
-
- public CompletableFuture
- * 详情见: https://redkale.org
- *
- * @author zhangjx
- */
- @Inherited
- @Documented
- @Target({METHOD})
- @Retention(RUNTIME)
- public @interface RestOnMessage {
-
- /**
- * 请求的方法名, 不能含特殊字符
- *
- * @return String
- */
- String name() default "";
-
- /**
- * 备注描述
- *
- * @return String
- */
- String comment() default "";
- }
-
- /**
- * 标记在WebSocketService的方法上
- *
- *
- * 详情见: https://redkale.org
- *
- * @author zhangjx
- */
- @Inherited
- @Documented
- @Target({METHOD})
- @Retention(RUNTIME)
- public @interface RestOnOpen {
-
- /**
- * 备注描述
- *
- * @return String
- */
- String comment() default "";
- }
-
- /**
- * 标记在WebSocketService的RestOnMessage方法的boolean参数上
- *
- *
- * 详情见: https://redkale.org
- *
- * @author zhangjx
- */
- @Inherited
- @Documented
- @Target({PARAMETER})
- @Retention(RUNTIME)
- public @interface RestMessageLast {
- }
-
-}