From b924290993e64dfc8ec51391b987847b2ff245a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=AC=B8=EC=A4=80=ED=98=B8?= Date: Thu, 7 Mar 2024 17:13:03 +0900 Subject: [PATCH] exception anonymous search --- .../7.2/executionHistory/executionHistory.bin | Bin 2118347 -> 2118347 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 17 bytes .gradle/7.2/fileHashes/fileHashes.bin | Bin 121333 -> 121683 bytes .gradle/7.2/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .../7.2/fileHashes/resourceHashesCache.bin | Bin 205607 -> 206321 bytes .../buildOutputCleanup.lock | Bin 17 -> 17 bytes .../com/example/just/Dao/QHashTag.java | 4 +- .../com/example/just/Dao/QHashTagMap.java | 54 ++++++++++++++++++ .../generated/com/example/just/Dao/QPost.java | 2 +- .../example/just/Mapper/MemberMapperImpl.java | 2 +- .../example/just/Mapper/PostMapperImpl.java | 2 +- .../just/Controller/CommentController.java | 4 +- .../just/Controller/SearchController.java | 5 ++ .../java/com/example/just/Dao/HashTag.java | 27 ++++++--- .../java/com/example/just/Dao/HashTagMap.java | 36 ++++++++++++ src/main/java/com/example/just/Dao/Post.java | 23 +++----- .../just/Response/ResponseMessage.java | 13 +++++ .../example/just/Service/SearchService.java | 5 ++ 18 files changed, 146 insertions(+), 31 deletions(-) create mode 100644 src/main/generated/com/example/just/Dao/QHashTagMap.java create mode 100644 src/main/java/com/example/just/Dao/HashTagMap.java create mode 100644 src/main/java/com/example/just/Response/ResponseMessage.java diff --git a/.gradle/7.2/executionHistory/executionHistory.bin b/.gradle/7.2/executionHistory/executionHistory.bin index 9fe8521b4673130374424cacd8f156af2859da91..e58e5b859fe757211532cf906e8ba0dc65a191a0 100644 GIT binary patch delta 3341 zcmZu!3sj8T9{0_BUo(4peN#=7Ce!plC211jxDiSYN$6PD^$K%Tq$pgk+ryivl>Qzm zC9iHr?^2=7w$zuC~ zCmkPxl2#}~pkohDUKE>)ba?El@FkP;qRd8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|Zv#I1U6hG zFF;(S{nRU&u6Sz+=Zx-?6%TQ;%1 z_H+hA-n**a+yp$eN&Q#pI4;xXoVJ}26ISUk*}>te*szG;@YpRI!ovUFP%@YMOO7Wk zZqnB{vaL;T1>F)C@m)7^%p>`$*M1e3-W@yf_1>sQ;{il;kk3BTct%d5e@l$z~IPo zHmI4}tz z_}6r#C< z5#qcNENt8%QkgCL*2qB`NI>wk2d9xM865 zVIHHy(J}EGqQ8K|dO-n4q}*NWgP+CyXMMr-km!UXu_L2bH;>TSR^ENZBZmB2c^G`k z%-)7YHB5~9Qo7<7$<75bjzE_{k3gTmfWVM|ClCmX2#g8dATS}AMj$6p5SS8}5ttKL R5Lgme5m>7i$ZRr~{SV4*A(#LF diff --git a/.gradle/7.2/executionHistory/executionHistory.lock b/.gradle/7.2/executionHistory/executionHistory.lock index 80f6fee4d6a15371659821a809aa369de17c14de..73318d0b98dbee59b8df196614ae2886530e91d9 100644 GIT binary patch literal 17 VcmZQ>SH3p8Kj^qN0~l~^1pqRj1hD`B literal 17 VcmZQ>SH3p8Kj^qN0~m140{}9K1eyQ< diff --git a/.gradle/7.2/fileHashes/fileHashes.bin b/.gradle/7.2/fileHashes/fileHashes.bin index 653b989c6526b7d37e3ba2dcb7cb08a77bdc48aa..bbb3fa6810d97e3ee2b5e897be9dc7d85aadc55f 100644 GIT binary patch delta 2925 zcmZuz2~<;88qOsGDodb&0Ux3Xi&T_FajAF|)Ip(E5sNJdAt7$aBH9s|Y84olidLR+^g0kqJmqP#!^iZA4`R3JHgv#iG{7LDt8a)eZ{*X0-WO6JR9FRp#h8w#RPlw#xbFN*?tTZ(4K zE>sTG$9FL1+YXF5{!qq6CYIV`jMAr%XzzJq5Zdc)Cp^d*V=XPB-+{zF{Mai#d&K@QTxk=$~xi+Sk)6p98tToq9> zJPJn~xF;YdqFDMlL`INdBpKSenB#}BG%T)Q)gf=e2OkQNfyhsQ72iQlAmQF)(l{Ol z6KL3Y2?VGq;%7o4LBtauz&zOv!)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4M%ZKt^l!mdN1v~ILM0+od&WXQhlDDwzb$X z8Mf+qfCQXU!75W}@upfK?BZ_?8{N|^JHLBaQZ!q4U)nd<3C`m?gm+cYo~TfsgsvI< zDBDMI$p%63)Fg4*XZxSLF+8svg;rX>;qtpOq2UlcVq!-!=Lk07ggVM0+5&LN+w8Wn z zmV<})5Ohr=Nn9aaPO7rHa9Jj+*6P5`nF1_4j3yS6`EG9RbL-y$rYzSaUG0_qc0!&N z-mOj}sgU3JiYKJHeOv$SQI)XYJ*DOM8`oB-@20&qYU~V172)E6OorWzX7fEF*`p)hh(OK#8;4~BBMF{)MUs$ zfc^tzE)-1vHUPL#HvKKw3=dpPQfCt=d${0Q$l}QU4OI1@7{>l(FH*rs51L6vgAm?_ zl(3=~<$DK}R%ZiUq$mf5|3<`w&E>*KFgaR9eY8?A;1%dzo diff --git a/.gradle/7.2/fileHashes/resourceHashesCache.bin b/.gradle/7.2/fileHashes/resourceHashesCache.bin index 95fd35e3b85f6379b98694faad35a4d46bc3b744..a20de939e502170fe9fbe58a884f9005e5e5d36a 100644 GIT binary patch delta 1254 zcmZ2}jOXKNo(&Cq7^5dQ?(yUgas9wjWLnMu0?f+ln-A{UD9XP~ZrxyE;LPZrh#o88@=<&xu;yY+zanQKPE5{gpA} zP62-A*vq+cKhmH&&9~2TVO+?<|82GWlGMaGP|^L{jXW7Sm<8_r;F-0s?v4r62>0zq zK8)Usj0?Bl^JV-e%xJy+ZX#nQFaM(+_4<+>pP;I`x7+43HgfXch-oSFoW}$aRqoxs zwSv)+k^l8=`R{u+vP0D}Z+~0KXwAwvb9-Suqst`5(Cymqcv43oZq*5q69z6CeG zLS?eI%gHh&a0{59e`?hIK5&vlQ!ed zjfxS1+eOwgU0`9f-~MzXlcWTH#q}V;fAcRv6sn$|TfJ##wWd8S#6KQ}5$2yOrPkjcz(`d3~ie#75M$!F?cUE9PSeKXuP0F(sejDdtC z5DS8^K-Jq2`3|NI#_19cC!fDp_nf@&n{fTIluRcNv zOhsk?*Ok3FE`nlFt6pUH=KsJ{A^YvD;(;`_L9df+-nVLpYudp8RC1RUiSipqT%Io)v` zldypDtE~3eIqwdi*}3TD&Rp)2$&5+Dm2Tm}^8|JN-TU|>cTR#~0j8}7P6vvXALcvV z@1NCF5T~Ywsp9psPPg--+cq-A>t0onfX%M7Q+46uN_0a%lPyh*d-yr>nkqSELHv!dH_0R>S20k6xK790XlvmxCe zQUOA@LN5Wa1h)$`0k9Ca(?kK71h<1p0sjKGnoI#h0Rcgm#DoH!w;N6Y!4m;Ex7}d@ zX$`ktZvl7-x9)fWI03gldI2&80a3S$O#& { public static final QHashTag hashTag = new QHashTag("hashTag"); + public final ListPath hashTagMaps = this.createList("hashTagMaps", HashTagMap.class, QHashTagMap.class, PathInits.DIRECT2); + public final NumberPath id = createNumber("id", Long.class); public final StringPath name = createString("name"); - public final ListPath posts = this.createList("posts", Post.class, QPost.class, PathInits.DIRECT2); - public final NumberPath tagCount = createNumber("tagCount", Long.class); public QHashTag(String variable) { diff --git a/src/main/generated/com/example/just/Dao/QHashTagMap.java b/src/main/generated/com/example/just/Dao/QHashTagMap.java new file mode 100644 index 00000000..1f03d710 --- /dev/null +++ b/src/main/generated/com/example/just/Dao/QHashTagMap.java @@ -0,0 +1,54 @@ +package com.example.just.Dao; + +import static com.querydsl.core.types.PathMetadataFactory.*; + +import com.querydsl.core.types.dsl.*; + +import com.querydsl.core.types.PathMetadata; +import javax.annotation.processing.Generated; +import com.querydsl.core.types.Path; +import com.querydsl.core.types.dsl.PathInits; + + +/** + * QHashTagMap is a Querydsl query type for HashTagMap + */ +@Generated("com.querydsl.codegen.DefaultEntitySerializer") +public class QHashTagMap extends EntityPathBase { + + private static final long serialVersionUID = -1800252931L; + + private static final PathInits INITS = PathInits.DIRECT2; + + public static final QHashTagMap hashTagMap = new QHashTagMap("hashTagMap"); + + public final QHashTag hashTag; + + public final NumberPath id = createNumber("id", Long.class); + + public final QPost post; + + public QHashTagMap(String variable) { + this(HashTagMap.class, forVariable(variable), INITS); + } + + public QHashTagMap(Path path) { + this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS)); + } + + public QHashTagMap(PathMetadata metadata) { + this(metadata, PathInits.getFor(metadata, INITS)); + } + + public QHashTagMap(PathMetadata metadata, PathInits inits) { + this(HashTagMap.class, metadata, inits); + } + + public QHashTagMap(Class type, PathMetadata metadata, PathInits inits) { + super(type, metadata, inits); + this.hashTag = inits.isInitialized("hashTag") ? new QHashTag(forProperty("hashTag")) : null; + this.post = inits.isInitialized("post") ? new QPost(forProperty("post"), inits.get("post")) : null; + } + +} + diff --git a/src/main/generated/com/example/just/Dao/QPost.java b/src/main/generated/com/example/just/Dao/QPost.java index f849137a..b359a1f5 100644 --- a/src/main/generated/com/example/just/Dao/QPost.java +++ b/src/main/generated/com/example/just/Dao/QPost.java @@ -28,7 +28,7 @@ public class QPost extends EntityPathBase { public final StringPath emoticon = createString("emoticon"); - public final ListPath hashTags = this.createList("hashTags", HashTag.class, QHashTag.class, PathInits.DIRECT2); + public final ListPath hashTagMaps = this.createList("hashTagMaps", HashTagMap.class, QHashTagMap.class, PathInits.DIRECT2); public final ListPath likedMembers = this.createList("likedMembers", Member.class, QMember.class, PathInits.DIRECT2); diff --git a/src/main/generated/com/example/just/Mapper/MemberMapperImpl.java b/src/main/generated/com/example/just/Mapper/MemberMapperImpl.java index 8d11afb6..9a987b9b 100644 --- a/src/main/generated/com/example/just/Mapper/MemberMapperImpl.java +++ b/src/main/generated/com/example/just/Mapper/MemberMapperImpl.java @@ -10,7 +10,7 @@ @Generated( value = "org.mapstruct.ap.MappingProcessor", - date = "2024-03-06T15:49:26+0900", + date = "2024-03-07T17:11:37+0900", comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-7.2.jar, environment: Java 11.0.11 (AdoptOpenJDK)" ) @Component diff --git a/src/main/generated/com/example/just/Mapper/PostMapperImpl.java b/src/main/generated/com/example/just/Mapper/PostMapperImpl.java index 0b0c9278..292ff997 100644 --- a/src/main/generated/com/example/just/Mapper/PostMapperImpl.java +++ b/src/main/generated/com/example/just/Mapper/PostMapperImpl.java @@ -10,7 +10,7 @@ @Generated( value = "org.mapstruct.ap.MappingProcessor", - date = "2024-03-06T15:49:26+0900", + date = "2024-03-07T17:11:38+0900", comments = "version: 1.5.3.Final, compiler: IncrementalProcessingEnvironment from gradle-language-java-7.2.jar, environment: Java 11.0.11 (AdoptOpenJDK)" ) @Component diff --git a/src/main/java/com/example/just/Controller/CommentController.java b/src/main/java/com/example/just/Controller/CommentController.java index d1bc1d55..8b154d74 100644 --- a/src/main/java/com/example/just/Controller/CommentController.java +++ b/src/main/java/com/example/just/Controller/CommentController.java @@ -57,7 +57,7 @@ public class CommentController { + " \"child\": []\n" + " \"message\": \"입력 완료\"\n" + "}"), - @ApiResponse(responseCode = "404", description = "{\n" + @ApiResponse(responseCode = "400", description = "{\n" + " \"comment_id\": \"\",\n" + " \"comment_create_time\": 0\n" + " \"comment_create_time\": \"\",\n" @@ -109,7 +109,7 @@ public ResponseEntity deleteComment(@PathVariable Long post_id, @PathVar @ApiOperation(value = "댓글 수정") @ApiResponses(value = { @ApiResponse(responseCode = "200",description = "댓글 내용"), - @ApiResponse(responseCode = "404",description = "댓글이 존재하지 않습니다.\n게시물이 존재하지 않습니다.") + @ApiResponse(responseCode = "400",description = "댓글이 존재하지 않습니다.\n게시물이 존재하지 않습니다.") }) @PutMapping("/put/comment/{post_id}/{comment_id}") public ResponseEntity putComment(@PathVariable Long post_id, @PathVariable Long comment_id, diff --git a/src/main/java/com/example/just/Controller/SearchController.java b/src/main/java/com/example/just/Controller/SearchController.java index a94c1811..d045dbbd 100644 --- a/src/main/java/com/example/just/Controller/SearchController.java +++ b/src/main/java/com/example/just/Controller/SearchController.java @@ -32,6 +32,11 @@ public class SearchController { @GetMapping("/get/search/post") @Operation(summary = "게시글 내용 검색", description = "해당 keyword를 content에 포함하는 게시글 검색\n태그검색구현시 추후 변경 가능") + @ApiResponses(value = { + @ApiResponse(responseCode = "400", description = "{\n" + + " \"message\": \"로그인 후 검색가능합니다.\"\n" + + "}") + }) public ResponseEntity getPosts(@RequestParam String keyword,@RequestParam int page, HttpServletRequest request) { return searchService.searchPostContent(request,keyword,page-1); } diff --git a/src/main/java/com/example/just/Dao/HashTag.java b/src/main/java/com/example/just/Dao/HashTag.java index 89b29104..86633925 100644 --- a/src/main/java/com/example/just/Dao/HashTag.java +++ b/src/main/java/com/example/just/Dao/HashTag.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.ArrayList; import java.util.List; +import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -12,8 +13,12 @@ import javax.persistence.JoinTable; import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; import lombok.Builder; +import lombok.Builder.Default; import lombok.Getter; +import lombok.NoArgsConstructor; import lombok.Setter; @Entity @@ -31,14 +36,18 @@ public class HashTag { @Column(name = "tag_count") private Long tagCount; - @ManyToMany() - @JoinTable( - name = "hash_tag_map", - joinColumns = @JoinColumn(name = "hash_tag_id"), - inverseJoinColumns = @JoinColumn(name = "post_id") - ) - @JsonIgnore - @Builder.Default - private List posts = new ArrayList<>(); + @OneToMany(mappedBy = "hashTag", cascade = CascadeType.REMOVE) + private List hashTagMaps = new ArrayList<>(); + + public HashTag() { + } + + public HashTag(String name) { + this.name = name; + } + + public void addHashTagMap(HashTagMap hashTagMap) { + this.hashTagMaps.add(hashTagMap); + } } \ No newline at end of file diff --git a/src/main/java/com/example/just/Dao/HashTagMap.java b/src/main/java/com/example/just/Dao/HashTagMap.java new file mode 100644 index 00000000..fff7c2ff --- /dev/null +++ b/src/main/java/com/example/just/Dao/HashTagMap.java @@ -0,0 +1,36 @@ +package com.example.just.Dao; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Entity +@Getter +@Setter +@NoArgsConstructor +public class HashTagMap { + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE) + @Column(name = "id", nullable = false) + private Long id; + + @ManyToOne + @JoinColumn(name = "post_id") + private Post post; + + @ManyToOne + @JoinColumn(name = "hash_tag_id") + private HashTag hashTag; + + public HashTagMap(HashTag newHashTag, Post p) { + this.hashTag = newHashTag; + this.post = p; + } +} diff --git a/src/main/java/com/example/just/Dao/Post.java b/src/main/java/com/example/just/Dao/Post.java index 33f99e7e..4cd459b8 100644 --- a/src/main/java/com/example/just/Dao/Post.java +++ b/src/main/java/com/example/just/Dao/Post.java @@ -56,16 +56,15 @@ public class Post { @Builder.Default private List likedMembers = new ArrayList<>(); - @Builder.Default - @ManyToMany(mappedBy = "posts") - private List hashTags = new ArrayList<>(); + @OneToMany(mappedBy = "post", cascade = CascadeType.REMOVE) + private List hashTagMaps = new ArrayList<>(); @ManyToOne() @JoinColumn(name = "member_id") //글을쓴 Member_id @JsonIgnore private Member member; - @OneToMany(mappedBy = "post", cascade = CascadeType.REMOVE) + @OneToMany(mappedBy = "post", orphanRemoval = true) private List comments = new ArrayList<>(); @Column(name = "blamed_count") private Long blamedCount; @@ -123,7 +122,6 @@ public boolean getSecret() { } public void changePost(PutPostDto postDto, Member member, Post post) { - /* this.post_id = post.getPost_id(); this.member = member; this.setPost_create_time(new Date(System.currentTimeMillis())); @@ -131,16 +129,6 @@ public void changePost(PutPostDto postDto, Member member, Post post) { this.post_picture = postDto.getPost_picture(); this.secret = postDto.getSecret(); this.postContent = postDto.getPost_content(); - this.hash_tag = null; - if (postDto.getHash_tage() != null) { - for (int i = 0; i < postDto.getHash_tage().size(); i++) { - String hashTag_name = postDto.getHash_tage().get(i); - HashTag hashTag = new HashTag(hashTag_name); - addHashTag(hashTag); - } - } - - */ } public List getHashTag() { @@ -155,4 +143,9 @@ public List getHashTag() { */ return array; } + + + public void addHashTagMaps(HashTagMap hashTagMap) { + this.hashTagMaps.add(hashTagMap); + } } \ No newline at end of file diff --git a/src/main/java/com/example/just/Response/ResponseMessage.java b/src/main/java/com/example/just/Response/ResponseMessage.java new file mode 100644 index 00000000..10aaf96d --- /dev/null +++ b/src/main/java/com/example/just/Response/ResponseMessage.java @@ -0,0 +1,13 @@ +package com.example.just.Response; + +import lombok.Builder; +import lombok.Getter; + +@Builder +@Getter +public class ResponseMessage { + private String message; + public ResponseMessage(String m){ + message = m; + } +} diff --git a/src/main/java/com/example/just/Service/SearchService.java b/src/main/java/com/example/just/Service/SearchService.java index 7024fc07..912ba9d4 100644 --- a/src/main/java/com/example/just/Service/SearchService.java +++ b/src/main/java/com/example/just/Service/SearchService.java @@ -6,6 +6,7 @@ import com.example.just.Repository.MemberRepository; import com.example.just.Repository.PostContentESRespository; import com.example.just.Repository.PostRepository; +import com.example.just.Response.ResponseMessage; import com.example.just.Response.ResponseSearchDto; import com.example.just.jwt.JwtProvider; import java.util.Comparator; @@ -16,6 +17,7 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; +import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; @@ -39,6 +41,9 @@ public class SearchService { public ResponseEntity searchPostContent(HttpServletRequest request,String keyword,int page){ String token = jwtProvider.getAccessToken(request); + if(token == null){ + return new ResponseEntity(new ResponseMessage("로그인 후 검색가능합니다."),null, HttpStatus.BAD_REQUEST); + } Long id = Long.valueOf(jwtProvider.getIdFromToken(token)); //토큰 List blames = blameRepository.findByBlameMemberId(id); //유저가 신고한 게시글 id들