|
@@ -13,6 +13,7 @@ namespace FlutterCodeGenerator.Helper
|
|
|
public class CodeGeneratorForWing
|
|
|
{
|
|
|
private const string WingDllName = "WingInterfaceLibrary.dll";
|
|
|
+ private const string PetCareDllName = "PetCareInterface.dll";
|
|
|
private const string FlyinsonoFolder = "fis_lib_jsonrpc";
|
|
|
|
|
|
private readonly string _generatedFolderPathForFlyinsono;
|
|
@@ -46,7 +47,15 @@ namespace FlutterCodeGenerator.Helper
|
|
|
}
|
|
|
var assemblybytes = File.ReadAllBytes(dll);
|
|
|
var assembly = Assembly.Load(assemblybytes);
|
|
|
- var allTypes = assembly.GetTypes();
|
|
|
+ var allTypes = assembly.GetTypes().ToList() ;
|
|
|
+ dll = Directory.GetFiles(_dllPath, PetCareDllName).FirstOrDefault();
|
|
|
+ if (dll == null)
|
|
|
+ {
|
|
|
+ throw new DllNotFoundException($"The {PetCareDllName} is not found!");
|
|
|
+ }
|
|
|
+ assembly = Assembly.LoadFrom(dll);
|
|
|
+ var petCareTypes = assembly.GetTypes();
|
|
|
+ allTypes.AddRange(petCareTypes);
|
|
|
var restTypes = allTypes.Where(x => !x.FullName.Contains("DB") && !x.Name.EndsWith("ManagementService") && !x.Name.EndsWith("NotificationService") && !x.FullName.Contains(".Internal.") && !x.FullName.Contains("<>")).ToList();//当类的某个属性只有Get,没有set属性,该类会有<>c的Type
|
|
|
var interfaceTypes = restTypes.Where(x => x.FullName.EndsWith("Service") && x.IsInterface).ToList();
|
|
|
restTypes = restTypes.Except(interfaceTypes).ToList();
|