Skip to content

Commit

Permalink
♻️ refactor: updated codebase #2
Browse files Browse the repository at this point in the history
  • Loading branch information
pnguyen215 committed Nov 17, 2023
1 parent 13a8c43 commit dc04433
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/core/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ func (c *CoreCommand) routes(core *gin.Engine) {
c.handlers.commonHandler.OnPsqlStatus)
v1.GET("/common/consumer", // endpoint websocket: ws://127.0.0.1:8081/api/v1/common/consumer
c.handlers.middlewares.RequestMiddleWare(),
c.handlers.commonHandler.SubscribeMessage)
c.handlers.commonHandler.OnSubscribe)
v1.POST("/common/producer", // endpoint produce message to websocket
c.handlers.middlewares.RequestMiddleWare(),
c.handlers.commonHandler.OnMessage)
c.handlers.commonHandler.OnProduce)
}
}
4 changes: 2 additions & 2 deletions internal/handlers/common_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ func (h *CommonHandler) OnPsqlStatus(ctx *gin.Context) {
return
}

func (h *CommonHandler) SubscribeMessage(ctx *gin.Context) {
func (h *CommonHandler) OnSubscribe(ctx *gin.Context) {
h.wsSvc.SubscribeMessage(ctx)
}

func (h *CommonHandler) OnMessage(ctx *gin.Context) {
func (h *CommonHandler) OnProduce(ctx *gin.Context) {
response := entity.NewResponseEntity()
var message wsconnx.WsConnMessagePayload
message.SetGenesisTimestamp(time.Now())
Expand Down

0 comments on commit dc04433

Please sign in to comment.