package controllers import ( "apigame/models" "apigame/service/code-msg" "apigame/service/roomrank" "fmt" ) // DemoController 绑定控制器 type DemoController struct { BaseController } // Demo demo func (c *DemoController) Demo() { req := new(models.ReqDemo) if !c.GetPostData(req) { return } rsp := models.RspDemo{} fmt.Println("DemoController.demo") { room := &roomrank.DataRoomRankRoom{Uid: req.UID, ActivityId: 1} roomrank.SaveRoom(req.GameID, room) fmt.Println(room.Id) } c.RetRspCodeData(code_msg.RECODE_OK, rsp) }