/// <summary>
        /// 获取本地的插件服务配置
        /// ?还需要增加显示远程的服务配置
        /// </summary>
        /// <returns></returns>
        public static string GetServiceConfig()
        {
            MNodePlugin mp = RemotePluginManage.GetLocalPlugin();

            List <dwPlugin> pluginlist = new List <dwPlugin>();

            foreach (var pname in mp.LocalPlugin)
            {
                CoreFrame.Plugin.ModulePlugin item = CoreFrame.Init.AppPluginManage.PluginDic[pname];
                dwPlugin p = new dwPlugin();
                p.pluginname     = pname;
                p.controllerlist = new List <dwController>();
                List <WcfControllerAttributeInfo> cmdControllerList = (List <WcfControllerAttributeInfo>)item.cache.GetData(pname + "@" + "wcfControllerAttributeList");
                foreach (var cmd in cmdControllerList)
                {
                    dwController c = new dwController();
                    c.controllername = cmd.controllerName;
                    c.methodlist     = new List <string>();
                    foreach (var m in cmd.MethodList)
                    {
                        c.methodlist.Add(m.methodName);
                    }
                    p.controllerlist.Add(c);
                }
                pluginlist.Add(p);
            }

            return(JsonConvert.SerializeObject(pluginlist));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取所有的插件服务信息
        /// </summary>
        /// <returns></returns>
        public static string GetAllPluginInfo()
        {
            List <dwPlugin> pluginlist = new List <dwPlugin>();

            foreach (var item in CoreFrame.Init.AppPluginManage.PluginDic)
            {
                dwPlugin p = new dwPlugin();
                p.pluginname     = item.Key;
                p.controllerlist = new List <dwController>();
                List <WcfControllerAttributeInfo> cmdControllerList = (List <WcfControllerAttributeInfo>)item.Value.cache.GetData(item.Key + "@" + "wcfControllerAttributeList");
                foreach (var cmd in cmdControllerList)
                {
                    dwController c = new dwController();
                    c.controllername = cmd.controllerName;
                    c.methodlist     = new List <string>();
                    foreach (var m in cmd.MethodList)
                    {
                        c.methodlist.Add(m.methodName);
                    }
                    p.controllerlist.Add(c);
                }
                pluginlist.Add(p);
            }

            return(JsonConvert.SerializeObject(pluginlist));
        }