MCPcopy Create free account
hub / github.com/LockGit/gochat / GetRoomInfo

Function GetRoomInfo

api/handler/push.go:131–149  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

129}
130
131func GetRoomInfo(c *gin.Context) {
132 var formRoomInfo FormRoomInfo
133 if err := c.ShouldBindBodyWith(&formRoomInfo, binding.JSON); err != nil {
134 tools.FailWithMsg(c, err.Error())
135 return
136 }
137 roomId := formRoomInfo.RoomId
138 req := &proto.Send{
139 RoomId: roomId,
140 Op: config.OpRoomInfoSend,
141 }
142 code, msg := rpc.RpcLogicObj.GetRoomInfo(req)
143 if code == tools.CodeFail {
144 tools.FailWithMsg(c, "rpc get room info fail!")
145 return
146 }
147 tools.SuccessWithMsg(c, "ok", msg)
148 return
149}

Callers

nothing calls this directly

Calls 3

FailWithMsgFunction · 0.92
SuccessWithMsgFunction · 0.92
GetRoomInfoMethod · 0.45

Tested by

no test coverage detected