-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HotFix] Disable frameOptions (#259)
* [Refactor/#254] add query of delete board with relations * [Refactor/#254] complete remove question with relations * [Refactor/#254] unify delete board query * [Refactor/#254] apply unified deleting board query at each controller method * [Refactor/#254] apply unified deleting board query at schedule controller method * [HotFix] Disable frameOptions --------- Co-authored-by: hann <wjdgks1233@gmail.com>
- Loading branch information
1 parent
2fa7c08
commit fd7cb38
Showing
27 changed files
with
166 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...ersistence/dao/board/BoardRepository.java → ...stence/dao/board/jpa/BoardRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
.../com/example/waggle/domain/board/persistence/dao/board/querydsl/BoardQueryRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.example.waggle.domain.board.persistence.dao.board.querydsl; | ||
|
||
import com.example.waggle.domain.board.persistence.entity.BoardType; | ||
|
||
public interface BoardQueryRepository { | ||
void deleteBoardsWithRelations(BoardType boardType, Long boardId); | ||
} |
53 changes: 53 additions & 0 deletions
53
.../example/waggle/domain/board/persistence/dao/board/querydsl/BoardQueryRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.example.waggle.domain.board.persistence.dao.board.querydsl; | ||
|
||
import com.example.waggle.domain.board.persistence.entity.BoardType; | ||
import com.example.waggle.exception.object.general.GeneralException; | ||
import com.example.waggle.exception.payload.code.ErrorStatus; | ||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import static com.example.waggle.domain.board.persistence.entity.QQuestion.question; | ||
import static com.example.waggle.domain.board.persistence.entity.QSiren.siren; | ||
import static com.example.waggle.domain.board.persistence.entity.QStory.story; | ||
import static com.example.waggle.domain.hashtag.persistence.entity.QBoardHashtag.boardHashtag; | ||
import static com.example.waggle.domain.media.persistence.entity.QMedia.media; | ||
import static com.example.waggle.domain.recommend.persistence.entity.QRecommend.recommend; | ||
import static com.example.waggle.domain.schedule.persistence.entity.QMemberSchedule.memberSchedule; | ||
import static com.example.waggle.domain.schedule.persistence.entity.QSchedule.schedule; | ||
|
||
@RequiredArgsConstructor | ||
@Repository | ||
public class BoardQueryRepositoryImpl implements BoardQueryRepository { | ||
private final JPAQueryFactory queryFactory; | ||
|
||
|
||
@Override | ||
public void deleteBoardsWithRelations(BoardType boardType, Long boardId) { | ||
queryFactory.delete(media).where(media.board.id.eq(boardId)).execute(); | ||
queryFactory.delete(boardHashtag).where(boardHashtag.board.id.eq(boardId)).execute(); | ||
queryFactory.delete(recommend).where(recommend.board.id.eq(boardId)).execute(); | ||
deleteByBoardType(boardType, boardId); | ||
} | ||
|
||
private void deleteByBoardType(BoardType boardType, Long boardId) { | ||
switch (boardType) { | ||
case STORY -> { | ||
queryFactory.delete(story).where(story.id.eq(boardId)).execute(); | ||
} | ||
case QUESTION -> { | ||
queryFactory.delete(question).where(question.id.eq(boardId)).execute(); | ||
} | ||
case SIREN -> { | ||
queryFactory.delete(siren).where(siren.id.eq(boardId)).execute(); | ||
} | ||
case SCHEDULE -> { | ||
queryFactory.delete(memberSchedule).where(memberSchedule.schedule.id.eq(boardId)).execute(); | ||
queryFactory.delete(schedule).where(schedule.id.eq(boardId)).execute(); | ||
} | ||
default -> { | ||
throw new GeneralException(ErrorStatus.BOARD_INVALID_TYPE); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/example/waggle/domain/chat/persistence/entity/ChatMessageType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package com.example.waggle.domain.chat.persistence.entity; | ||
|
||
public enum ChatMessageType { | ||
JOIN, LEAVE, TALK | ||
JOIN, LEAVE, TALK, ENTER | ||
} |
2 changes: 1 addition & 1 deletion
2
...com/example/waggle/domain/conversation/application/comment/CommentCommandServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...com/example/waggle/domain/conversation/persistence/dao/comment/jpa/CommentRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.