Added enums and infrastructure for different types of ws messages

built newest epq-web application bundle to static
This commit is contained in:
Zhongheng Liu 2024-01-03 18:21:26 +02:00
commit 77366f30cc
No known key found for this signature in database
15 changed files with 39 additions and 17 deletions

View file

@ -0,0 +1,4 @@
package me.imsonmia.epqapi.config;
public interface SqlConfig {
}

View file

@ -17,5 +17,6 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/ws").setAllowedOrigins("*");
}
}

View file

@ -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;

View file

@ -0,0 +1,8 @@
package me.imsonmia.epqapi.model;
public enum MessageType {
MESSAGE,
SYSTEM,
HELLO,
DATA,
}

View file

@ -1,6 +1,6 @@
spring.datasource.url=jdbc:mariadb://127.0.0.1:3306/test
spring.datasource.url=jdbc:mariadb://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8
spring.datasource.username=dbuser
spring.datasource.password=dbpasswd
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.jpa.show-sql: false
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.show-sql: true
spring.jpa.hibernate.ddl-auto=create-drop

View file

@ -1,13 +1,13 @@
{
"files": {
"main.css": "/static/css/main.e6c13ad2.css",
"main.js": "/static/js/main.a029d655.js",
"main.css": "/static/css/main.7bfab64e.css",
"main.js": "/static/js/main.837b405a.js",
"index.html": "/index.html",
"main.e6c13ad2.css.map": "/static/css/main.e6c13ad2.css.map",
"main.a029d655.js.map": "/static/js/main.a029d655.js.map"
"main.7bfab64e.css.map": "/static/css/main.7bfab64e.css.map",
"main.837b405a.js.map": "/static/js/main.837b405a.js.map"
},
"entrypoints": [
"static/css/main.e6c13ad2.css",
"static/js/main.a029d655.js"
"static/css/main.7bfab64e.css",
"static/js/main.837b405a.js"
]
}

View file

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>IRC application instance</title><script defer="defer" src="/static/js/main.a029d655.js"></script><link href="/static/css/main.e6c13ad2.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><div id="copyright"><pre>Copyright 2024-2025 Zhongheng Liu @ Byron College</pre></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>IRC application instance</title><script defer="defer" src="/static/js/main.837b405a.js"></script><link href="/static/css/main.7bfab64e.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><div id="copyright"><pre>Copyright 2024-2025 Zhongheng Liu @ Byron College</pre></div></body></html>

View file

@ -0,0 +1,2 @@
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.chat-inner-wrapper{display:flex;flex-direction:column-reverse;height:500px;overflow-wrap:normal;overflow-y:auto}.entry-box{margin-top:5px}.chat{min-height:80vh;position:relative}body{background-color:#000;color:#0f3}.App{margin:3%;min-height:100vh}
/*# sourceMappingURL=main.7bfab64e.css.map*/

View file

@ -0,0 +1 @@
{"version":3,"file":"static/css/main.7bfab64e.css","mappings":"AAAA,KAKE,kCAAmC,CACnC,iCAAkC,CAJlC,mIAEY,CAHZ,QAMF,CAEA,KACE,uEAEF,CCZA,oBAII,YAAa,CACb,6BAA8B,CAJ9B,YAAa,CAEb,oBAAqB,CADrB,eAKJ,CACA,WACI,cACJ,CACA,MACI,eAAgB,CAChB,iBACJ,CCdA,KACE,qBAAuB,CACvB,UACF,CACA,KACE,SAAU,CACV,gBACF","sources":["index.css","Chat/Chat.css","App.css"],"sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n",".chat-inner-wrapper {\n height: 500px;\n overflow-y: auto;\n overflow-wrap: normal;\n display: flex;\n flex-direction: column-reverse;\n\n}\n.entry-box {\n margin-top: 5px;\n}\n.chat {\n min-height: 80vh;\n position: relative;\n}","body {\n background-color: black;\n color: #00FF33;\n}\n.App {\n margin: 3%;\n min-height: 100vh;\n}"],"names":[],"sourceRoot":""}

View file

@ -1,2 +0,0 @@
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}
/*# sourceMappingURL=main.e6c13ad2.css.map*/

View file

@ -1 +0,0 @@
{"version":3,"file":"static/css/main.e6c13ad2.css","mappings":"AAAA,KAKE,kCAAmC,CACnC,iCAAkC,CAJlC,mIAEY,CAHZ,QAMF,CAEA,KACE,uEAEF","sources":["index.css"],"sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n"],"names":[],"sourceRoot":""}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long