Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
gostnops
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
gostnops
Commits
6e2d6a4e
Commit
6e2d6a4e
authored
Dec 01, 2020
by
李志信
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: change zh to en
parent
8f9a780b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
parser.go
jparser/parser.go
+3
-3
No files found.
jparser/parser.go
View file @
6e2d6a4e
...
...
@@ -75,7 +75,7 @@ func RemoveTargetNameField(v interface{}, targetName string) interface{} {
func
(
jsp
*
jsonStructParser
)
cb
(
key
[]
byte
,
value
[]
byte
,
dataType
jsonparser
.
ValueType
,
offset
int
)
error
{
switch
dataType
{
case
jsonparser
.
Object
:
//
嵌套子结构
case
jsonparser
.
Object
:
//
sub interface parse
newParser
:=
newJSONStructParser
()
subObj
:=
newParser
.
json2Struct
(
value
)
jsp
.
hessianRegisterPair
=
append
(
jsp
.
hessianRegisterPair
,
HessianRegisterPair
{
...
...
@@ -88,7 +88,7 @@ func (jsp *jsonStructParser) cb(key []byte, value []byte, dataType jsonparser.Va
})
jsp
.
subObjValueMap
[
string
(
key
)]
=
reflect
.
ValueOf
(
subObj
)
case
jsonparser
.
Array
:
//
数组结构 TODO slice解析
case
jsonparser
.
Array
:
//
TODO slice parse
//newParser := newJSONStructParser()
//subObj := newParser.json2Struct(value)
//jsp.hessianRegisterPair = append(jsp.hessianRegisterPair, HessianRegisterPair{
...
...
@@ -100,7 +100,7 @@ func (jsp *jsonStructParser) cb(key []byte, value []byte, dataType jsonparser.Va
// Type: reflect.TypeOf(subObj),
//})
case
jsonparser
.
String
:
//
正常结构
case
jsonparser
.
String
:
//
normal struct parse
// "type@value"
arr
:=
strings
.
Split
(
string
(
value
),
"@"
)
var
userDefinedType
reflect
.
Type
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment