-
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.
#16 feat: PartyChattingRoom에 가입하는 멤버정보(ParticipantInfo) 추가 API구현
- Loading branch information
Showing
10 changed files
with
187 additions
and
31 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
25 changes: 25 additions & 0 deletions
25
src/main/java/shop/geeksasangchat/domain/ParticipantInfo.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,25 @@ | ||
package shop.geeksasangchat.domain; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
import org.springframework.data.mongodb.core.mapping.Document; | ||
|
||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
|
||
@Document //@Document는객체를 몽고DB에 영속화시킴 = SpringDataJpa의 @Entity와 같은 역할 | ||
@ToString | ||
@Getter | ||
@NoArgsConstructor | ||
public class ParticipantInfo { | ||
private LocalDateTime enterTime; | ||
private boolean isRemittance; | ||
private String nickName; | ||
|
||
public ParticipantInfo(LocalDateTime enterTime, boolean isRemittance, String nickName) { | ||
this.enterTime = enterTime; | ||
this.isRemittance = isRemittance; | ||
this.nickName = nickName; | ||
} | ||
} |
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
18 changes: 18 additions & 0 deletions
18
src/main/java/shop/geeksasangchat/dto/chattingmember/PostParticipantInfoReq.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 shop.geeksasangchat.dto.chattingmember; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.validation.constraints.NotEmpty; | ||
import java.time.LocalDateTime; | ||
|
||
@NoArgsConstructor | ||
@Getter | ||
public class PostParticipantInfoReq { | ||
@NotEmpty | ||
private String chattingRoomId; | ||
|
||
private Boolean isRemittance; | ||
@NotEmpty | ||
private String nickName; | ||
} |
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
14 changes: 14 additions & 0 deletions
14
src/main/java/shop/geeksasangchat/repository/PartyChattingRoomRepository.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,14 @@ | ||
package shop.geeksasangchat.repository; | ||
|
||
import org.springframework.data.mongodb.repository.MongoRepository; | ||
import org.springframework.data.mongodb.repository.Query; | ||
import shop.geeksasangchat.domain.ChattingRoom; | ||
import shop.geeksasangchat.domain.PartyChattingRoom; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface PartyChattingRoomRepository extends MongoRepository<PartyChattingRoom, String> { | ||
@Query("{id:'?0'}") // 0번째 파라미터 조건 | ||
Optional<PartyChattingRoom> findByPartyChattingRoomId(String id); | ||
} |
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