Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create v2 #9

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion bankdemo/v1/api/business/bank_demo.proto
Expand Up @@ -28,5 +28,7 @@ message GetClientListResponse {
// Service BankDemo
service BankDemo {
// Get client list
rpc GetClientList(GetClientListRequest) returns (GetClientListResponse);
rpc GetClientList(GetClientListRequest) returns (GetClientListResponse) {
option deprecated = true;
};
}
32 changes: 32 additions & 0 deletions bankdemo/v2/api/business/bank_demo.proto
@@ -0,0 +1,32 @@
syntax = "proto3";

package com.arvgord.api.grpc.bankdemo.v2;

import "bankdemo/v2/messages/client_list_item.proto";
import "bankdemo/v2/messages/extracting_strategy.proto";
import "bankdemo/v2/messages/page_request.proto";
import "google/protobuf/wrappers.proto";

// Get client list request
message GetClientListRequest {
// Current page
PageRequest page_request = 1;
// Extracting strategy
ExtractingStrategy extracting_strategy = 2;
}

// Get client list response
message GetClientListResponse {
// Clients
repeated ClientListItem clients = 1;
// Total number of clients
google.protobuf.Int64Value total_clients = 2;
// Total number of pages
google.protobuf.Int32Value total_pages = 3;
}

// Service BankDemo
service BankDemo {
// Get client list
rpc GetClientList(GetClientListRequest) returns (GetClientListResponse);
}
17 changes: 17 additions & 0 deletions bankdemo/v2/messages/address.proto
@@ -0,0 +1,17 @@
syntax = "proto3";

package com.arvgord.api.grpc.bankdemo.v2;

import "google/protobuf/wrappers.proto";

// Address of client
message Address {
// Client city
google.protobuf.StringValue city = 1;
// Client street
google.protobuf.StringValue street = 2;
// Client house
google.protobuf.StringValue house = 3;
// Client postal code
google.protobuf.StringValue postal_code = 4;
}
35 changes: 35 additions & 0 deletions bankdemo/v2/messages/client_list_item.proto
@@ -0,0 +1,35 @@
syntax = "proto3";

package com.arvgord.api.grpc.bankdemo.v2;

import "bankdemo/v2/messages/address.proto";
import "bankdemo/v2/messages/client_name.proto";
import "google/protobuf/wrappers.proto";

// Message with client info
message ClientListItem {
// Client name
ClientName client_name = 1;
// Client address
Address client_address = 2;
// Total number of client accounts
google.protobuf.Int32Value total_accounts = 3;
// Balance on all client accounts
google.protobuf.StringValue total_accounts_balance = 4;
// Total number of client deposits
google.protobuf.Int32Value total_deposits = 5;
// Amount of all client deposits
google.protobuf.StringValue total_deposits_amount = 6;
// Average rate of all client deposits
google.protobuf.StringValue avg_deposits_rate = 7;
// Total number of client loans
google.protobuf.Int32Value total_loans = 8;
// Amount of all client loans
google.protobuf.StringValue total_loans_amount = 9;
// Average rate of all client loans
google.protobuf.StringValue avg_loans_rate = 10;
// Total number of client transfers
google.protobuf.Int32Value total_transfers = 11;
// Amount of all client transfers
google.protobuf.StringValue total_transfers_amount = 12;
}
15 changes: 15 additions & 0 deletions bankdemo/v2/messages/client_name.proto
@@ -0,0 +1,15 @@
syntax = "proto3";

package com.arvgord.api.grpc.bankdemo.v2;

import "google/protobuf/wrappers.proto";

// Client name
message ClientName {
// Client first name
google.protobuf.StringValue first_name = 1;
// Client middle name
google.protobuf.StringValue middle_name = 2;
// Client last name
google.protobuf.StringValue last_name =3;
}
23 changes: 23 additions & 0 deletions bankdemo/v2/messages/extracting_strategy.proto
@@ -0,0 +1,23 @@
syntax = "proto3";

package com.arvgord.api.grpc.bankdemo.v2;

// How to extract clients info from DB
enum ExtractingStrategy {
// Extracting strategy not specified
EXTRACTING_STRATEGY_UNSPECIFIED = 0;
// Lazy extraction
EXTRACTING_STRATEGY_LAZY = 1;
// Eager extraction
EXTRACTING_STRATEGY_EAGER = 2;
// Extract by batch
EXTRACTING_STRATEGY_BATCH = 3;
// Extract with the help of criteria api
EXTRACTING_STRATEGY_CRITERIA = 4;
// Lazy extraction with entity graph
EXTRACTING_STRATEGY_ENTITY_GRAPH = 5;
// Lazy extraction with entity graph pageable
EXTRACTING_STRATEGY_ENTITY_GRAPH_PAGEABLE = 6;
// Lazy extraction with entity graph pageable except some fields
EXTRACTING_STRATEGY_ENTITY_GRAPH_PAGEABLE_SKIP_FIELDS = 7;
}
13 changes: 13 additions & 0 deletions bankdemo/v2/messages/page_request.proto
@@ -0,0 +1,13 @@
syntax = "proto3";

package com.arvgord.api.grpc.bankdemo.v2;

import "google/protobuf/wrappers.proto";

// Page
message PageRequest {
// Number of clients on page
google.protobuf.Int32Value page = 1;
// Page size
google.protobuf.Int32Value size = 2;
}
2 changes: 1 addition & 1 deletion build.gradle.kts
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "com.arvgord"
version = "0.0.2"
version = "1.0.0"

repositories {
mavenCentral()
Expand Down