Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
        public override Task <GlobalResponse> UpdatedLinkVisited(GlobalRequest request, ServerCallContext context)
        {
            var result = _linkRepository.UpdatedLinkVisited(request.Id);

            return(Task.FromResult(new GlobalResponse {
                Result = result
            }));
        }
Esempio n. 5
0
        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));
        }
Esempio n. 6
0
        public override Task <GlobalResponse> DeleteAccount(GlobalRequest request, ServerCallContext context)
        {
            var result = _accountRepository.DeleteAccount(request.Id);

            return(Task.FromResult(new GlobalResponse {
                Result = result
            }));
        }
Esempio n. 7
0
        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));
        }
Esempio n. 8
0
        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));
        }
Esempio n. 9
0
        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));
        }
Esempio n. 10
0
        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));
        }