-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
728 additions
and
421 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
37 changes: 0 additions & 37 deletions
37
backend/src/main/java/com/twtw/backend/domain/TestController.java
This file was deleted.
Oops, something went wrong.
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
13 changes: 13 additions & 0 deletions
13
backend/src/main/java/com/twtw/backend/domain/friend/repository/FriendCommandRepository.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,13 @@ | ||
package com.twtw.backend.domain.friend.repository; | ||
|
||
import com.twtw.backend.domain.friend.entity.Friend; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
@Repository | ||
public interface FriendCommandRepository { | ||
Friend save(final Friend friend); | ||
List<Friend> findByMemberAndMemberNickname(final UUID memberId, final String nickname); | ||
} |
18 changes: 18 additions & 0 deletions
18
.../src/main/java/com/twtw/backend/domain/friend/repository/FriendCommandRepositoryImpl.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,18 @@ | ||
package com.twtw.backend.domain.friend.repository; | ||
|
||
import com.twtw.backend.domain.friend.entity.Friend; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
@Repository | ||
public interface FriendCommandRepositoryImpl extends JpaRepository<Friend, UUID>, FriendCommandRepository { | ||
|
||
@Query(value = "SELECT f.* FROM friend f JOIN member fm ON f.from_member_id = fm.id JOIN member tm ON f.to_member_id = tm.id WHERE f.friend_status = 'ACCEPTED' AND ((f.to_member_id = UNHEX(REPLACE(:memberId, '-', '')) AND MATCH(fm.nickname) AGAINST(:nickname IN BOOLEAN MODE)) OR (f.from_member_id = UNHEX(REPLACE(:memberId, '-', '')) AND MATCH(tm.nickname) AGAINST(:nickname IN BOOLEAN MODE)))", nativeQuery = true) | ||
List<Friend> findByMemberAndMemberNickname(@Param("memberId") final UUID memberId, @Param("nickname") final String nickname); | ||
Friend save(final Friend friend); | ||
} |
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
16 changes: 0 additions & 16 deletions
16
backend/src/main/java/com/twtw/backend/domain/friend/repository/FriendRepository.java
This file was deleted.
Oops, something went wrong.
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.