This commit is contained in:
suyl
2021-09-06 10:49:12 +08:00
parent f5f8bdb199
commit 46f705278f
6 changed files with 76 additions and 11 deletions

View File

@@ -1,9 +1,11 @@
package controllers
import (
"fmt"
"encoding/json"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxstore/secretNumber"
"github.com/astaxie/beego/server/web"
"io/ioutil"
)
type AliApiController struct {
@@ -16,7 +18,16 @@ type CallBack struct {
}
func (c *AliApiController) SecretNumberMsg() {
fmt.Println(utils.Format4Output(c.Ctx.Request, true))
data, _ := ioutil.ReadAll(c.Ctx.Request.Body)
values, _ := utils.HTTPBody2Values(data, false)
mapData := utils.URLValues2Map(values)
//东西在key上
var res *secretNumber.SecretNumberMsgRes
for k, _ := range mapData {
if err := json.Unmarshal([]byte(k), &res); err == nil {
secretNumber.CallbackBrandBill(res)
}
}
c.Data["json"] = &CallBack{
Code: 0,
Msg: "成功",