From 3e43f56517052911072d8a152e4ebf27c2870ce5 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sat, 28 Aug 2021 14:04:34 -0400 Subject: [PATCH] Working on Postmen connections --- .../example/demo/config/WebSocketConfig.java | 2 +- .../java/com/example/demo/dto/MessageDTO.java | 14 ++++++++++++++ .../java/com/example/demo/models/Message.java | 4 ++-- src/main/resources/application.properties | 2 +- target/classes/application.properties | 2 +- .../example/demo/WebsocketApplication$1.class | Bin 0 -> 1577 bytes .../example/demo/WebsocketApplication.class | Bin 0 -> 1094 bytes .../example/demo/config/WebSocketConfig.class | Bin 0 -> 2047 bytes .../demo/controller/SocketController.class | Bin 0 -> 966 bytes .../com/example/demo/dto/MessageDTO.class | Bin 0 -> 586 bytes .../com/example/demo/models/Message.class | Bin 2170 -> 2069 bytes .../example/demo/repository/MessageRepo.class | Bin 425 -> 618 bytes 12 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/example/demo/dto/MessageDTO.java create mode 100644 target/classes/com/example/demo/WebsocketApplication$1.class create mode 100644 target/classes/com/example/demo/WebsocketApplication.class create mode 100644 target/classes/com/example/demo/config/WebSocketConfig.class create mode 100644 target/classes/com/example/demo/controller/SocketController.class create mode 100644 target/classes/com/example/demo/dto/MessageDTO.class diff --git a/src/main/java/com/example/demo/config/WebSocketConfig.java b/src/main/java/com/example/demo/config/WebSocketConfig.java index 9efe38e77..030b6e68b 100644 --- a/src/main/java/com/example/demo/config/WebSocketConfig.java +++ b/src/main/java/com/example/demo/config/WebSocketConfig.java @@ -11,7 +11,7 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer { @Override public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) { - stompEndpointRegistry.addEndpoint("/websocket-chat") + stompEndpointRegistry.addEndpoint("/chat") .setAllowedOrigins("*") .withSockJS(); } diff --git a/src/main/java/com/example/demo/dto/MessageDTO.java b/src/main/java/com/example/demo/dto/MessageDTO.java new file mode 100644 index 000000000..79e513e1c --- /dev/null +++ b/src/main/java/com/example/demo/dto/MessageDTO.java @@ -0,0 +1,14 @@ +package com.example.demo.dto; + +public class MessageDTO { + + private String message; + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/src/main/java/com/example/demo/models/Message.java b/src/main/java/com/example/demo/models/Message.java index aeb5834cb..a4076b5bf 100644 --- a/src/main/java/com/example/demo/models/Message.java +++ b/src/main/java/com/example/demo/models/Message.java @@ -15,13 +15,13 @@ public class Message { Long id; @ManyToOne @JoinColumn(name = "profile_id") - @JsonIgnoreProperties("messages") + // @JsonIgnoreProperties("messages") Profile profile; String body; Date timestamp; @ManyToOne @JoinColumn(name = "channel_id") - @JsonIgnoreProperties("messages") + // @JsonIgnoreProperties("messages") Channel channel; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 532817cf8..94980e58a 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,5 @@ spring.datasource.url=jdbc:mysql://localhost:3306/chatter_box -spring.datasource.username=zach +spring.datasource.username=root spring.datasource.password=zipcode0 spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true diff --git a/target/classes/application.properties b/target/classes/application.properties index 532817cf8..94980e58a 100644 --- a/target/classes/application.properties +++ b/target/classes/application.properties @@ -1,5 +1,5 @@ spring.datasource.url=jdbc:mysql://localhost:3306/chatter_box -spring.datasource.username=zach +spring.datasource.username=root spring.datasource.password=zipcode0 spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true diff --git a/target/classes/com/example/demo/WebsocketApplication$1.class b/target/classes/com/example/demo/WebsocketApplication$1.class new file mode 100644 index 0000000000000000000000000000000000000000..0383987a45a90e655a3842face4c513406133acc GIT binary patch literal 1577 zcmcIkTTc@~6#j-5wk!*+RZ;LRi)@Rs;9W|H*oZMHV#I)`FVo$jENpk0*#-2?zvP3M znCK7iM;XtQB9-`1P`ByKnaMfdcdqmO$CqyaZeykwCa#$1!_^E%OxPGTaSdYzoD2$D zEb3+4z;y#R3`{WeBEJXv?eJ6>;u!u3U6x+|g@OK(#obB#tAcsvPYR3ej^ zAPSOMhN9DQg?h=WA>HIF(&OPWSAjmaF4NjA2J2}Q2~`ex z91A)YI^(ma$jjVI)JA3qC+WUjbNln*kIEGhF<#6gt$8oofVt*=+k@dqUR81a+ za;L0>FQO#iA&tlr=k-7GaG(h;{6!Vif{373oj3n29s6W^qY>jWy^MXJ7X>Vr(*r^e zW*7al$kBd+q*>bajaeN3MC0%oT_2k|d0KnO5;#deU~o?hr%2MD*+gSFLvlAm|A!nY zpT$rM_AR=b2KIP9wTpCm7v1Tv=vhtWjip^=+T`Aq146TDGl&s_Js`Dzk=hu>IpS%N c4ik3@=V|T21ze;(jY|~sX_8D*Gij&qC->sXod5s; literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/WebsocketApplication.class b/target/classes/com/example/demo/WebsocketApplication.class new file mode 100644 index 0000000000000000000000000000000000000000..463f80fd04061f92936fa1f4924eba70d885c550 GIT binary patch literal 1094 zcma)5T~8B16g@**7M2P~6|LVWXlbGwqw%GN1e%bT6gAY87@uahLmAkeX=bOu&(bH2 zCjJ0_l=05e+I`rEZZdm!?wot>nS1a4`TO%XfY*5HV;*-s-1BiC4?H~dQN|+=8w}NV zN(s}Bd76rpVg9XD((W*n8rwaFa$ENW!%9ag@qUzq!hGUkOrEulj(FVTM!NmjS+*yV zIG%MPodn{NC&O3-eUa$kNQ9}5&V=0^4r3W{E46A7eZr+;SZ{pkobq!X#9R%6t~F8( zT3LE-21HmZIA&Nq5cWj(KXStpVTB>!a->b#*6LUeMn)Kh{l<1jn?aBc9p|w_UTAX` zT!=78g*lIf4WbMmaHX`(ggLbb=h2jhl-3VN%F0CaWGd;xyZ^zI^?6|mqP61E=6Ux7 zcenPtdSoK8FI^$)MWuP+s==^RNE~WStRt(hgwsWXZg#yrI>^_ziUlk(Y|YdS509&O zf=z1QO!&>0j(&^UFzwuj@Ki*Wp;=V&O!k$~oJblpGold)8@UO{rmX>-%(B7lv6QWF(o`3P@9+Ut8 literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/config/WebSocketConfig.class b/target/classes/com/example/demo/config/WebSocketConfig.class new file mode 100644 index 0000000000000000000000000000000000000000..ec0ecdd6e8afec7b6a572636782398dd49a78125 GIT binary patch literal 2047 zcmb_dYf}?36g?>|TiXhXh%c(*vw#}kucC;k<7gFi9T>(>+ifU;?q(;O3j8d;=;)08 z0DqL@-EFr}rsG)jOOl&S&bjA4vOj-)`vKr4=5pANa~95LaUqY3C}lC3#}uZc;Zhct zbGQPY#nouOX5qSp8y0Rd49-YjnuiPnrO8Ex^t`GGhT)3z#p|Y575cqXZP3n0MY&F6 z(a|!p+nZ^#Dno|JimN;>HXSc$2woGO;;!;nWSuXGs;%60Vdi7I%rK@!U4}+z+bA!1 z>em7#eM2BGOBJQ-JPfq->nqyv#D>!Ad_z=u7(*nOj_)hu7^!^Th4C&1)?4LB$Kh}% zeDaCm`TrteIPglCRaJZAM81+B(lFMN-PGch2t%hX9&5EOG{ckL;=K42>E)sHf<$1~ z-Nf}+Rkjs8y~QxsQ%FC63^`jhwJV;7%7`Ju z-Brg}xK+Sy++ko-7VZ{s4|fW<4|2ugMg`L47G?@~0BVFZcY>gRSv+F6_?Ly<#l28n z6Ru%++jl+pmX|~?Dx_z9WA^M3hP+d&CEdrcR{Buc9lY{n|5=L3Iw}(Ub`2-lxA&&u zkFX2}Lt*9`4YeU^3tHBtPX(IWkY+V{fL_=PuSBh-;B0?kmc=<+)6}c%WXp8^K-_@IK2e!(X zK!N^I3`6w88lah4md1l*ahe&;nW-;epJ!6&(M4p_zhoGX@&p* literal 0 HcmV?d00001 diff --git a/target/classes/com/example/demo/controller/SocketController.class b/target/classes/com/example/demo/controller/SocketController.class new file mode 100644 index 0000000000000000000000000000000000000000..8d0b3e9525df5e9a7b5159b1175d083fd701633c GIT binary patch literal 966 zcmb7CO>Yx15PeRQEQGX43oW#KNN}O0rM@5}C_<_#aY`T}RW6*I-D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