This commit is contained in:
Redkale
2017-05-24 17:57:23 +08:00
parent 0ea4ddb5eb
commit 71c0763304
2 changed files with 11 additions and 4 deletions

View File

@@ -149,8 +149,15 @@ public final class Rest {
final String resourceGenericDescriptor = sb1.length() == sb2.length() ? null : sb2.toString();
//----------------------------------------------------------------------------------------
final Map<String, List<String>> asmParamMap = MethodParamClassVisitor.getMethodParamNames(webSocketType);
final Set<String> messageNames = new HashSet<>();
for (Method method : webSocketType.getMethods()) {
RestOnMessage rom = method.getAnnotation(RestOnMessage.class);
if (rom == null) continue;
String name = rom.name();
if (name.isEmpty()) throw new RuntimeException(method + " RestOnMessage.name is empty createRestWebSocketServlet");
if (messageNames.contains(name)) throw new RuntimeException(method + " repeat RestOnMessage.name(" + name + ") createRestWebSocketServlet");
messageNames.add(name);
}
//----------------------------------------------------------------------------------------

View File

@@ -28,7 +28,7 @@ public @interface RestOnMessage {
*
* @return String
*/
String name() default "";
String name();
/**
* 备注描述