Added enums and infrastructure for different types of ws messages
built newest epq-web application bundle to static
This commit is contained in:
parent
621826ef46
commit
77366f30cc
15 changed files with 39 additions and 17 deletions
4
src/main/java/me/imsonmia/epqapi/config/SqlConfig.java
Normal file
4
src/main/java/me/imsonmia/epqapi/config/SqlConfig.java
Normal file
|
@ -0,0 +1,4 @@
|
|||
package me.imsonmia.epqapi.config;
|
||||
|
||||
public interface SqlConfig {
|
||||
}
|
|
@ -17,5 +17,6 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
|
|||
@Override
|
||||
public void registerStompEndpoints(StompEndpointRegistry registry) {
|
||||
registry.addEndpoint("/ws").setAllowedOrigins("*");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ public class Message {
|
|||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
@Id
|
||||
Long id;
|
||||
MessageType type;
|
||||
String fromUserId;
|
||||
String toUserId;
|
||||
String content;
|
||||
|
@ -20,6 +21,9 @@ public class Message {
|
|||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
public MessageType getType() {
|
||||
return type;
|
||||
}
|
||||
public String getFromUserId() {
|
||||
return fromUserId;
|
||||
}
|
||||
|
@ -44,15 +48,20 @@ public class Message {
|
|||
public void setTimeMillis(Long timeMillis) {
|
||||
this.timeMillis = timeMillis;
|
||||
}
|
||||
public void setType(MessageType type) {
|
||||
this.type = type;
|
||||
}
|
||||
public Message() {
|
||||
|
||||
}
|
||||
public Message(Long id,
|
||||
MessageType type,
|
||||
String fromUserId,
|
||||
String toUserId,
|
||||
String content,
|
||||
Long timeMillis) {
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
this.fromUserId = fromUserId;
|
||||
this.toUserId = toUserId;
|
||||
this.content = content;
|
||||
|
|
8
src/main/java/me/imsonmia/epqapi/model/MessageType.java
Normal file
8
src/main/java/me/imsonmia/epqapi/model/MessageType.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package me.imsonmia.epqapi.model;
|
||||
|
||||
public enum MessageType {
|
||||
MESSAGE,
|
||||
SYSTEM,
|
||||
HELLO,
|
||||
DATA,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue