From cf7591bcb340a30c78a0036c30f8a572ee84b9e0 Mon Sep 17 00:00:00 2001 From: penglin2 Date: Wed, 14 Aug 2024 15:33:19 +0800 Subject: [PATCH] support omit in request struct --- types.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types.go b/types.go index 5d259bf..4040288 100644 --- a/types.go +++ b/types.go @@ -8,9 +8,9 @@ const ( ) type Request struct { - Header RequestHeader `json:"header"` + Header RequestHeader `json:"header,omitempty"` Parameter map[string]interface{} `json:"parameter,omitempty"` - Payload map[string]interface{} `json:"payload"` + Payload map[string]interface{} `json:"payload,omitempty"` } type TextPayload struct { @@ -126,7 +126,7 @@ type Header struct { } type AIaaSRequest struct { - Common map[string]interface{} `json:"common"` - Business map[string]interface{} `json:"business"` - Data map[string]interface{} `json:"data"` + Common map[string]interface{} `json:"common,omitempty"` + Business map[string]interface{} `json:"business,omitempty"` + Data map[string]interface{} `json:"data,omitempty"` }