public static APIPointContext Create(string assemblyName, string mainversion)
        {
            var rtn = new APIPointContext();

            rtn.MainVersion = mainversion;
            Assembly asm = Assembly.Load(new AssemblyName(assemblyName));

            Type[] ts   = asm.GetTypes();
            var    reg  = new Regex(@"(?<=.)V\d+._\d+", RegexOptions.IgnoreCase);
            var    list = ts.Where(p => p.GetTypeInfo().IsSubclassOf(typeof(PointLogic))).ToList();

            foreach (var t in list.Where(p => p.GetTypeInfo().BaseType == typeof(PointLogic)))
            {
                var ple = EntryPointEntity.CreateFrom(t, list);
                if (!rtn._d_entry_.ContainsKey(ple.APIVersion))
                {
                    rtn._d_entry_.Add(ple.APIVersion, ple);
                }
            }
            rtn.RouteDesc     = FrameDLRObject.CreateInstance(FrameDLRFlags.SensitiveCase);
            rtn.MainRouteDesc = FrameDLRObject.CreateInstance(FrameDLRFlags.SensitiveCase);
            foreach (var item in rtn._d_entry_)
            {
                rtn.RouteDesc.SetValue(item.Value.APIVersion, item.Value.RouteDesc);
            }
            rtn.MainRouteDesc = (FrameDLRObject)rtn.RouteDesc.GetValue(rtn.MainVersion);

            return(rtn);
        }
        public static EntryPointEntity CreateFrom(Type t, List <Type> pointTypeList)
        {
            if (t.GetTypeInfo().BaseType != typeof(PointLogic))
            {
                return(null);
            }

            var rtn = new EntryPointEntity();
            var tmp = (PointLogic)Activator.CreateInstance(t, true);
            //版本号
            var ns = t.Namespace;

            if (_reg_version_.IsMatch(ns))
            {
                rtn.APIVersion = _reg_version_.Match(ns).Value.ToLower().Replace("_", "");
            }
            rtn.Name = tmp.Name;
            //建立树形调用链式结构
            rtn.BuildEntryRouteInvokeLink(t, pointTypeList);
            //建立基于RouteAttribute描述的独立入口
            rtn.BuildSingleEntryInvokeLink(t, pointTypeList);
            rtn.RouteDesc = FrameDLRObject.CreateInstance(FrameDLRFlags.SensitiveCase);
            var index = 1;

            foreach (var item in rtn._d_invoke_)
            {
                var key = $"NO.{index}";
                var v   = FrameDLRObject.CreateInstance(FrameDLRFlags.SensitiveCase);
                v.Desc = item.Value.Last().RouteDesc;
                v.Verb = item.Key.Split(':')[0];
                v.Url  = item.Key.Split(':')[1];
                rtn.RouteDesc.SetValue(key, v);


                index++;
            }
            //通过{verb+route+keyname@keyname所在位置}做key映射一个索引
            var list = new List <string>();

            foreach (var item in rtn._d_invoke_)
            {
                var verb    = item.Key.Split(':')[0];
                var url     = item.Key.Split(':')[1];
                var sary    = url.Split('/').Where(p => p != "");
                var express = _reg_brace_p_.Replace(url, @"{p}").Substring(1);

                //关键字
                var keynames = express.Split('/');
                list.AddRange(keynames);

                var key = $"{verb}:{sary.Count()}:";
                for (var i = 0; i < keynames.Count(); i++)
                {
                    if (keynames[i] != "{p}")
                    {
                        key += $"{keynames[i]}@{i}|";
                    }
                }
                if (!rtn._d_route_index_.ContainsKey(key))
                {
                    rtn._d_route_index_.Add(key, item.Key);
                }
            }

            rtn._invalid_keys_ = list.Distinct().ToList();

            return(rtn);
        }