Skip to content

Commit 10b12d6

Browse files
author
sunhongtao
committed
fix: format field for response
1 parent f42d002 commit 10b12d6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

blockchain/service/http_handler.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,15 @@ func (h *HttpHandler) GetAccountResource(ctx *gin.Context) {
334334
return
335335
}
336336

337-
h.Success(ctx, string(b), gjson.Parse(res).Value(), ctx.Request.RequestURI)
337+
r := make(map[string]any, 4)
338+
gjson.Parse(res).ForEach(func(key, value gjson.Result) bool {
339+
k := key.String()
340+
k = strings.ToLower(k[:1]) + k[1:]
341+
r[k] = value.Value()
342+
return true
343+
})
344+
345+
h.Success(ctx, string(b), r, ctx.Request.RequestURI)
338346
}
339347

340348
// EstimateGasForTron ,for only tron

0 commit comments

Comments
 (0)