diff --git a/.gitignore b/.gitignore index fe8a569..cc4180b 100644 --- a/.gitignore +++ b/.gitignore @@ -492,3 +492,5 @@ fabric.properties .idea/caches/build_file_checksums.ser /src/.idea +/.gitea +src/.dockerignore diff --git a/src/FrontOffice.BFF.Application/UserWalletCQ/Commands/WithdrawBalance/WithdrawBalanceCommand.cs b/src/FrontOffice.BFF.Application/UserWalletCQ/Commands/WithdrawBalance/WithdrawBalanceCommand.cs index 0d259b0..b49ecaa 100644 --- a/src/FrontOffice.BFF.Application/UserWalletCQ/Commands/WithdrawBalance/WithdrawBalanceCommand.cs +++ b/src/FrontOffice.BFF.Application/UserWalletCQ/Commands/WithdrawBalance/WithdrawBalanceCommand.cs @@ -1,5 +1,5 @@ namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance; -public record WithdrawBalanceCommand : IRequest +public record WithdrawBalanceCommand : IRequest { } \ No newline at end of file diff --git a/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetAllUserWalletChangeLog/GetAllUserWalletChangeLogQuery.cs b/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetAllUserWalletChangeLog/GetAllUserWalletChangeLogQuery.cs index 3192762..4d22693 100644 --- a/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetAllUserWalletChangeLog/GetAllUserWalletChangeLogQuery.cs +++ b/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetAllUserWalletChangeLog/GetAllUserWalletChangeLogQuery.cs @@ -1,5 +1,5 @@ namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog; -public record GetAllUserWalletChangeLogQuery : IRequest +public record GetAllUserWalletChangeLogQuery : IRequest { } \ No newline at end of file diff --git a/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetAllUserWalletChangeLog/GetAllUserWalletChangeLogResponseDto.cs b/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetAllUserWalletChangeLog/GetAllUserWalletChangeLogResponseDto.cs new file mode 100644 index 0000000..adfa44b --- /dev/null +++ b/src/FrontOffice.BFF.Application/UserWalletCQ/Queries/GetAllUserWalletChangeLog/GetAllUserWalletChangeLogResponseDto.cs @@ -0,0 +1,23 @@ +namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog; +public class GetAllUserWalletChangeLogResponseDto +{ + //متادیتا + public MetaData MetaData { get; set; } + //مدل خروجی + public List? Models { get; set; } + +}public class GetAllUserWalletChangeLogResponseModel +{ + //موجودی + public long CurrentBalance { get; set; } + //تغییر موجودی + public long ChangeValue { get; set; } + //موجودی جاری شبکه + public long CurrentNetworkBalance { get; set; } + //تغییر موجودی شبکه + public long ChangeNerworkValue { get; set; } + //افزایشی؟ + public bool IsIncrease { get; set; } + //شناسه ارجاع + public long? RefrenceId { get; set; } +} diff --git a/src/FrontOffice.BFF.WebApi/Services/UserWalletService.cs b/src/FrontOffice.BFF.WebApi/Services/UserWalletService.cs index 3a5d15e..3152b82 100644 --- a/src/FrontOffice.BFF.WebApi/Services/UserWalletService.cs +++ b/src/FrontOffice.BFF.WebApi/Services/UserWalletService.cs @@ -1,10 +1,9 @@ +using FrontOffice.BFF.Protobuf.Protos.UserWallet; using FrontOffice.BFF.WebApi.Common.Services; using FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog; using FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWallet; using FrontOffice.BFF.Application.UserWalletCQ.Commands.TransferUserWalletBallance; using FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance; -using FrontOffice.BFF.UserWallet.Protobuf.Protos.UserWallet; - namespace FrontOffice.BFF.WebApi.Services; public class UserWalletService : UserWalletContract.UserWalletContractBase { @@ -14,9 +13,9 @@ public class UserWalletService : UserWalletContract.UserWalletContractBase { _dispatchRequestToCQRS = dispatchRequestToCQRS; } - public override async Task GetAllUserWalletChangeLog(Empty request, ServerCallContext context) + public override async Task GetAllUserWalletChangeLog(Empty request, ServerCallContext context) { - return await _dispatchRequestToCQRS.Handle(context); + return await _dispatchRequestToCQRS.Handle(context); } public override async Task GetUserWallet(Empty request, ServerCallContext context) { @@ -26,8 +25,8 @@ public class UserWalletService : UserWalletContract.UserWalletContractBase { return await _dispatchRequestToCQRS.Handle(context); } - public override async Task WithdrawBalance(Empty request, ServerCallContext context) + public override async Task WithdrawBalance(Empty request, ServerCallContext context) { - return await _dispatchRequestToCQRS.Handle(context); + return await _dispatchRequestToCQRS.Handle(context); } } diff --git a/src/Protobufs/FrontOffice.BFF.UserWallet.Protobuf/Protos/userwallet.proto b/src/Protobufs/FrontOffice.BFF.UserWallet.Protobuf/Protos/userwallet.proto index ed0bf7c..618723c 100644 --- a/src/Protobufs/FrontOffice.BFF.UserWallet.Protobuf/Protos/userwallet.proto +++ b/src/Protobufs/FrontOffice.BFF.UserWallet.Protobuf/Protos/userwallet.proto @@ -12,7 +12,7 @@ option csharp_namespace = "FrontOffice.BFF.UserWallet.Protobuf.Protos.UserWallet service UserWalletContract { - rpc GetAllUserWalletChangeLog(google.protobuf.Empty) returns (google.protobuf.Empty){ + rpc GetAllUserWalletChangeLog(google.protobuf.Empty) returns (GetAllUserWalletChangeLogResponse){ option (google.api.http) = { get: "/GetAllUserWalletChangeLog" @@ -30,18 +30,13 @@ service UserWalletContract body: "*" }; }; - rpc WithdrawBalance(google.protobuf.Empty) returns (GetAllUserWalletChangeLogResponse){ + rpc WithdrawBalance(google.protobuf.Empty) returns (google.protobuf.Empty){ option (google.api.http) = { post: "/WithdrawBalance" body: "*" }; }; } -message GetUserWalletResponse -{ - int64 balance = 1; - int64 network_balance = 2; -} message GetAllUserWalletChangeLogResponse { MetaData meta_data = 1; @@ -56,6 +51,11 @@ message GetAllUserWalletChangeLogResponseModel bool is_increase = 5; google.protobuf.Int64Value refrence_id = 6; } +message GetUserWalletResponse +{ + int64 balance = 1; + int64 network_balance = 2; +} message PaginationState {