-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develope' into feature/PC-333-CICD-docker
- Loading branch information
Showing
27 changed files
with
839 additions
and
71 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
26 changes: 26 additions & 0 deletions
26
api/src/main/java/org/yapp/domain/block/application/DirectBlockService.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,26 @@ | ||
package org.yapp.domain.block.application; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.yapp.application.AuthenticationService; | ||
import org.yapp.domain.block.DirectBlock; | ||
import org.yapp.domain.block.dao.DirectBlockRepository; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class DirectBlockService { | ||
|
||
private final DirectBlockRepository directBlockRepository; | ||
private final AuthenticationService authenticationService; | ||
|
||
public DirectBlock blockUser(Long blockId) { | ||
Long userId = authenticationService.getUserId(); | ||
return directBlockRepository.save(new DirectBlock(userId, blockId)); | ||
} | ||
|
||
public boolean checkBlock(Long userId, Long partnerId) { | ||
return directBlockRepository.existsDirectBlockByBlockingUserIdAndBlockedUserId(userId, | ||
partnerId); | ||
} | ||
|
||
} |
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
10 changes: 10 additions & 0 deletions
10
api/src/main/java/org/yapp/domain/block/dao/DirectBlockRepository.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,10 @@ | ||
package org.yapp.domain.block.dao; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.yapp.domain.block.DirectBlock; | ||
|
||
public interface DirectBlockRepository extends JpaRepository<DirectBlock, Long> { | ||
|
||
boolean existsDirectBlockByBlockingUserIdAndBlockedUserId(Long blockingUserId, | ||
Long blockedUserId); | ||
} |
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.