jaryhe 7 月之前
父節點
當前提交
092a2b93c5
共有 1 個文件被更改,包括 17 次插入3 次删除
  1. 17 3
      common.in/utils/response_param.go

+ 17 - 3
common.in/utils/response_param.go

@@ -326,11 +326,25 @@ func GetResponseParam(checkApiResult apis.CheckMerchantApiResult, param interfac
 					retMap[v.Name] = m[v.Name]
 				}
 			}else{
+				key := v.Name
 				if v.In != "" {
-					retMap[v.In] = ""
-				} else {
-					retMap[v.Name] = ""
+					key = v.In
+					//retMap[v.In] = ""
 				}
+				if v.Type == "int"{
+					retMap[key] = 0
+				}else if v.Type == "float"{
+					retMap[key] = 0
+				}else if v.Type == "bool"{
+					retMap[key] = false
+				}else if v.Type == "string"{
+					retMap[key] = ""
+				}else if v.Type == "struct"{
+					retMap[key] = make(map[string]interface{})
+				}else if strings.Contains(v.Type,"list"){
+					retMap[key] = make([]interface{},0)
+				}
+
 			}
 		}
 	}