Ejemplo n.º 1
0
        public async Task <TData <List <MqttMsgEntity> > > GetMsgPageListJson([FromQuery] MqttMsgListParam param,
                                                                              [FromQuery] Pagination pagination)
        {
            var obj = await _mqttMsgBLL.GetPageList(param, pagination);

            return(obj);
        }
Ejemplo n.º 2
0
        public async Task <TData <List <MqttMsgEntity> > > GetList(MqttMsgListParam param)
        {
            var obj = new TData <List <MqttMsgEntity> >();

            obj.Data = await _mqttMsgService.GetList(param);

            obj.Tag = 1;
            return(obj);
        }
Ejemplo n.º 3
0
        public async Task <TData <List <MqttMsgEntity> > > GetPageList(MqttMsgListParam param, Pagination pagination)
        {
            var obj = new TData <List <MqttMsgEntity> >();

            obj.Data = await _mqttMsgService.GetPageList(param, pagination);

            obj.Total = pagination.TotalCount;
            obj.Tag   = 1;
            return(obj);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     带条件查询所有
        /// </summary>
        public async Task <List <MqttMsgEntity> > GetList(MqttMsgListParam param)
        {
            #region 查询条件

            var query = _mqttMsgEntityDB.AsQueryable();

            /*
             *    //
             *    if (param.ThemeId.HasValue)
             *        query = query.Where(p => p.ThemeId == param.ThemeId);
             *
             */

            #endregion

            var data = await query.ToListAsync();

            return(data);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     分页查询
        /// </summary>
        public async Task <List <MqttMsgEntity> > GetPageList(MqttMsgListParam param, Pagination pagination)
        {
            #region 查询条件

            var query = _mqttMsgEntityDB.AsQueryable();

            //
            if (!param.ThemeName.IsEmpty())
            {
                query = query.Where(p => p.ThemeName == param.ThemeName);
            }

            var data = await query.OrderByDescending(a => a.Id)
                       .ToPagedListAsync(pagination.PageIndex, pagination.PageSize);

            #endregion

            // 分页参数赋值
            pagination.TotalCount = data.TotalCount;
            return(data.Items.ToList());
        }