package controllers import ( "fmt" "git.rosy.net.cn/baseapi/utils" "github.com/astaxie/beego/server/web" "io/ioutil" ) type AliApiController struct { web.Controller } type CallBack struct { Code int `json:"code"` Msg string `json:"msg"` } func (c *AliApiController) SecretNumberMsg() { data, _ := ioutil.ReadAll(c.Ctx.Request.Body) values, _ := utils.HTTPBody2Values(data, false) fmt.Println(values) mapData := utils.URLValues2Map(values) fmt.Println(mapData) c.Data["json"] = &CallBack{ Code: 0, Msg: "成功", } c.ServeJSON() }