|
@@ -489,7 +489,25 @@ namespace DocTools
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- rawResultStr = methodEntity.ResponseList.FirstOrDefault().DefaultValue;
|
|
|
+ var firstResponseEntity = methodEntity.ResponseList?.FirstOrDefault() ?? new ParamPropertyEntity();
|
|
|
+ if (firstResponseEntity.TypeFullName.Contains("System.Collections.Generic.List"))
|
|
|
+ {
|
|
|
+ var firstParamEntity = firstResponseEntity.ParamPropertyList.FirstOrDefault() ?? new ParamPropertyEntity();
|
|
|
+ if (firstParamEntity.TypeFullName == "System.String" || firstParamEntity.TypeFullName == "System.Int32" || firstParamEntity.TypeFullName == "System.Decimal" || firstParamEntity.TypeFullName == "System.Int16"
|
|
|
+ || firstParamEntity.TypeFullName == "System.Long" || firstParamEntity.TypeFullName == "System.Int64" || firstParamEntity.TypeFullName == "System.Float" || firstParamEntity.TypeFullName == "System.Double"
|
|
|
+ || firstParamEntity.TypeFullName == "System.Boolean")
|
|
|
+ {
|
|
|
+ rawResultStr = "["+ firstResponseEntity.Desc + "]";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ rawResultStr = firstResponseEntity.DefaultValue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ rawResultStr = firstResponseEntity.DefaultValue;
|
|
|
+ }
|
|
|
}
|
|
|
successParameter.raw = "{\n\t\"jsonrpc\": \"2.0\", //rpc版本\n\t\"id\": 1, //结果Id\n\t\"result\": " + rawResultStr + "\n}";
|
|
|
}
|