Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

丁松杰 / Pole

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • Pole
  • samples
  • apis
  • Backet.Api
  • GrpcServices
  • BacketService.cs
Find file
BlameHistoryPermalink
  • dingsongjie's avatar
    添加 grpc 测试 · 09045920
    dingsongjie committed 5 years ago
    09045920
BacketService.cs 946 Bytes
Edit
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
using Backet.Api.Grains.Abstraction;
using Backet.Grpc;
using Grpc.Core;
using Orleans;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Backet.Api.GrpcServices
{
    public class BacketService : Backet.Grpc.Backet.BacketBase
    {
        private readonly IClusterClient clusterClient;
        public BacketService(IClusterClient clusterClient)
        {
            this.clusterClient = clusterClient;
        }
        public override async Task<Pole.Grpc.ExtraType.CommonCommandResponse> AddBacket(AddBacketRequest backetDto, ServerCallContext context)
        {
            var newId = Guid.NewGuid().ToString("N").ToLower();
            //backetDto.Id = newId;
            var grain = clusterClient.GetGrain<IAddBacketGrain>(newId);
            //await  grain.AddBacket(backetDto);
            return Pole.Grpc.ExtraType.CommonCommandResponse.SuccessResponse;
        }
    }
}