feat: Add Protobuf definitions for Network Membership service
- Introduced `networkmembership.proto` with RPC methods for retrieving user network tree, statistics, and position. - Implemented HTTP annotations for gRPC transcoding in the service methods. - Added support for Google API annotations in `annotations.proto` and `http.proto`. - Created `ConfigureServices.cs` to register FluentValidation for the Protobuf services. - Updated project file to include necessary dependencies for gRPC and Protobuf.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using FrontOffice.BFF.WebApi.Common.Services;
|
||||
using FrontOffice.BFF.Application.CommissionCQ.Queries.GetMyCommissionPayouts;
|
||||
using FrontOffice.BFF.Application.CommissionCQ.Queries.GetMyWeeklyBalances;
|
||||
using FrontOffice.BFF.Commission.Protobuf.Protos.Commission;
|
||||
|
||||
namespace FrontOffice.BFF.WebApi.Services;
|
||||
|
||||
/// <summary>
|
||||
/// سرویس کمیسیون - برای کاربران FrontOffice
|
||||
/// </summary>
|
||||
public class CommissionService : CommissionContract.CommissionContractBase
|
||||
{
|
||||
private readonly IDispatchRequestToCQRS _dispatchRequestToCQRS;
|
||||
|
||||
public CommissionService(IDispatchRequestToCQRS dispatchRequestToCQRS)
|
||||
{
|
||||
_dispatchRequestToCQRS = dispatchRequestToCQRS;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست پرداختهای کمیسیون کاربر
|
||||
/// </summary>
|
||||
public override async Task<GetMyCommissionPayoutsResponse> GetMyCommissionPayouts(GetMyCommissionPayoutsRequest request, ServerCallContext context)
|
||||
{
|
||||
return await _dispatchRequestToCQRS.Handle<GetMyCommissionPayoutsRequest, GetMyCommissionPayoutsQuery, GetMyCommissionPayoutsResponse>(request, context);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت لیست بالانسهای هفتگی کاربر
|
||||
/// </summary>
|
||||
public override async Task<GetMyWeeklyBalancesResponse> GetMyWeeklyBalances(GetMyWeeklyBalancesRequest request, ServerCallContext context)
|
||||
{
|
||||
return await _dispatchRequestToCQRS.Handle<GetMyWeeklyBalancesRequest, GetMyWeeklyBalancesQuery, GetMyWeeklyBalancesResponse>(request, context);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user