Example #1
0
        public ActionResult <ResponseData> List(int startPage = 100, int pageSize = 100)
        {
            //_responseData.Success = true;
            //_responseData.Data = _roleAppService.GetAllList();
            //return _responseData;
            int count     = 0;
            int pagecount = 0;

            _responseData.Success = true;
            List <RoleInfo> riList = _roleAppService.GetAllPageList(startPage, pageSize, out count, out pagecount, null);

            riList.ForEach(x =>
            {
                x.Down["name"] = _userInfoAppService.GetUserInfo(x.CreateUserID)?.UserName;
                // 获取关联权限信息
                _roleAppService.GetRoleInfo(x.Id);
            });
            PageInfo pageInfo = new PageInfo();

            pageInfo.data      = riList;
            pageInfo.rowCount  = count;
            pageInfo.pageCount = pagecount;
            _responseData.Data = pageInfo;
            return(_responseData);
        }
Example #2
0
        public IActionResult GetAllPageList(int startPage, int pageSize)
        {
            var result = _service.GetAllPageList(startPage, pageSize, out int rowCount);

            return(Json(new
            {
                rowCount,
                pageCount = Math.Ceiling(Convert.ToDecimal(rowCount) / pageSize),
                rows = result,
            }));
        }
Example #3
0
 public async Task <IActionResult> GetList([FromBody] QueryParam qparam)
 {
     return(Json(await _roleAppService.GetAllPageList(qparam.StartPage, qparam.PageSize)));
 }