(c *gin.Context)
| 105 | } |
| 106 | |
| 107 | func 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 | |
| 127 | type FormRoomInfo struct { |
| 128 | RoomId int `form:"roomId" json:"roomId" binding:"required"` |
nothing calls this directly
no test coverage detected