예제 #1
0
        public SwaggerServiceExtended FromAbpApplicationMoudleAssembly(string controllerClassName, string urlTemplate)
        {
            var assembly      = Assembly.LoadFrom(_assemblyPath);
            var type          = assembly.GetType(controllerClassName);
            var interfaceType = type.GetInterface("I" + type.Name);

            if (interfaceType != null)
            {
                //var map = type.GetInterfaceMap(interfacetype);
                var generator = new AbpServiceBaseToSwaggerGenerator(urlTemplate, new JsonSchemaGeneratorSettings());
                return(generator.GenerateForAbpAppService(type, interfaceType));
            }

            return(null);
        }
예제 #2
0
        public SwaggerService FromAbpApplicationMoudleAssembly(string controllerClassName, string urlTemplate, string controllernameused)
        {
            var assembly      = Assembly.LoadFrom(_assemblyPath);
            var type          = assembly.GetType(controllerClassName);
            var interfacetype = type.GetInterface("I" + type.Name);

            if (interfacetype == null)
            {
                return(null);
            }
            var map = type.GetInterfaceMap(interfacetype);

            if (map.InterfaceMethods.Length == 0)
            {
                return(null);
            }
            var generator = new AbpServiceBaseToSwaggerGenerator(urlTemplate);

            return(generator.Generate(type, map, controllernameused: controllernameused));
        }