-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat : 채팅방과 관련된 서비스 구현을 진행합니다. #91
Changes from 10 commits
f456dca
f28cbbc
a581961
90f03c4
9ded1c8
d5eaac3
a8f4e14
2a27700
47e9818
616fdee
2a5decb
223244f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ func NewRouter(app *firebaseinfra.FirebaseApp) (*echo.Echo, error) { | |
breedService := service.NewBreedService(db) | ||
sosPostService := service.NewSOSPostService(db) | ||
conditionService := service.NewSOSConditionService(db) | ||
// chatService := service.NewChatService(db) | ||
chatService := service.NewChatService(db) | ||
|
||
// Initialize handlers | ||
authHandler := handler.NewAuthHandler(authService, kakaoinfra.NewKakaoDefaultClient()) | ||
|
@@ -64,6 +64,7 @@ func NewRouter(app *firebaseinfra.FirebaseApp) (*echo.Echo, error) { | |
breedHandler := handler.NewBreedHandler(*breedService) | ||
sosPostHandler := handler.NewSOSPostHandler(*sosPostService, authService) | ||
conditionHandler := handler.NewConditionHandler(*conditionService) | ||
chatHandler := handler.NewChatHandler(authService, *chatService) | ||
|
||
// // InMemoryStateManager는 클라이언트와 채팅방의 상태를 메모리에 저장하고 관리합니다. | ||
// // 이 메서드는 단순하고 빠르며 테스트 목적으로 적합합니다. | ||
|
@@ -72,7 +73,7 @@ func NewRouter(app *firebaseinfra.FirebaseApp) (*echo.Echo, error) { | |
// wsServer := chat.NewWebSocketServer(stateManager) | ||
// go wsServer.Run() | ||
// chat.InitializeWebSocketServer(ctx, wsServer, chatService) | ||
// chatHandler := handler.NewChatController(wsServer, stateManager, authService, *chatService) | ||
// chatHandler := handler.NewChatHandler(wsServer, stateManager, authService, *chatService) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기 지워도 될 듯합니다 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NewChatHandler 말씀하시는거 맞을까요? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 넵 주석이기도 하고 이미 chatHandler 생성을 위에서 하셔서 여긴 필요 없을 것 같아요! |
||
|
||
// RegisterChan middlewares | ||
logger := zerolog.New(os.Stdout) | ||
|
@@ -142,13 +143,6 @@ func NewRouter(app *firebaseinfra.FirebaseApp) (*echo.Echo, error) { | |
postAPIGroup.GET("/sos/conditions", conditionHandler.FindConditions) | ||
} | ||
|
||
// chatAPIGroup := apiRouteGroup.Group("/chat") | ||
// { | ||
// chatAPIGroup.GET("/ws", func(c echo.Context) error { | ||
// return chatHandler.ServerWebsocket(c, c.Response().Writer, c.Request()) | ||
// }) | ||
// } | ||
|
||
upgrader := wschat.NewDefaultUpgrader() | ||
wsServerV2 := wschat.NewWSServer(upgrader, authService, *mediaService) | ||
|
||
|
@@ -157,6 +151,12 @@ func NewRouter(app *firebaseinfra.FirebaseApp) (*echo.Echo, error) { | |
chatAPIGroup := apiRouteGroup.Group("/chat") | ||
{ | ||
chatAPIGroup.GET("/ws", wsServerV2.HandleConnections) | ||
chatAPIGroup.POST("/rooms", chatHandler.CreateRoom) | ||
chatAPIGroup.PUT("/rooms/:roomID/join", chatHandler.JoinChatRoom) | ||
chatAPIGroup.PUT("/rooms/:roomID/leave", chatHandler.LeaveChatRoom) | ||
chatAPIGroup.GET("/rooms/:roomID", chatHandler.FindRoomByID) | ||
chatAPIGroup.GET("/rooms", chatHandler.FindAllRooms) | ||
chatAPIGroup.GET("/rooms/:roomID/messages", chatHandler.FindMessagesByRoomID) | ||
} | ||
|
||
return e, nil | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prev, next는 optional string 이어야 해요. 지금은 optional integer 군요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
맞아요 id값 uuid으로 마이그레이션 진행될 경우 변경할 예정입니다.
현재는, integer 값으로 설정되어있어 임시로 처리한 상황입니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chat 쪽은 마이그레이션 대상이 아니었긴 한데... 한번에 해도 괜찮을 것 같긴 하네요
그럼 한번에 epic 브랜치에서 리베이스해서 다시 마이그레이션 PR 업데이트해볼게요