Exemplo n.º 1
0
        public LayuiResult GetOrder(OrderQuery orderQuery)
        {
            var result = ProcessLayuiData(() =>
            {
                return(_orderSevice.GetAll(orderQuery));
            });

            return(result);
        }
Exemplo n.º 2
0
        public LayuiResult GetSysUser(OrderQuery orderQuery)
        {
            var result = ProcessLayuiData(() =>
            {
                //本地缓存
                var orderCspCache = _memoryCache.Get <PagedListLayUI <Entity.Models.Order> >("orderCspCache"); //获取sysUserCache
                if (orderCspCache == null)                                                                     //判断是否存在
                {
                    orderCspCache = _orderSevice.GetAll(orderQuery);                                           //调用API获取数据

                    _memoryCache.Set <PagedListLayUI <Entity.Models.Order> >("orderCspCache", orderCspCache, new MemoryCacheEntryOptions().SetSlidingExpiration(TimeSpan.FromMinutes(1)));
                    //存放orderCspCache,传入data数据和设置的数据项
                }
                return(orderCspCache);

                //return _orderSevice.GetAll(sysUserQuery);
                //return _sysUserService.GetAll(sysUserQuery);
            });

            return(result);
        }