Browse Source

出错信息优化

felix 1 year ago
parent
commit
6a867e7c15
4 changed files with 5 additions and 5 deletions
  1. 2 2
      Map/MethodMap.cs
  2. 1 1
      Map/NotificationServiceMap.cs
  3. 1 1
      Map/OtherServiceMap.cs
  4. 1 1
      Map/ServiceMap.cs

+ 2 - 2
Map/MethodMap.cs

@@ -18,9 +18,9 @@ namespace FlutterCodeGenerator.Map
 
         public MethodMap(MethodInfo method)
         {
-            ParameterModelTypes = new List<ModelType>();
-            GenerateDataCache.Instance.CurrentMethod = method.Name;
             MethodName = method.Name;
+            GenerateDataCache.Instance.CurrentMethod = MethodName;
+            ParameterModelTypes = new List<ModelType>();
             Type returnParameterType;
             if (!method.ReturnType.IsGenericType)
             {

+ 1 - 1
Map/NotificationServiceMap.cs

@@ -22,12 +22,12 @@ namespace FlutterCodeGenerator.Map
 
         public NotificationServiceMap(Type notificationEnumType, List<Type> types)
         {
+            ServiceName = "NotificationService";
             _typeList = types;
             UsedComplexModelTypeList = new List<ComplexModelType>();
             GenerateDataCache.Instance.SetCurrentServiceMap(this);
             _notificationModelTypeList = new List<ModelType>();
             _notificationEnumModelType = (EnumModelType)ModelTypeGenerator.Create(notificationEnumType, notificationEnumType.Name, true);
-            ServiceName = "NotificationService";
             foreach (var type in _typeList)
             {
                 try

+ 1 - 1
Map/OtherServiceMap.cs

@@ -19,10 +19,10 @@ namespace FlutterCodeGenerator.Map
 
         public OtherServiceMap(List<Type> types)
         {
+            ServiceName = "OtherService";
             _typeList = types;
             UsedComplexModelTypeList = new List<ComplexModelType>();
             GenerateDataCache.Instance.SetCurrentServiceMap(this);
-            ServiceName = "OtherService";
             foreach (var type in _typeList)
             {
                 try

+ 1 - 1
Map/ServiceMap.cs

@@ -20,11 +20,11 @@ namespace FlutterCodeGenerator.Map
 
         public ServiceMap(Type type)
         {
+            ServiceName = type.Name[1..];
             UsedComplexModelTypeList = new List<ComplexModelType>();
             GenerateDataCache.Instance.SetCurrentServiceMap(this);
             _methodMapList = new List<MethodMap>();
             var methodsList = type.GetMethods().Where(x => !x.IsSpecialName).ToList();
-            ServiceName = type.Name[1..];
             foreach (var method in methodsList)
             {
                 var methodMap = new MethodMap(method);