-
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 pull request #165 from Kusitms-29th-MeetUp-H/feat/157-room
[fix]:Main 채팅방 유저 추가 로직 수정
- Loading branch information
Showing
4 changed files
with
29 additions
and
16 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
19 changes: 19 additions & 0 deletions
19
Main/src/main/java/com/kusitms29/backendH/domain/chat/service/RoomReader.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,19 @@ | ||
package com.kusitms29.backendH.domain.chat.service; | ||
|
||
import com.kusitms29.backendH.domain.chat.entity.Room; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.data.mongodb.core.MongoTemplate; | ||
import org.springframework.data.mongodb.core.query.Criteria; | ||
import org.springframework.data.mongodb.core.query.Query; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class RoomReader { | ||
private final MongoTemplate mongoTemplate; | ||
public Room getRoomBySyncName(String syncName){ | ||
Query query = new Query(); | ||
query.addCriteria(Criteria.where("syncName").is(syncName)); | ||
return mongoTemplate.findOne(query, Room.class); | ||
} | ||
} |
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