From 7cb9e6b02cacdea40ff724380f09621c1408bc52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Thu, 30 Jun 2022 18:12:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0api=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rpc.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rpc.go b/rpc.go index 7134860..52b5f17 100644 --- a/rpc.go +++ b/rpc.go @@ -132,6 +132,15 @@ func (r *request) AddServiceApi(serviceFlag string, apiConfig *Api) error { if len(apiConfig.SuccessHttpCodeList) == 0 { apiConfig.SuccessHttpCodeList = serviceInfo.SuccessHttpCodeList } + if len(apiConfig.CodeField) == 0 { + apiConfig.CodeField = serviceInfo.CodeField + } + if len(apiConfig.DataField) == 0 { + apiConfig.DataField = serviceInfo.DataField + } + if len(apiConfig.MessageField) == 0 { + apiConfig.MessageField = serviceInfo.MessageField + } r.lock.Lock() defer r.lock.Unlock() if nil == serviceInfo.ApiTable {