From bef0ed6475aea4b4368cd0b3c292648301ec20b6 Mon Sep 17 00:00:00 2001 From: EdwinBetanc0urt Date: Tue, 19 Sep 2023 08:55:15 -0400 Subject: [PATCH] add core functionality, dashboarding and ditionary. --- resources/envoy.yaml | 4 +++ src/main/proto/core_functionality.proto | 44 +++++++++++++++++------ src/main/proto/dashboarding.proto | 33 +++++++++++++----- src/main/proto/dictionary.proto | 46 +++++++++++++++++++------ 4 files changed, 98 insertions(+), 29 deletions(-) diff --git a/resources/envoy.yaml b/resources/envoy.yaml index 9c0780b1f..dda4eaf66 100644 --- a/resources/envoy.yaml +++ b/resources/envoy.yaml @@ -32,6 +32,10 @@ static_resources: - business_partner.BusinessPartner - data.BusinessData - data.UserInterface + - data.CoreFunctionality + - data.CoreFunctionality + - dashboarding.Dashboarding + - dictionary.Dictionary print_options: add_whitespace: true always_print_primitive_fields: true diff --git a/src/main/proto/core_functionality.proto b/src/main/proto/core_functionality.proto index 227c94a4d..0601efb11 100644 --- a/src/main/proto/core_functionality.proto +++ b/src/main/proto/core_functionality.proto @@ -19,30 +19,54 @@ option java_package = "org.spin.backend.grpc.common"; option java_outer_classname = "ADempiereCoreFunctionality"; import "base_data_type.proto"; +import "google/api/annotations.proto"; package data; service CoreFunctionality { // system information - rpc GetSystemInfo(GetSystemInfoRequest) returns (SystemInfo) {} + rpc GetSystemInfo(GetSystemInfoRequest) returns (SystemInfo) { + option (google.api.http) = { get: "/core-functionality/system-info" }; + } // Get Country Information - rpc GetCountry(GetCountryRequest) returns (Country) {} + rpc GetCountry(GetCountryRequest) returns (Country) { + option (google.api.http) = { get: "/core-functionality/country/{id}" }; + } // List Organizations - rpc ListOrganizations(ListOrganizationsRequest) returns (ListOrganizationsResponse) {} + rpc ListOrganizations(ListOrganizationsRequest) returns (ListOrganizationsResponse) { + option (google.api.http) = { get: "/core-functionality/organizations" }; + } // Warehouses - rpc ListWarehouses(ListWarehousesRequest) returns (ListWarehousesResponse) {} + rpc ListWarehouses(ListWarehousesRequest) returns (ListWarehousesResponse) { + option (google.api.http) = { get: "/core-functionality/warehouses" }; + } // Request Language List - rpc ListLanguages(ListLanguagesRequest) returns (ListLanguagesResponse) {} + rpc ListLanguages(ListLanguagesRequest) returns (ListLanguagesResponse) { + option (google.api.http) = { get: "/core-functionality/languages" }; + } // Get Business Partner from search - rpc GetBusinessPartner(GetBusinessPartnerRequest) returns (BusinessPartner) {} + rpc GetBusinessPartner(GetBusinessPartnerRequest) returns (BusinessPartner) { + option (google.api.http) = { get: "/core-functionality/business-partner/{id}" }; + } // Create Business Partner - rpc CreateBusinessPartner(CreateBusinessPartnerRequest) returns (BusinessPartner) {} + rpc CreateBusinessPartner(CreateBusinessPartnerRequest) returns (BusinessPartner) { + option (google.api.http) = { + post: "/core-functionality/business-partner", + body: "*" + }; + } // List Business Partner - rpc ListBusinessPartners(ListBusinessPartnersRequest) returns (ListBusinessPartnersResponse) {} + rpc ListBusinessPartners(ListBusinessPartnersRequest) returns (ListBusinessPartnersResponse) { + option (google.api.http) = { get: "/core-functionality/business-partners" }; + } // Get Currency Rate - rpc GetConversionRate(GetConversionRateRequest) returns (ConversionRate) {} + rpc GetConversionRate(GetConversionRateRequest) returns (ConversionRate) { + option (google.api.http) = { get: "/core-functionality/conversion-rate/{id}" }; + } // List Product Conversion UOM - rpc ListProductConversion(ListProductConversionRequest) returns (ListProductConversionResponse) {} + rpc ListProductConversion(ListProductConversionRequest) returns (ListProductConversionResponse) { + option (google.api.http) = { get: "/core-functionality/product-conversions" }; + } } message GetSystemInfoRequest { diff --git a/src/main/proto/dashboarding.proto b/src/main/proto/dashboarding.proto index b1821bf86..b55dacca5 100644 --- a/src/main/proto/dashboarding.proto +++ b/src/main/proto/dashboarding.proto @@ -20,25 +20,42 @@ option java_outer_classname = "ADempiereDashboarding"; import "base_data_type.proto"; import "dictionary.proto"; +import "google/api/annotations.proto"; package dashboarding; // All related to Dashboarding service Dashboarding { // Request Dashboards Content Edit - rpc ListDashboards(ListDashboardsRequest) returns (ListDashboardsResponse) {} + rpc ListDashboards(ListDashboardsRequest) returns (ListDashboardsResponse) { + option (google.api.http) = { get: "/dashboarding/dashboards" }; + } // Request Favorites - rpc ListFavorites(ListFavoritesRequest) returns (ListFavoritesResponse) {} + rpc ListFavorites(ListFavoritesRequest) returns (ListFavoritesResponse) { + option (google.api.http) = { get: "/dashboarding/favorites" }; + } // Request Document Statuses - rpc ListPendingDocuments(ListPendingDocumentsRequest) returns (ListPendingDocumentsResponse) {} + rpc ListPendingDocuments(ListPendingDocumentsRequest) returns (ListPendingDocumentsResponse) { + option (google.api.http) = { get: "/dashboarding/pending-documents" }; + } // Get Metrics - rpc GetMetrics(GetMetricsRequest) returns (Metrics) {} + rpc GetMetrics(GetMetricsRequest) returns (Metrics) { + option (google.api.http) = { get: "/dashboarding/metric/{id}" }; + } // NotificationWindowChart - rpc ListNotifications(ListNotificationsRequest) returns (ListNotificationsResponse) {} + rpc ListNotifications(ListNotificationsRequest) returns (ListNotificationsResponse) { + option (google.api.http) = { get: "/dashboarding/notifications" }; + } // Custom Window Metrics - rpc ExistsWindowDashboards(ExistsWindowDashboardsRequest) returns (ExistsWindowDashboardsResponse) {} - rpc ListWindowDashboards(ListWindowDashboardsRequest) returns (ListWindowDashboardsResponse) {} - rpc GetWindowMetrics(GetWindowMetricsRequest) returns (WindowMetrics) {} + rpc ExistsWindowDashboards(ExistsWindowDashboardsRequest) returns (ExistsWindowDashboardsResponse) { + option (google.api.http) = { get: "/dashboarding/exists-window-dashboards" }; + } + rpc ListWindowDashboards(ListWindowDashboardsRequest) returns (ListWindowDashboardsResponse) { + option (google.api.http) = { get: "/dashboarding/window-dashboards" }; + } + rpc GetWindowMetrics(GetWindowMetricsRequest) returns (WindowMetrics) { + option (google.api.http) = { get: "/dashboarding/window-metric/{id}" }; + } } // Dashboard diff --git a/src/main/proto/dictionary.proto b/src/main/proto/dictionary.proto index 4acd56cef..6b639f235 100644 --- a/src/main/proto/dictionary.proto +++ b/src/main/proto/dictionary.proto @@ -18,30 +18,54 @@ option java_multiple_files = true; option java_package = "org.spin.backend.grpc.dictionary"; option java_outer_classname = "ADempiereDictionary"; +import "google/api/annotations.proto"; + package dictionary; // The greeting service definition. service Dictionary { // Request a Window - rpc GetWindow(EntityRequest) returns (Window) {} + rpc GetWindow(EntityRequest) returns (Window) { + option (google.api.http) = { get: "/dictionary/window/{id}" }; + } // Request a Tab - rpc GetTab(EntityRequest) returns (Tab) {} + rpc GetTab(EntityRequest) returns (Tab) { + option (google.api.http) = { get: "/dictionary/tab/{id}" }; + } // Request a Field - rpc GetField(FieldRequest) returns (Field) {} + rpc GetField(FieldRequest) returns (Field) { + option (google.api.http) = { get: "/dictionary/field/{id}" }; + } // Reference Request - rpc GetReference(ReferenceRequest) returns (Reference) {} + rpc GetReference(ReferenceRequest) returns (Reference) { + option (google.api.http) = { get: "/dictionary/reference/{id}" }; + } // Reference Request - rpc GetValidationRule(EntityRequest) returns (ValidationRule) {} + rpc GetValidationRule(EntityRequest) returns (ValidationRule) { + option (google.api.http) = { get: "/dictionary/validation-rule/{id}" }; + } // Request Process - rpc GetProcess(EntityRequest) returns (Process) {} + rpc GetProcess(EntityRequest) returns (Process) { + option (google.api.http) = { get: "/dictionary/process/{id}" }; + } // Request Browser - rpc GetBrowser(EntityRequest) returns (Browser) {} + rpc GetBrowser(EntityRequest) returns (Browser) { + option (google.api.http) = { get: "/dictionary/browser/{id}" }; + } // Get Form - rpc GetForm(EntityRequest) returns (Form) {} + rpc GetForm(EntityRequest) returns (Form) { + option (google.api.http) = { get: "/dictionary/form/{id}" }; + } // List Search Info Fields - rpc ListSearchInfoFields(ListFieldsRequest) returns (ListFieldsResponse) {} - rpc ListIdentifiersFields(ListFieldsRequest) returns (ListFieldsResponse) {} - rpc ListTableSearchFields(ListFieldsRequest) returns (ListFieldsResponse) {} + rpc ListSearchInfoFields(ListFieldsRequest) returns (ListFieldsResponse) { + option (google.api.http) = { get: "/dictionary/search-info-fields" }; + } + rpc ListIdentifiersFields(ListFieldsRequest) returns (ListFieldsResponse) { + option (google.api.http) = { get: "/dictionary/identifier-fields" }; + } + rpc ListTableSearchFields(ListFieldsRequest) returns (ListFieldsResponse) { + option (google.api.http) = { get: "/dictionary/table-search-fields" }; + } } // Object request