public override async Task <GrpcResponse> GetDepts(Empty request, ServerCallContext context) { var grpcResponse = new GrpcResponse() { IsSuccessStatusCode = true }; var depts = await _deptAppService.GetTreeListAsync(); var replyDepts = depts.IsNullOrEmpty() ? new List <DeptReply>() : _mapper.Map <List <DeptReply> >(depts); var replyList = new DeptListReply(); replyList.List.AddRange(replyDepts); grpcResponse.Content = Any.Pack(replyList); return(grpcResponse); }
public async Task <ActionResult <List <DeptTreeDto> > > GetListAsync() { return(await _deptService.GetTreeListAsync()); }