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 {