Beispiel #1
0
        public TBaseResult <PagesModels> GetPagesInfo(string safetySecretKey, bool isUsable, string openId)
        {
            this.SafetySecretKey = safetySecretKey;
            this.Usable          = isUsable ? BasePluginType.Type.启用 : BasePluginType.Type.卸载;
            var result = new TBaseResult <PagesModels>()
            {
                Code    = (int)EnumCore.CodeType.失败,
                Message = "系统错误",
                TData   = new PagesModels()
            };

            if (string.IsNullOrWhiteSpace(this.SafetySecretKey) || this.Usable == BasePluginType.Type.卸载 || PluginCore.GetInstance.VerifySafetySecretKey(this.SafetySecretKey))
            {
                return(result);
            }
            if (string.IsNullOrWhiteSpace(openId))
            {
                return(result);
            }
            var model = MenuManager.GetInstance.GetPagesModel(openId);

            if (string.IsNullOrWhiteSpace(model.OpenId))
            {
                return(result);
            }
            result.Code    = (int)EnumCore.CodeType.成功;
            result.Message = "获取成功";
            result.TData   = model;
            return(result);
        }
        public TBaseResult <IconQueryItem> GetPageDataIcons(IconQueryItem queryItem)
        {
            this.SafetySecretKey = queryItem.SafetySecretKey;
            this.Usable          = queryItem.IsUsable ? BasePluginType.Type.启用 : BasePluginType.Type.卸载;
            var result = new TBaseResult <IconQueryItem>()
            {
                Code    = (int)EnumCore.CodeType.失败,
                Message = "系统错误",
                TData   = new IconQueryItem()
            };

            if (string.IsNullOrWhiteSpace(this.SafetySecretKey) || this.Usable == BasePluginType.Type.卸载 || PluginCore.GetInstance.VerifySafetySecretKey(this.SafetySecretKey))
            {
                return(result);
            }
            var dt = MenuManager.GetInstance.GetPageDataIcons(queryItem);

            result.Code = (int)EnumCore.CodeType.成功;
            if (dt.PageData.Count <= 0)
            {
                result.Message = "暂无数据";
                result.TData   = dt;
                return(result);
            }
            result.Message = "获取成功";
            result.TData   = dt;
            return(result);
        }
        public TBaseResult <PagesModels> GetUsersMenuList(string safetySecretKey, bool isUsable, string userOpenId = "")
        {
            this.SafetySecretKey = safetySecretKey;
            this.Usable          = isUsable ? BasePluginType.Type.启用 : BasePluginType.Type.卸载;
            var result = new TBaseResult <PagesModels>()
            {
                Code    = (int)EnumCore.CodeType.失败,
                Message = "系统错误",
                TList   = new List <PagesModels>()
            };

            if (string.IsNullOrWhiteSpace(this.SafetySecretKey) || this.Usable == BasePluginType.Type.卸载 || PluginCore.GetInstance.VerifySafetySecretKey(this.SafetySecretKey))
            {
                return(result);
            }
            var list = MenuManager.GetInstance.GetUsersMenuList(userOpenId);

            result.Code  = (int)EnumCore.CodeType.成功;
            result.TList = list;
            if (list.Count <= 0)
            {
                result.Message = "暂无数据";
                return(result);
            }
            result.Message = "获取成功";
            return(result);
        }