增加api默认值的处理

This commit is contained in:
白茶清欢 2022-06-30 18:12:49 +08:00
parent bc59aba0ec
commit 7cb9e6b02c

9
rpc.go
View File

@ -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 {