//个人动态列表 private string PersonalDynamicList(HttpContext context) { int pageSize = 10; //默认每页返回记录数 int _pageindex; string message = string.Empty; string userid = context.Request["userid"] ?? ""; string pageindex = context.Request["pageindex"] ?? "";//页索引 // string userid = context.Request["pagesize"] ?? "";//每页显示数 if (string.IsNullOrEmpty(userid)) { return(ResultJson(ResultType.error, "用户ID不能为空", "")); } if (string.IsNullOrEmpty(pageindex)) { return(ResultJson(ResultType.error, "页索引不能为空", "")); } long _userid = 0; long.TryParse(userid, out _userid); int.TryParse(pageindex, out _pageindex); if (_pageindex <= 0) { _pageindex = 1; } FriendsService svc = new FriendsService(); var list = svc.PersonalDynamicList(_userid, _pageindex, pageSize);//我朋友的动态列表 return(ResultJson(ResultType.success, message, list)); }