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

Function Count

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

Source from the content-addressed store, hash-verified

105}
106
107func Count(c *gin.Context) {
108 var formCount FormCount
109 if err := c.ShouldBindBodyWith(&formCount, binding.JSON); err != nil {
110 tools.FailWithMsg(c, err.Error())
111 return
112 }
113 roomId := formCount.RoomId
114 req := &proto.Send{
115 RoomId: roomId,
116 Op: config.OpRoomCountSend,
117 }
118 code, msg := rpc.RpcLogicObj.Count(req)
119 if code == tools.CodeFail {
120 tools.FailWithMsg(c, "rpc get room count fail!")
121 return
122 }
123 tools.SuccessWithMsg(c, "ok", msg)
124 return
125}
126
127type FormRoomInfo struct {
128 RoomId int `form:"roomId" json:"roomId" binding:"required"`

Callers

nothing calls this directly

Calls 3

FailWithMsgFunction · 0.92
SuccessWithMsgFunction · 0.92
CountMethod · 0.45

Tested by

no test coverage detected