jaryhe 7 mēneši atpakaļ
vecāks
revīzija
092a2b93c5
1 mainītis faili ar 17 papildinājumiem un 3 dzēšanām
  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)
+				}
+
 			}
 		}
 	}