From 93edbb3ed8f01eb711c1c3725b61a2bed4766f4a Mon Sep 17 00:00:00 2001 From: ZachKitto Date: Thu, 9 Sep 2021 06:05:32 -0400 Subject: [PATCH 1/2] changed message fields & added services to channel + message --- .../demo/controller/ChannelController.java | 10 +++++ .../demo/controller/MessageController.java | 5 +++ .../java/com/example/demo/models/Channel.java | 9 ++++- .../java/com/example/demo/models/Message.java | 36 +++++++++--------- .../java/com/example/demo/models/Profile.java | 10 ++--- .../example/demo/repository/ChannelRepo.java | 8 ++++ .../example/demo/repository/MessageRepo.java | 6 +-- .../example/demo/service/ChannelService.java | 13 +++++++ .../example/demo/service/MessageService.java | 7 +++- .../demo/controller/ChannelController.class | Bin 3296 -> 4131 bytes .../demo/controller/MessageController.class | Bin 3285 -> 3729 bytes .../com/example/demo/models/Channel.class | Bin 3053 -> 3319 bytes .../com/example/demo/models/Message.class | Bin 2421 -> 1967 bytes .../com/example/demo/models/Profile.class | Bin 3376 -> 3742 bytes .../example/demo/repository/ChannelRepo.class | Bin 339 -> 709 bytes .../example/demo/repository/MessageRepo.class | Bin 618 -> 618 bytes .../example/demo/service/ChannelService.class | Bin 5169 -> 5821 bytes .../example/demo/service/MessageService.class | Bin 2483 -> 2762 bytes 18 files changed, 76 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/example/demo/controller/ChannelController.java b/src/main/java/com/example/demo/controller/ChannelController.java index 99d2cee29..38f35ff87 100644 --- a/src/main/java/com/example/demo/controller/ChannelController.java +++ b/src/main/java/com/example/demo/controller/ChannelController.java @@ -29,6 +29,16 @@ public ResponseEntity readChannel(@PathVariable Long id) { return new ResponseEntity<>(service.readChannel(id),HttpStatus.NOT_FOUND); } + @GetMapping("/exists/{name}") + public ResponseEntity existsByName(@PathVariable String name) { + return new ResponseEntity<>(service.existsByName(name), HttpStatus.OK); + } + + @GetMapping("find/{name}") + public ResponseEntity findByName(@PathVariable String name) { + return new ResponseEntity<>(service.findByName(name), HttpStatus.OK); + } + @RequestMapping(method = RequestMethod.GET, value = "/readAll") public ResponseEntity> readAllChannels() { return new ResponseEntity<>(service.readAllChannels(), HttpStatus.OK); diff --git a/src/main/java/com/example/demo/controller/MessageController.java b/src/main/java/com/example/demo/controller/MessageController.java index 251c94ea4..9e11117af 100644 --- a/src/main/java/com/example/demo/controller/MessageController.java +++ b/src/main/java/com/example/demo/controller/MessageController.java @@ -28,6 +28,11 @@ public ResponseEntity create(@RequestBody Message message) { return new ResponseEntity<>(messageService.create(message), HttpStatus.CREATED); } + @GetMapping("/find/{channelName}") + public ResponseEntity> findByChannelName(@PathVariable String channelName) { + return new ResponseEntity<>(messageService.findByChannelName(channelName), HttpStatus.OK); + } + @GetMapping(value = "/read/{id}") public ResponseEntity read(@PathVariable Long id ){ return new ResponseEntity<>(messageService.read(id), HttpStatus.OK); diff --git a/src/main/java/com/example/demo/models/Channel.java b/src/main/java/com/example/demo/models/Channel.java index 2ebe3e9e5..b11da586b 100644 --- a/src/main/java/com/example/demo/models/Channel.java +++ b/src/main/java/com/example/demo/models/Channel.java @@ -16,9 +16,9 @@ public class Channel { private String name; @Enumerated(value = EnumType.STRING) private ChannelType type; - @ManyToMany(fetch = FetchType.LAZY) + @ManyToMany(mappedBy = "channels", fetch = FetchType.LAZY) private List profileList; - @OneToMany(fetch = FetchType.LAZY) + @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) private List messages; public Channel() { @@ -32,6 +32,11 @@ public Channel(Long id, String name, ChannelType type, List profileList this.messages = messages; } + public Channel(String name, ChannelType type) { + this.name = name; + this.type = type; + } + public Long getId() { return id; } diff --git a/src/main/java/com/example/demo/models/Message.java b/src/main/java/com/example/demo/models/Message.java index 7105aa569..b710a75a0 100644 --- a/src/main/java/com/example/demo/models/Message.java +++ b/src/main/java/com/example/demo/models/Message.java @@ -13,25 +13,27 @@ public class Message { @Id @GeneratedValue(strategy = GenerationType.AUTO) Long id; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "profile_id", referencedColumnName = "id") - Profile profile; +// @ManyToOne(fetch = FetchType.LAZY) +// @JoinColumn(name = "profile_id", referencedColumnName = "id") +// Profile profile; + String profileSentFrom; String body; String timestamp; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "channel_id", referencedColumnName = "id") - Channel channel; + String channelName; +// @ManyToOne(fetch = FetchType.LAZY) +// @JoinColumn(name = "channel_id", referencedColumnName = "id") +// Channel channel; public Message() { } - public Message(Long id, Profile profile, String body, String timestamp, Channel channel) { + public Message(Long id, String profileSentFrom, String body, String timestamp, String channelName) { this.id = id; - this.profile = profile; + this.profileSentFrom = profileSentFrom; this.body = body; this.timestamp = timestamp; - this.channel = channel; + this.channelName = channelName; } public Long getId() { @@ -58,19 +60,19 @@ public void setTimestamp(String timestamp) { this.timestamp = timestamp; } - public Profile getProfile() { - return profile; + public String getProfileSentFrom() { + return profileSentFrom; } - public void setProfile(Profile profile) { - this.profile = profile; + public void setProfileSentFrom(String profileSentFrom) { + this.profileSentFrom = profileSentFrom; } - public Channel getChannel() { - return channel; + public String getChannelName() { + return channelName; } - public void setChannel(Channel channel) { - this.channel = channel; + public void setChannelName(String channelName) { + this.channelName = channelName; } } diff --git a/src/main/java/com/example/demo/models/Profile.java b/src/main/java/com/example/demo/models/Profile.java index c0c41f6fd..26385f270 100644 --- a/src/main/java/com/example/demo/models/Profile.java +++ b/src/main/java/com/example/demo/models/Profile.java @@ -24,11 +24,11 @@ public class Profile implements UserDetails { private String password; private String email; private boolean enabled = true; -// @ManyToMany(cascade = CascadeType.ALL) -// @JoinTable(joinColumns = @JoinColumn(name = "profile_id"), -// inverseJoinColumns = @JoinColumn(name = "channel_id")) -// private List channels; -// @OneToMany(mappedBy = "profile") + @ManyToMany(fetch = FetchType.LAZY) + @JoinTable(joinColumns = @JoinColumn(name = "profile_id"), + inverseJoinColumns = @JoinColumn(name = "channel_id")) + private List channels; +// @OneToMany(mappedBy = "profile", cascade = CascadeType.ALL) // private List messages; public Profile() { diff --git a/src/main/java/com/example/demo/repository/ChannelRepo.java b/src/main/java/com/example/demo/repository/ChannelRepo.java index 552c3f776..3c5acffce 100644 --- a/src/main/java/com/example/demo/repository/ChannelRepo.java +++ b/src/main/java/com/example/demo/repository/ChannelRepo.java @@ -1,7 +1,15 @@ package com.example.demo.repository; import com.example.demo.models.Channel; +import com.example.demo.models.ChannelType; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; + public interface ChannelRepo extends JpaRepository { + List findByType(ChannelType type); + + boolean existsByName(String name); + + Channel findByName(String name); } diff --git a/src/main/java/com/example/demo/repository/MessageRepo.java b/src/main/java/com/example/demo/repository/MessageRepo.java index 742951540..c4fe423d9 100644 --- a/src/main/java/com/example/demo/repository/MessageRepo.java +++ b/src/main/java/com/example/demo/repository/MessageRepo.java @@ -4,10 +4,10 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; +import java.util.List; + @Repository public interface MessageRepo extends JpaRepository { - - - Iterable getMessageByChannel_Id(Long id); + List findByChannelName(String channelName); } diff --git a/src/main/java/com/example/demo/service/ChannelService.java b/src/main/java/com/example/demo/service/ChannelService.java index 97d89c17e..2eac5ee43 100644 --- a/src/main/java/com/example/demo/service/ChannelService.java +++ b/src/main/java/com/example/demo/service/ChannelService.java @@ -1,6 +1,7 @@ package com.example.demo.service; import com.example.demo.models.Channel; +import com.example.demo.models.ChannelType; import com.example.demo.models.Profile; import com.example.demo.repository.ChannelRepo; import com.example.demo.repository.ProfileRepo; @@ -38,6 +39,18 @@ public List readAllChannels() { return result; } + public List readAllChannelsByType(ChannelType type) { + return channelRepo.findByType(type); + } + + public boolean existsByName(String name) { + return channelRepo.existsByName(name); + } + + public Channel findByName(String name) { + return channelRepo.findByName(name); + } + public List findByProfileUsername(String username) { List allChannels = readAllChannels(); return allChannels diff --git a/src/main/java/com/example/demo/service/MessageService.java b/src/main/java/com/example/demo/service/MessageService.java index 4f1244437..0d254d5cb 100644 --- a/src/main/java/com/example/demo/service/MessageService.java +++ b/src/main/java/com/example/demo/service/MessageService.java @@ -26,6 +26,10 @@ public Message create (Message message){ return messageRepo.save(message); } + public List findByChannelName(String channelName) { + return messageRepo.findByChannelName(channelName); + } + public Message read(Long id){ return messageRepo.getById(id); } @@ -37,7 +41,8 @@ public List readAll(){ public Message update(Long id, Message newMessageData){ Message messageInDB = read(id); messageInDB.setBody(newMessageData.getBody()); - messageInDB.setProfile(newMessageData.getProfile()); + messageInDB.setProfileSentFrom(newMessageData.getProfileSentFrom()); + messageInDB.setChannelName(newMessageData.getChannelName()); messageInDB.setTimestamp(newMessageData.getTimestamp()); messageRepo.save(messageInDB); return messageInDB; diff --git a/target/classes/com/example/demo/controller/ChannelController.class b/target/classes/com/example/demo/controller/ChannelController.class index 850ff04974b0e08ebc5a20eabbd8bc4da50d0581..a0573b50452ad26d36ba578999b8716ca563bf73 100644 GIT binary patch literal 4131 zcmcImTXWM!7(MG;OdLTVDWTAoYbgl<)P!(NpyXo0#n@?L(sC)F*qcOPOGcIh8K%?e zKWdo{blRCd_Mtzj)3egrRuVy+(mr^lm3O~A=X__s-M{|+?GFH>SWTf9vq^m2g*}){ zVIKJ|+{Ho)34Eiv->U9C)!bLz2Pr(nck1ntY96cRiE1o0WHE_C5=DVzReGy-K?)3J z3U1kyFRgN=B+a5MyQconoLaFQN0#Qpp<@F3=W32`m*s+8wHHfr!f{;R@@?0t3S7*% z-m+P(c(${=Dx7~Fo-J(iaHw{s2 z_+e}y^VC|k%#!6Sn;DnXwv+yZO#yaqj6m1T`&Qu@#nSeD^zT<`Ese`A~5$MvBx73 zCtbJ1A~dE`_ds2RCm)7%Q}x|Ya}@4wwO(WO9+k?8 zQb{|NrDAAcJJx*C`e-d=&9_Tth7z=5IR$t}U^il9HK*N8#f=(T#)0uQWtpsdKm+^mvA~JAQ#$4ZGth^Rl8^=tVkwDb11qpq zjHd=pXub=9!?UjfeM}*xB}0>HB=2u!#8kK4XwczAe0T)j3&1F0ox?O+Sx3= zxy7fl;1m0%5b-w^f$3Jx%T3WX>^y;E?-c6>&wN&LzsB8{oSI8dUnM#Ls+5-~d}S80f(#Y>jXLKE-G332vH0 z=m;jypq=A^zTc6!ck&ms4ZT78YjnIt=TH0`4YfB2)gKPmp*RtTiI!I%j_wfb0LOxf zp9hc?$m5*y#RCY56BxiC->Nu?A&yEa&Hc0VpOf`#RjU&0jgd6YmC28&GC&`t~9X3 zCD@1uav}nxuK}d*T|lnJ0QqVokZYKry2_^G6h%3*x1P8+*cp%GRDdJ&Y_G-PQAgd4L;(hi1DL78m5m%xMM~GT!+J`4ShzmkGN8> z6%utv9SU;SmEiw~?2GHM9AeD=J??wAdG=^gnDeXotR fmECV?V7J$2Hh~OTC2%KT)62Ik`^O18bY$)yvMo9f delta 969 zcmaJ<%T5$Q6g^eLOfx-2s{^!vIMWX3;DBPcD5HXkFMQ)$9*Qn>la=1%n0_4VDBxkmWEQ8cbr@U`h@iVSfF4=PMQebYDL4NDxru z!*blqLCTQsKG8UL#XaBHfLdjsu`^8qi}W!zNdo#YK%~fQ5PA6V*V6DxJGa;7 z`n(UeNpdCHjSBBn`8Tf!fPkOI9?PkZM>V3MC8(zu#$N1W^c;1JFv}5Y`xz)|AC;br zU!cSG2pjK^i=Uaua`2Gj*#JspS796Bop1?TTtbZD0BarOSq`eQNotHZ;HNnZ8PwmT z4yB~RHmQhdiVjRjAwLd1f6-k-=LQOIZK3v9YMBw1Q!0VYIr86TM_GRoO*`n<-jFKA zU%YBYYMoL?sGwo%2UdR6k{YE_fyf%5H$_*i=%VI1GHx8(lFRW__z5e#OJhZ`o+wXD znQECbo0`)75qd$48GR44hOR9JGM@1!`%V&X(s%L?OJ-URWjdvH@=s4RPTAR>wtC96 NbcVP_#>u-n^BYGJQE~tP diff --git a/target/classes/com/example/demo/controller/MessageController.class b/target/classes/com/example/demo/controller/MessageController.class index 175e2774b557953fc6f82c8de4f514ddd1e2f917..ca43b96d88f8384b76bd232472f213b92cced588 100644 GIT binary patch literal 3729 zcmcIm`*Yhw5dO|_qS|rYyeJeXG=0T+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m?+#e)`HJcuQ*|TA@680&)A2;!5BGmPw4wvOwz_yZMF8+?Z+I~nP0FwPrHgs~b^>how9 zAi9YCJXCv_)yslCj3{!!Qi?pLNCvqMGzHEpt-?3wC66bY8oA#oc7d0eid|9-E=A_# z8~WBqUdNLolvMc$Np)725rY+_pd*wF2$O!4IYI{hv*01<1-(Su%M|ZrdK$@8ptUHb zcrVj)Fs=4s;(QAgD==}a1id2OVlR`?%k(0GNvHTVM82bqD!rN53Zdw8rQs)t1yn$46q9 F=wI}nyG8&2 delta 1104 zcmZ{jOHUL*6opS!Pj}A)Ljaj!1Z75$$AB}9jsl7Zhyp%YyLUy{vG2cNti1{U00M-> zg$tLu(I4X4o$=f%n087how~PEee2d&=T!fy{;V{={{HkCKpVS7oLMI)va#AYu(NUuQQI>(K7 z7)K2ntYIAGei}DXVwRGLtfY^xY{)ppk9V0BbJ#eCI<~8(8H-#Ej39?9X80zHScF+L zn5DrS0yZ%F`9w{dkNJsyDO*LvSd%jIJ>N6xP!XlPj-!54~AFADfqN0};I&qiT#DmJk#)7B znE2<~udwWqgEWVwvX$RiwbEhokyg3pu|r~?-M{sUM6bXa?(XLrA=i6A%GK+Jtf#zj z9m?#6t#NW48;ricIbX`n|6nUT!RCbzUH0aDdpEYpyVHYr2v;*W`3*Fl+W5@=#3I`k F@CW3UOtt_3 diff --git a/target/classes/com/example/demo/models/Message.class b/target/classes/com/example/demo/models/Message.class index 48af9080c9b17e988235e4f1ad51989381d1c0e3..eb3d6f465194d5358467fe69964e369931bd6152 100644 GIT binary patch literal 1967 zcmbW1-A)rx5Xa}V-4?JGC?5(cPy{XIV^Kg!Kq4Y2N%@G>-gvdN$Fii|ZFaW?-oppc z#Ky!6AHat){^x8{ma^5vi=8=VcFxRi=FIM|-#>m5(JHO?Q4cNmQi7hac*5vz1q$M50ljWjOZAduvxE}8-mw)v~rov^N{bSqj3rB+b>yG`= ztjZHTE(WK@fWWAeUbjCp4!8j#7C?3ykw5WXt)vaH#94PmOT zejr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pTXEQFx8f&Pc z-@TIoVF?jsYrn}d5wLY#k#YkzH)APJMx9ifoHQuEMK8uso{Ad3A8ULYJ>z4a$I2a+ z<_DK*ytTYKt)sslD-ZmFa4YQ6bkL>zs!~Grm!Owo6Usy}9mQh0LoXx7F#Mgul!;>c z5STt{gNdh^P(2S!-0Om7V=-l;m_CWcG#8I48^!b~Fn!hr6TjCG6Tdw{uf)6Uh`Rk8 zZog>b)*o*H{XEnJc#CDQX@dGy{St1!YU7q?Wr)_Fldr}yn2R#_bu5Fg#be4vQ~d^* zzHNhvXIhAfCzhZEdcCDthE9!QKh^Kx_WL$&c|eA4{UNv*n`%0m>JPE0-i=Q+9ZmH| bVEU;ICjMIvG4a4o(2|nN>aUz<@CwntFqsv3 diff --git a/target/classes/com/example/demo/repository/ChannelRepo.class b/target/classes/com/example/demo/repository/ChannelRepo.class index 10e569cb085c038447f5c637ee42644a766a71f9..f0e82fb914fbcab6ac6ac02595b35ffb711276c3 100644 GIT binary patch delta 314 zcmcc2bd*)))W2Q(7#J8#7)03_gxDE`*%?F_8Mx9i^HQ8DLn;eW85ztqCT1%*fY{cW zK3R!niTb4_nK}ACnZ+g6j0^(4sU;ctDFKN^iMgpIsYS(%3@jyJeVoCW>3NAIrA0t9 zqCjSdVl`u8mQsiv&>)`F3ZRL_PL+N@gBTe^H6V87B<7{-2bUCO=A~O}Mga}a14~0) z2vKW_P3^>N#f|ccj3LY{Kurv+3``7cK!36_GOzu>F>o_5!lZZ@7=S{& S416d;K$Q^n{0stMeS!cDrAFTX delta 61 zcmX@gdYMW7)W2Q(7#J8#7`WLPIM^9D*%`PP890M8)AJHbN{doA2QVr!3NtV;F|Ytt MF)^?*uz_iI0K1L~e*gdg diff --git a/target/classes/com/example/demo/repository/MessageRepo.class b/target/classes/com/example/demo/repository/MessageRepo.class index 3526db893c9621390793105fc51b35ff21261536..6d4bc6459134a48d00b00fe2db6d2b071311aa9b 100644 GIT binary patch delta 152 zcmaFG@``1GXuV)sW?qU@rE^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$s)$sL0`_$UWvODr*05ct@>sykc43W^(ORd*7?wV< z7Io9_y#H03Sk5QE3+U&A>mMis7aF*z@EDDvyJxkIHp@c21;VbSMaRX7@5LqD|G>X| ioW8@)_?}6)f_wP@_3_`2&Di3suEbTiI&QleTmAzF)cx}S diff --git a/target/classes/com/example/demo/service/MessageService.class b/target/classes/com/example/demo/service/MessageService.class index 6f36dafbd534870ec2efab654f962ab2b8bdbfc4..bfa8a4f85297aeb44566d982c06a45334f27ac67 100644 GIT binary patch literal 2762 zcma)7Yg-#d6n;o~?Ku-JhmEGuax zj&`gj@D!iKu%`A;)$*BI(sAmqD}@cUY^r5TEuX7pTP+#2>?q|g)Uq4HvlyNWB#P4W z%)H!|$Bw{AI_ne-`J-7pE=VIMi;m&)gJ=1UduFWHRObZR<}KUu9}A2PU)gG8SD)-3FruBFb=WvhQ^c})ZJq(W1T za$BZr7Nsv;n)h#)Y~L!%UCXnGy{@pIK$)C6?h9jInzm;g znAsq6vua>0lzivZa%E1HAnQugXXwjKN>F5)1+Nm`T$9qiq9G8Anjvt%v7`;!HxDd3 zw|KU6$mnEYgOLloGn_s$PfVj=+Ib`6tDNXLxGMQp!AM)4&%hJedZVsJ8-b3DmA6g5 zw>G+bUS z*0$1dF6iz~L$sIXdX;V`ZFw4v)UxTDwOL%VmlsJc(ueeACqf}euw__{P(0(5+^k%+ z)Yx=K7|{SssAdZcH)XZQagdIGb}Ws`yy&=%IUR4HKZY-Le1)%L_(sRK_)f7ERx%*slgh zR*&^w%WUqYH(uD|nj|*kd^`L>ul+vE&Rq;C*suq8$@ibpJoBwlfKHy z^Z85*^wzVpGV&xzV;!46Vd+7R^E;vfar?zmY4qG*&2s2rkjlP8T3r`x};+mum(2Z8~paZ?Q!_%!$ z8+UP!C)x$5e6=ZG6FdNe{I$`^+uX?xyh{`1DnmHsYGCvawET+JGOm@;mii6a=s98< z{zm)H{2cm@2de$J&RA=H2daJtFoXw$kNge=zBqtUT2E-Md?h0I4h=PI6K!%b9i z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o/controller/ProfileController.java | 4 +- .../java/com/example/demo/models/Channel.java | 51 ++++++++++-------- .../java/com/example/demo/models/Message.java | 2 +- .../java/com/example/demo/models/Profile.java | 8 +-- .../example/demo/service/ChannelService.java | 32 +++++------ .../demo/controller/ProfileController.class | Bin 6013 -> 5753 bytes .../com/example/demo/models/Channel.class | Bin 3319 -> 1851 bytes .../com/example/demo/models/Message.class | Bin 1967 -> 2049 bytes .../com/example/demo/models/Profile.class | Bin 3742 -> 3376 bytes .../example/demo/service/ChannelService.class | Bin 5821 -> 4332 bytes 10 files changed, 52 insertions(+), 45 deletions(-) diff --git a/src/main/java/com/example/demo/controller/ProfileController.java b/src/main/java/com/example/demo/controller/ProfileController.java index f0046619a..fd70d6fcb 100644 --- a/src/main/java/com/example/demo/controller/ProfileController.java +++ b/src/main/java/com/example/demo/controller/ProfileController.java @@ -36,10 +36,10 @@ public class ProfileController { @PostMapping(value = "/register") public ResponseEntity createProfile(@RequestBody Profile profile) { if (service.existsByUsername(profile.getUsername())) { - return ResponseEntity.badRequest().body("Username is taken"); + return new ResponseEntity<>("Username is taken", HttpStatus.OK); } if (service.existsByEmail(profile.getEmail())) { - return ResponseEntity.badRequest().body("Email is taken"); + return new ResponseEntity<>("Email is taken", HttpStatus.OK); } profile.setPassword(passwordEncoder.encode(profile.getPassword())); return new ResponseEntity<>(service.createProfile(profile), HttpStatus.CREATED); diff --git a/src/main/java/com/example/demo/models/Channel.java b/src/main/java/com/example/demo/models/Channel.java index b11da586b..4aa6127af 100644 --- a/src/main/java/com/example/demo/models/Channel.java +++ b/src/main/java/com/example/demo/models/Channel.java @@ -16,20 +16,27 @@ public class Channel { private String name; @Enumerated(value = EnumType.STRING) private ChannelType type; - @ManyToMany(mappedBy = "channels", fetch = FetchType.LAZY) - private List profileList; - @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) - private List messages; +// @ManyToMany(mappedBy = "channels", fetch = FetchType.LAZY) +// private List profileList; +// @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) +// private List messages; public Channel() { } - public Channel(Long id, String name, ChannelType type, List profileList, List messages) { +// public Channel(Long id, String name, ChannelType type, List profileList, List messages) { +// this.id = id; +// this.name = name; +// this.type = type; +// this.profileList = profileList; +// this.messages = messages; +// } + + + public Channel(Long id, String name, ChannelType type) { this.id = id; this.name = name; this.type = type; - this.profileList = profileList; - this.messages = messages; } public Channel(String name, ChannelType type) { @@ -53,21 +60,21 @@ public void setName(String name) { this.name = name; } - public List getProfileList() { - return profileList; - } - - public void setProfileList(List profileList) { - this.profileList = profileList; - } - - public List getMessages() { - return messages; - } - - public void setMessages(List messages) { - this.messages = messages; - } +// public List getProfileList() { +// return profileList; +// } +// +// public void setProfileList(List profileList) { +// this.profileList = profileList; +// } +// +// public List getMessages() { +// return messages; +// } +// +// public void setMessages(List messages) { +// this.messages = messages; +// } public ChannelType getType() { return type; diff --git a/src/main/java/com/example/demo/models/Message.java b/src/main/java/com/example/demo/models/Message.java index b710a75a0..039441be5 100644 --- a/src/main/java/com/example/demo/models/Message.java +++ b/src/main/java/com/example/demo/models/Message.java @@ -18,7 +18,7 @@ public class Message { // Profile profile; String profileSentFrom; String body; - String timestamp; + String timestamp = new Date().toString(); String channelName; // @ManyToOne(fetch = FetchType.LAZY) // @JoinColumn(name = "channel_id", referencedColumnName = "id") diff --git a/src/main/java/com/example/demo/models/Profile.java b/src/main/java/com/example/demo/models/Profile.java index 26385f270..4f62eeb9b 100644 --- a/src/main/java/com/example/demo/models/Profile.java +++ b/src/main/java/com/example/demo/models/Profile.java @@ -24,10 +24,10 @@ public class Profile implements UserDetails { private String password; private String email; private boolean enabled = true; - @ManyToMany(fetch = FetchType.LAZY) - @JoinTable(joinColumns = @JoinColumn(name = "profile_id"), - inverseJoinColumns = @JoinColumn(name = "channel_id")) - private List channels; +// @ManyToMany(fetch = FetchType.LAZY) +// @JoinTable(joinColumns = @JoinColumn(name = "profile_id"), +// inverseJoinColumns = @JoinColumn(name = "channel_id")) +// private List channels; // @OneToMany(mappedBy = "profile", cascade = CascadeType.ALL) // private List messages; diff --git a/src/main/java/com/example/demo/service/ChannelService.java b/src/main/java/com/example/demo/service/ChannelService.java index 2eac5ee43..e7805e5bb 100644 --- a/src/main/java/com/example/demo/service/ChannelService.java +++ b/src/main/java/com/example/demo/service/ChannelService.java @@ -51,22 +51,22 @@ public Channel findByName(String name) { return channelRepo.findByName(name); } - public List findByProfileUsername(String username) { - List allChannels = readAllChannels(); - return allChannels - .stream() - .filter(channel -> { - List profilesInChannel = channel.getProfileList(); - for (Profile profile : profilesInChannel) { - if (profile.getUsername().equals(username)) { - return true; - } - } - return false; - }) - .collect(Collectors.toList()); - - } +// public List findByProfileUsername(String username) { +// List allChannels = readAllChannels(); +// return allChannels +// .stream() +// .filter(channel -> { +// List profilesInChannel = channel.getProfileList(); +// for (Profile profile : profilesInChannel) { +// if (profile.getUsername().equals(username)) { +// return true; +// } +// } +// return false; +// }) +// .collect(Collectors.toList()); +// +// } public Channel update(Long id, Channel channel) { Channel channelInDb = readChannel(id); diff --git a/target/classes/com/example/demo/controller/ProfileController.class b/target/classes/com/example/demo/controller/ProfileController.class index ef3371fa9033bf322277e567bd21f7ccbeb96958..fe9ea9199c5b747a832d62fbc7733438bec06a32 100644 GIT binary patch delta 1708 zcmZ{j+h0^w6vw~kFyomyvzfucApt4Oz~rK0rA0y-5~ZSMSfNo-QIUWlcE3#b`~75T zbiZFL1#A#8yFT?F)TbW$6MF2SKCN};a3HXUv-UoFt-bem{npxlFaN79`}04?PXg!i zlS?(X#;Ky$e(0L4voE2SMEx1H}~l5UiICl@%QWO z0W}Y5T-M%@Pw-@uI-hcRnrAfjS%>HJoafcNpyoxF3SLs*%W7VU z;W@nOu-_un?G2_%Mt=J>wy=R!h83)Ic+K!S2OJI>-eA~U?AG*I%-=E8vv;7ozo)Wy zsB&NT?w$dMHw|y`wxNM{4DWKl@E*e!$=3ev-o7x-P)nWReLeC6!-sri_?S-&=kuxI zGdoR;ma>pNOEcqf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10XIn^Ywsf(e#*^yZIW=AbYm~y) zkT*_I$YX|cjXBSl3}bvl6i-H6f$Y%(>r)w){d;Z K<>&TVrvG0W79Gm~ diff --git a/target/classes/com/example/demo/models/Channel.class b/target/classes/com/example/demo/models/Channel.class index 96192f7ab7503f14a791475eee0bc9bf1143be2c..68b7ff4eea132a6c5b1cbc4cff8fc0bc96ebf4e9 100644 GIT binary patch literal 1851 zcmb7^YflqF6o$|2_5!t7D5VM_H$_UhED9JSNMeW*Oa%g^i657CQkLw6v|9rIN)w5R zAN&FSDC2u(7g%u-{Lnc&Gw1TmduICc*Y_Vpv_vm6l%j=hO44&4UhuG(rlmA33(~BH zpx(-nd14y2={Aju=QdXa4eoYa-*RNlYFh`keCxWNZ~B(!wgnZH`>Am(TWzcDOSdkK z%?5%dVm3CUD_f>78#UAJNH}%1eV#YZ{^^fO)w5&vPrTi)Zo{~yBL(FnsC$0PQm_dh zu7V~jbGaRoW?Y6OgXu7Vn!;B*_nD5+<6L6wr@`PCh4d37x=1J{U zcQ>~-1f^Cj*Yei{>80r!P}fmaP_AORa;xJU$X3;ah79l3O}l2cES`sp3IEW7sN=W6 zgX=>na(dOM$UIczwls>JDSJOk|Ilmfm@NqFqm_bQNAv%0zGPGSo48E*(sYC>yiUn> zu-PB2p!OIgjnFOC-ohWjmkmxMJa8C@CJ6U0Qt;6PO(DhI?g3{FVoIeug>a$Fp4VyB z<$H@8nhh`3Jii}7L$UY8xBRn}EIpuySxQq^mU7gar9R3F8odP+UAlUi+XqLo?$bD) zZwe1vCympQpl;0iFw4N+!#pdghwftmg|MV?tZeGBk~uYhDi$QJUWfyyGMruVT% literal 3319 zcmcJR-%{H~6vofmmJP%O0)f;N5(tnOC*Y=OXcH4shXSQFe+mvWX|II6F=A}VW67ED zR&=IJXL`{G=tFh-on2Wn9=U;wUU;S5J^P*Co^y8PzyJC3FCzMyj)!P~_68|M``jFG z^D{Sx+#IE-oT9gaVpdhqXz9%SVCL(lUCWmoyH*gCIc(dW)sV-QYn{|((Y77W^eo4A z1x+gRkNKu-xt8lmyCU;DRV;cCF|jRe*)ly@JvQrY38Mkm<9_Y@KkebEeBNaHMDcBT z9}nAXNI_#=s7GGQQm_dRrh*nr6{nGxAI(OyF7s8{aPkeOD(h~3AGf3V&(NQcl8>D8Rci+mH}m|V!9QxiZI-dAllHAK2y9{DhW!iS+?b^3yNo# zj!_01$f%%^l4Z-icH>00$|mZQ3&W|H^<%STao-@DOzM z{Yv|ki~`rog7g-8`@D$mq_=}hX)L?cl>z@+GF&}5-t9rn@zNBQ?x}0y&XvW%MUldCZ7|U-;Lo$f zFeLnQr%!W$5oT1-^NxHl*grJgr+66tuc&wS5$F^cV%3KWMz5pJ3vYqmPX#LHCX`_U zp#sWKOY~*}U^YnwBV+ra>A?(`_0{(>UEpQ--F}G*45wp+13(n?C$(?w_2=ibr$!whrL? zYfy}Z3Bg3~HhO71KSO_5(g=-W04^~UW3Rp$Pfy@CDd{eKjw!I9{X&^dE2S|^&tUAH zOZRD3!rue*fE(B?D7(9`Tf~@e^6*y@k{(f3Az<5>ehk@XcnUm?+#e)`HJcuQ*|TA@680&)A2;!5BGmPw4wvOwz_yZMF8+?Z+I~nP0FwPrHgs~b^>how9 zAi9YCJXCv_)yslCj3{!!Qi?pLNCvqMGzHEpt-?3wC66bY8oA#oc7d0eid|9-E=A_# z8~WBqUdNLolvMc$Np)725rY+_pd*wF2$O!4IYI{hv*01<1-(Su%M|ZrdK$@8ptUHb zcrVj)Fs=4s;(QAgD==}a1id2OVlR`?%k(0GNvHTVM82bqD!rN53Zdw8rQs)t1yn$46q9 F=wI}nyG8&2 diff --git a/target/classes/com/example/demo/models/Message.class b/target/classes/com/example/demo/models/Message.class index eb3d6f465194d5358467fe69964e369931bd6152..a6d1e9808ac447a05712fef87a9f6ba31171c852 100644 GIT binary patch literal 2049 zcmbW1eQ(=T6vm&M#!1?mwoBJS$4l2TSn93yU>ywFRgA5JN$EDxQfb;>ZgNRIC3a=s zp!Ey!H%Np@An^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SRCeOwu{p_OMq z>sP)7&0UJCs;}zvd$$0JMHOMx_iEP?Z`Hz#8h#&80_D#@@{I(UVx3IOp-i*%D2yrA z$+QZlwJuCNEJF1SOx!O)k3*TXPNwxxrffKq*2%O9rWak9_*UCYe1C%GLYbnSOfN&3 za^XzTPNvsj+U>%`)7NGiR7~@sOz}>px1mf6;Y@+=#h<4To diff --git a/target/classes/com/example/demo/models/Profile.class b/target/classes/com/example/demo/models/Profile.class index f37020931edc2d7068ec1e6007fd35e5e0b97064..7bb52ad81da7c19a16e6d27e3056f0ab87e9ba8b 100644 GIT binary patch literal 3376 zcmcIlTTdia5Uw-KopBerF3ak|>Mk%`+P%2Af+(_p=q%vElDIJ@&CCIM>FFN3dscYR z=z}JjXySt=`tF0q2Tddh^hS>Iw94X57H_dAvAD-#jm0{PjSRh=q5B!y6qGP3g1SnN^vAkp>eilCvaP*Y zL4)_}mSB|>iVHpla6b+p0vtRTdlz8O3a59X-P--WMx}7 z>k^l;uE+bmqyM~*NLxoWzMoupu(d8I<=F?)64c#oUfq$- z7GLK0c3C&Kb;sa+aG3P=4G=R@D%({}9_rPaDYc5M+FBKEOjp}*>|Mj;bVkQo6KFkQ z2wnH2w{KTAbO#xD;9Ahf&Bm%yt)~Cq$wNlfxhK5`A+5b*_ZWUQ{pTuc?Nh#O=*wa!wrn3OkVVift z==82pApX_>nnkoFzx%WJ5U6=pPdHAFsWS7;E&s*w%|Oj>+I6Qam(j|A9yIkd4-Y{X zRU@393QMS`cQjj|XX$c*F3~du8l?ULU1aeTohwiuYXdAUuo$9#L6@KKitscV^J;zP z5o#{z&XX(2)1V?fJbqVWhVJ@0jbJ8r5)z^;B^Va;^BAj7W7nltlvYv?_2K}4ag<=p zY6WbyA}_TfHMJrWwIXS(18@lrAcwJ=gT26-FaA!Vm^`M$uh=C3gb=&~@(LwEQjVU3 zMgXR6WA{9E?CC0Q4@2L<%J+LiPsNF2>L^YgQ?lW+pHjGUHSl>2F-DQinDRaB+Xuek zi7TYy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z`W}g^G>peH zE){8{^EwKXf&+8=31-ghE zBV7UlBdua*`MwaTII>AS#nDYlwlVuD1(}lp<|)`XjgSm0>_J~Yzy=bhS=sC3Tm%0l z=;ji5COr7&F9+uT!k)w1_!jdiHlHq@-K0!$0N!Pb11TmokOr&bKxUJ2#l6`rUXLM* zgs}NukAUGQ7@kFCjnNT!dVv^mf=rW?fQMvD%4w;V!`3D`9>I4&0$>s=+bCm+0 zPwXK_WL$ZeRwqt+Mx8kAS>^Rm7LWum0t^9w!YCZX`4IjDKwiem$jN{n*ir-*VnR(az2l<&qWPd=aWgIMKPpHI0Gt2{-o1?4ju z1S}z<(c0+HOa##yR6)54o$1(+C!-*>4v==pU#FRvkf)-`@5d@%quGG_6n3t#G&fwT z-D`RE+CY6hQ3%{YTmydZ^2wi4+*K)|>PygEtV5Y7r)Dgt>+}X}Z~<=Nl!1I5qY?RZd;Pk8uC+^pf6Zf8=H{)S@qOhL<_VX^V z{&)+*&qGa6DIPW%h5Z7sUv`1zSsAkR=j5%}28z~2J)yDqRiAVXMx2)-5TYC7ub_pz?tj(0U3b@c~u`mqZq X{%sFA@xV^dl3L5^2b*W`9io2#M$w5J diff --git a/target/classes/com/example/demo/service/ChannelService.class b/target/classes/com/example/demo/service/ChannelService.class index ce9459643b6b9c254893e7817976c8d6f0eec9b3..1ef2b9e34dfa428f1132eae8a4ce0a23ef90f5ff 100644 GIT binary patch delta 1486 zcmaKrTT@$A6vuxj0S-CY5oD4noBc-K?Qnp5jCQZheGUP}P4q!mG7klr;jr;NWR4@| zm~{l8N8wyYJj76j`m&-5Z7qbh) zGx;OALrdWro{exi9N@VKql)Kw!RAH9OPo=>Opl_ETNSr)yW)B>inF|;c$IUCK~5{S z&>gmU%_P2V^M;L9yvbX}o3Uu0&dq0LPG;v9=5&>_MGrcE`rqaqy*t?GKhC@QVDPM7 zuG?AL$a@xhHxKE*0`2Ic%1HjRagL(jrNRge3H(NXxFak_U-3&{vBGLS^U> zDbkW-0IMzeFaScW2Q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