Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
마현우 committed Apr 10, 2024
2 parents 73a093a + d0ffee4 commit c0b52ea
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions setting/convention.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ githook {
// task = "check"
}
}
}

conventionalCommits {
ignoreCommitMessage = ".*(merge|Merge).*"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.springframework.transaction.annotation.Transactional;

import com.project.bumawiki.domain.docs.implementation.DocsDeleter;
import com.project.bumawiki.domain.thumbsup.implementation.ThumbsUpDeleter;

import lombok.RequiredArgsConstructor;

Expand All @@ -12,8 +13,10 @@
@RequiredArgsConstructor
public class DocsDeleteService {
private final DocsDeleter docsDeleter;
private final ThumbsUpDeleter thumbsUpDeleter;

public void execute(Long id) {
docsDeleter.delete(id);
thumbsUpDeleter.deleteAllByDocsId(id);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.project.bumawiki.domain.thumbsup.domain.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;

import com.project.bumawiki.domain.docs.domain.Docs;
Expand All @@ -11,4 +13,6 @@ public interface ThumbsUpRepository extends JpaRepository<ThumbsUp, Long> {
Boolean existsByDocs_IdAndUser(Long docsId, User user);

void deleteByDocsAndUser(Docs docs, User user);

List<ThumbsUp> findByDocs_Id(Long docsId);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.project.bumawiki.domain.thumbsup.implementation;

import java.util.List;

import com.project.bumawiki.domain.thumbsup.domain.ThumbsUp;
import com.project.bumawiki.domain.thumbsup.domain.repository.ThumbsUpRepository;
import com.project.bumawiki.global.annotation.Implementation;

import lombok.RequiredArgsConstructor;

@Implementation
@RequiredArgsConstructor
public class ThumbsUpDeleter {
private final ThumbsUpRepository thumbsUpRepository;

public void deleteAllByDocsId(Long docsId) {
List<ThumbsUp> thumbsUps = thumbsUpRepository.findByDocs_Id(docsId);
thumbsUpRepository.deleteAllInBatch(thumbsUps);
}
}

0 comments on commit c0b52ea

Please sign in to comment.