作者 yangfu

1.推送修改 :默认ios通知栏里面只有内容行,不显示标题行,后期需要标题需要 ext里面增加扩展配置

... ... @@ -3,6 +3,7 @@ package utils
import (
"encoding/json"
"fmt"
"strings"
"testing"
)
... ... @@ -61,13 +62,21 @@ func TestMergeMap(t *testing.T) {
}
func TestIntUnmarsh(t *testing.T) {
jsonString := `{"id":8242051651122944}`
jsonString := `{"id":117605700954227712}`
type param struct {
Id int `json:"id"`
Id interface{} `json:"id"`
}
var p param
json.Unmarshal([]byte(jsonString), &p)
t.Log(p)
jsonByte, _ := json.Marshal(p)
t.Log(string(jsonByte))
decoder := json.NewDecoder(strings.NewReader(jsonString))
decoder.UseNumber()
var p2 param
decoder.Decode(&p2)
t.Log(p2)
jsonByte2, _ := json.Marshal(p2)
t.Log(string(jsonByte2))
}
... ...
package v1
import (
"bytes"
"encoding/json"
"gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/log"
push "openapi/pkg/application/push/service"
"openapi/pkg/application/push/service"
protocol "openapi/pkg/domain"
"openapi/pkg/port/beego/controllers"
)
... ... @@ -20,7 +21,9 @@ func (this *PushController) PushInfo() {
this.Resp(msg)
}()
var request *protocol.PushInfoRequest
if err := json.Unmarshal(this.ByteBody, &request); err != nil {
decoder := json.NewDecoder(bytes.NewBuffer(this.ByteBody))
decoder.UseNumber()
if err := decoder.Decode(&request); err != nil {
log.Error(err)
msg = protocol.BadRequestParam(1)
return
... ...