public override Task <AccountProto> GetLogin(GlobalRequest request, ServerCallContext context) { var result = _accountRepository.GetLogin(request.Id, request.Password, request.Fields); var response = _mapper.Map <AccountProto>(result); return(Task.FromResult(response)); }
public override Task <LinkProto> GetLink(GlobalRequest request, ServerCallContext context) { var result = _linkRepository.GetLink(request.Id, request.Fields); var response = _mapper.Map <LinkProto>(result); return(Task.FromResult(response)); }
public override Task <ArticleProto> GetArticle(GlobalRequest request, ServerCallContext context) { var result = _articleRepository.GetArticle(request.Id, request.Fields); var response = _mapper.Map <ArticleProto>(result); return(Task.FromResult(response)); }
public override Task <GlobalResponse> UpdatedLinkVisited(GlobalRequest request, ServerCallContext context) { var result = _linkRepository.UpdatedLinkVisited(request.Id); return(Task.FromResult(new GlobalResponse { Result = result })); }
public override Task <LinkListResponse> ListLinkByCat(GlobalRequest request, ServerCallContext context) { var result = _linkRepository.ListLinkByCat(request.Linktype); var response = new LinkListResponse(); response.Items.AddRange(result.Select(p => _mapper.Map <LinkProto>(p))); return(Task.FromResult(response)); }
public override Task <GlobalResponse> DeleteAccount(GlobalRequest request, ServerCallContext context) { var result = _accountRepository.DeleteAccount(request.Id); return(Task.FromResult(new GlobalResponse { Result = result })); }
public override Task <LinkPagerResponse> PagerLinkList(GlobalRequest request, ServerCallContext context) { var total = 0; var result = _linkRepository.PagerLinkList(request.Size, request.Offset, request.Linktype, request.Title, request.Url, out total); var response = new LinkPagerResponse(); response.Total = total; response.Items.AddRange(result.Select(p => _mapper.Map <LinkProto>(p))); return(Task.FromResult(response)); }
public override Task <AccountPagerResponse> PagerAccountList(GlobalRequest request, ServerCallContext context) { var total = 0; var result = _accountRepository.PagerAccountList(request.Size, request.Skip, null, out total, request.Fields); var response = new AccountPagerResponse(); response.Total = total; response.Items.AddRange(result.Select(p => _mapper.Map <AccountProto>(p))); return(Task.FromResult(response)); }
public override Task <ArticleListResponse> ListArticleByPaging(GlobalRequest request, ServerCallContext context) { var result = _articleRepository.ListArticleByPaging(request.Size, request.Skip, request.Fields); var response = new ArticleListResponse(); foreach (var item in result) { response.Items.Add(_mapper.Map <ArticleProto>(item)); } return(Task.FromResult(response)); }
public override Task <TopCusLinkResponse> GetTopCusLink(GlobalRequest request, ServerCallContext context) { var result = _cusLinkRepository.GetTopCusLink(request.Size, request.Fields); var response = new TopCusLinkResponse(); foreach (var item in result) { response.Items.Add(_mapper.Map <CusLinkProto>(item)); } return(Task.FromResult(response)); }