-
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.
Browse files
Browse the repository at this point in the history
Refactor/#154: 채팅방 서비스 리팩토링
- Loading branch information
Showing
23 changed files
with
698 additions
and
670 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
10 changes: 0 additions & 10 deletions
10
src/main/java/space/space_spring/dao/chat/ChatRoomDao.java
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
src/main/java/space/space_spring/dao/chat/ChatRoomRepository.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,12 @@ | ||
package space.space_spring.dao.chat; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
import space.space_spring.dao.chat.custom.ChatRoomRepositoryCustom; | ||
import space.space_spring.entity.ChatRoom; | ||
import space.space_spring.entity.enumStatus.BaseStatusType; | ||
|
||
@Repository | ||
public interface ChatRoomRepository extends JpaRepository<ChatRoom, Long>, ChatRoomRepositoryCustom { | ||
ChatRoom findByIdAndStatus(Long chatRoomId, BaseStatusType status); | ||
} |
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
15 changes: 0 additions & 15 deletions
15
src/main/java/space/space_spring/dao/chat/UserChatRoomDao.java
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
src/main/java/space/space_spring/dao/chat/UserChatRoomRepository.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,16 @@ | ||
package space.space_spring.dao.chat; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import space.space_spring.entity.ChatRoom; | ||
import space.space_spring.entity.User; | ||
import space.space_spring.entity.UserChatRoom; | ||
import space.space_spring.entity.enumStatus.BaseStatusType; | ||
|
||
import java.util.List; | ||
|
||
|
||
public interface UserChatRoomRepository extends JpaRepository<UserChatRoom, Long> { | ||
UserChatRoom findByUserAndChatRoomAndStatus(User userByUserId, ChatRoom chatRoomByChatRoomId, BaseStatusType status); | ||
|
||
List<UserChatRoom> findByChatRoomAndStatus(ChatRoom chatRoom, BaseStatusType status); | ||
} |
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
17 changes: 17 additions & 0 deletions
17
src/main/java/space/space_spring/dto/chat/dto/LastMessageInfoDto.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,17 @@ | ||
package space.space_spring.dto.chat.dto; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.HashMap; | ||
|
||
@Getter | ||
@Builder | ||
public class LastMessageInfoDto { | ||
|
||
private LocalDateTime lastUpdateTime; | ||
|
||
private HashMap<String, String> lastContent; | ||
} | ||
|
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
9 changes: 9 additions & 0 deletions
9
src/main/java/space/space_spring/entity/enumStatus/BaseStatusType.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,9 @@ | ||
package space.space_spring.entity.enumStatus; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum BaseStatusType { | ||
ACTIVE, | ||
INACTIVE; | ||
} |
Empty file.
Empty file.
Empty file.
20 changes: 20 additions & 0 deletions
20
src/main/java/space/space_spring/global/util/TimeUtils.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,20 @@ | ||
package space.space_spring.global.util; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import java.time.LocalDateTime; | ||
import java.time.ZoneId; | ||
|
||
@Component | ||
public class TimeUtils { | ||
|
||
/** | ||
* UTC 시간을 서울 시간으로 변환 | ||
*/ | ||
public LocalDateTime getEncodedTime(LocalDateTime originalTime) { | ||
return originalTime | ||
.atZone(ZoneId.of("UTC")) | ||
.withZoneSameInstant(ZoneId.of("Asia/Seoul")) | ||
.toLocalDateTime(); | ||
} | ||
} |
Oops, something went wrong.