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

yh

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