remove usage of package gparser

This commit is contained in:
John Guo
2021-09-27 23:05:46 +08:00
parent 0a828aaed3
commit a9d7dc68a3
9 changed files with 11 additions and 383 deletions

View File

@ -2,10 +2,10 @@ package main
import (
"fmt"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/os/gctx"
"github.com/gogf/gf/database/gdb"
"github.com/gogf/gf/encoding/gparser"
"github.com/gogf/gf/frame/g"
)
@ -34,8 +34,8 @@ func main() {
fmt.Println(one.Xml())
// 自定义方法方法转换为json/xml
jsonContent, _ := gparser.VarToJson(one.Map())
jsonContent, _ := gjson.New(one.Map()).ToJson()
fmt.Println(string(jsonContent))
xmlContent, _ := gparser.VarToXml(one.Map())
xmlContent, _ := gjson.New(one.Map()).ToJson()
fmt.Println(string(xmlContent))
}