y595705120 3 years ago
parent
commit
b8734bc2c0
2 changed files with 13 additions and 0 deletions
  1. 12 0
      apis/game/qmbz.go
  2. 1 0
      route/index.go

+ 12 - 0
apis/game/qmbz.go

@@ -3,6 +3,8 @@ package game
 import (
 	"encoding/json"
 	"fmt"
+	"io/ioutil"
+	"net/http"
 	"ordonnance/common/auth"
 	"ordonnance/common/db"
 	"ordonnance/common/util"
@@ -112,6 +114,16 @@ func ServerList(c *gin.Context) {
 	c.JSON(200, retData)
 }
 
+func RecordAction(c *gin.Context) {
+	appId := c.PostForm("appId")
+	appSecret := c.PostForm("appSecret")
+	data := c.PostForm("data")
+	body, _ := ioutil.ReadAll(c.Request.Body)
+	// 验证参数
+	logger.Info("log", appId, appSecret, data, string(body))
+	c.JSON(http.StatusOK, response.NewMessage(response.OK))
+}
+
 func GetGate(c *gin.Context) {
 	tokenData, err := util.ParseToken(c.PostForm("token"))
 	if err != nil {

+ 1 - 0
route/index.go

@@ -23,6 +23,7 @@ func RunService(myport string) {
 	r.POST("/account/register", game.Register)
 	r.POST("/account/serverList", game.ServerList)
 	r.POST("/account/getGate", game.GetGate)
+	r.POST("/qmbz/recordAction", game.RecordAction)
 	//
 	logger.Infof("strat http server @port=%s", myport)
 	r.Run(":" + myport)