提交 b98787f7 authored 作者: 屈传平's avatar 屈传平

yh

上级 a0195ee6
......@@ -2,7 +2,9 @@ package yonghui
import (
"context"
"encoding/json"
"github.com/gogf/gf/encoding/gjson"
"strings"
)
var Msg = new(msg)
......@@ -21,8 +23,8 @@ type MsgPullRes struct {
Code string `json:"code"`
Message string `json:"message"`
Data []struct {
Id int64 `json:"id"`
Type string `json:"type"`
Id json.Number `json:"id"`
Type int `json:"type"`
CreateTime string `json:"createTime"`
MessageInfo string `json:"messageInfo"`
} `json:"data"`
......@@ -99,7 +101,9 @@ func (s *msg) Pull(ctx context.Context, req *MsgPullReq) (res *MsgPullRes, err e
if nil != err {
return
}
err = gjson.New(result).Scan(&res)
decoder := json.NewDecoder(strings.NewReader(result))
decoder.UseNumber()
decoder.Decode(&res)
return
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论