denny il y a 2 ans
Parent
commit
3e37520f06
2 fichiers modifiés avec 20 ajouts et 2 suppressions
  1. 19 1
      DocTools/CreateDocHtml.cs
  2. 1 1
      DocTools/LoadData.cs

+ 19 - 1
DocTools/CreateDocHtml.cs

@@ -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}";
                         }

+ 1 - 1
DocTools/LoadData.cs

@@ -78,7 +78,7 @@ namespace DocTools
                             {
                                 entity.Para = childNode.InnerText.Trim();
                             }
-                            else if (childNode.Name == "notshow")
+                            else if (childNode.Name == "show")
                             {
                                 entity.C = (string.IsNullOrEmpty(childNode.InnerText.Trim()) || childNode.InnerText.Trim() == "true") ? true : false;
                             }