public IActionResult GetByPage(int?page = null, int?size = null, string sort = "addTime desc", MenusCondition condition = null) { if (page.HasValue && size.HasValue && page > 0 && size > 0) { var result = _menusService.GetByPage(page.Value, size.Value, sort, condition); return(Ok(new PageModel <MenusDto> { Total = result.Total, Data = Mapper.Map <List <MenusDto> >(result.Data) })); } return(BadRequest()); }