From 04f16b78ac6ce45a6ccc2b7b9be23cf4f4c065d5 Mon Sep 17 00:00:00 2001 From: eisbilir Date: Fri, 21 Apr 2023 17:40:39 +0300 Subject: [PATCH 1/4] feat: add review protos --- domain-layer/review/answer_type.proto | 30 ++++++++++ domain-layer/review/discussion.proto | 35 ++++++++++++ domain-layer/review/review.proto | 54 ++++++++++++++++++ domain-layer/review/scorecard.proto | 56 +++++++++++++++++++ .../review/services/answer_type.proto | 23 ++++++++ domain-layer/review/services/discussion.proto | 26 +++++++++ domain-layer/review/services/review.proto | 26 +++++++++ domain-layer/review/services/scorecard.proto | 26 +++++++++ 8 files changed, 276 insertions(+) create mode 100644 domain-layer/review/answer_type.proto create mode 100644 domain-layer/review/discussion.proto create mode 100644 domain-layer/review/review.proto create mode 100644 domain-layer/review/scorecard.proto create mode 100644 domain-layer/review/services/answer_type.proto create mode 100644 domain-layer/review/services/discussion.proto create mode 100644 domain-layer/review/services/review.proto create mode 100644 domain-layer/review/services/scorecard.proto diff --git a/domain-layer/review/answer_type.proto b/domain-layer/review/answer_type.proto new file mode 100644 index 0000000..41b473f --- /dev/null +++ b/domain-layer/review/answer_type.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package topcoder.domain.review.answertype; + +import "google/protobuf/timestamp.proto"; + +option java_multiple_files = true; +option java_package = "com.topcoder.domain.review.answertype"; + +message AnswerType { + optional int64 id = 1; + string name = 2; + optional string description = 3; + repeated AnswerTypeValue answer_type_values = 4; + google.protobuf.Timestamp created_at = 5; + google.protobuf.Timestamp updated_at = 6; + int32 created_by = 7; + int32 updated_by = 8; +} + +message AnswerTypeValue { + optional int64 id = 1; + string value = 2; + double weight = 3; + int32 display_order = 4; + google.protobuf.Timestamp created_at = 5; + google.protobuf.Timestamp updated_at = 6; + int32 created_by = 7; + int32 updated_by = 8; +} \ No newline at end of file diff --git a/domain-layer/review/discussion.proto b/domain-layer/review/discussion.proto new file mode 100644 index 0000000..7b2fce7 --- /dev/null +++ b/domain-layer/review/discussion.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package topcoder.domain.review.discussion; + +import "google/protobuf/timestamp.proto"; + +option java_multiple_files = true; +option java_package = "com.topcoder.domain.review.discussion"; + +message Discussion { + optional int64 id = 1; + int64 score_id = 2; + optional int64 parent_id = 3; + int64 discussion_type_id = 4; + string text = 5; + optional string reference = 6; + google.protobuf.Timestamp created_at = 7; + google.protobuf.Timestamp updated_at = 8; + int32 created_by = 9; + int32 updated_by = 10; +} + +message DiscussionList { + repeated Discussion discussions = 1; +} + +message DiscussionType { + optional int64 id = 1; + string name = 2; + optional string description = 3; + google.protobuf.Timestamp created_at = 4; + google.protobuf.Timestamp updated_at = 5; + int32 created_by = 6; + int32 updated_by = 7; +} \ No newline at end of file diff --git a/domain-layer/review/review.proto b/domain-layer/review/review.proto new file mode 100644 index 0000000..31c44ec --- /dev/null +++ b/domain-layer/review/review.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; + +package topcoder.domain.review.review; + +import "google/protobuf/timestamp.proto"; + +option java_multiple_files = true; +option java_package = "com.topcoder.domain.review.review"; + +message Review { + enum ReviewStatus { + DRAFT = 0; + SUBMITTED = 1; + PUBLISHED = 2; + } + + optional int64 id = 1; + int64 reviewer_id = 2; + int64 scorecard_id = 3; + int64 work_id = 4; + int64 work_group_id = 5; + double total_score = 6; + ReviewStatus status = 7; + optional string custom_data = 8; + repeated Score scores = 9; + google.protobuf.Timestamp created_at = 10; + google.protobuf.Timestamp updated_at = 11; + int32 created_by = 12; + int32 updated_by = 13; +} + +message ReviewList { + repeated Review reviews = 1; +} + +message Score { + optional int64 id = 1; + int64 criterion_id = 2; + int64 answer_type_value_id = 3; + google.protobuf.Timestamp created_at = 4; + google.protobuf.Timestamp updated_at = 5; + int32 created_by = 6; + int32 updated_by = 7; +} + +message WorkGroup { + optional int64 id = 1; + string name = 2; + optional string description = 3; + google.protobuf.Timestamp created_at = 4; + google.protobuf.Timestamp updated_at = 5; + int32 created_by = 6; + int32 updated_by = 7; +} \ No newline at end of file diff --git a/domain-layer/review/scorecard.proto b/domain-layer/review/scorecard.proto new file mode 100644 index 0000000..91b1767 --- /dev/null +++ b/domain-layer/review/scorecard.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; + +package topcoder.domain.review.scorecard; + +import "google/protobuf/timestamp.proto"; + +option java_multiple_files = true; +option java_package = "com.topcoder.domain.review.scorecard"; + +message Scorecard { + enum Status { + ENABLED = 0; + DISABLED = 1; + } + + optional int64 id = 1; + string name = 2; + optional string description = 3; + int32 version = 4; + Status status = 5; + optional int64 parent_scorecard_id = 6; + repeated CriteriaGroup criteria_groups = 7; + google.protobuf.Timestamp created_at = 8; + google.protobuf.Timestamp updated_at = 9; + int32 created_by = 10; + int32 updated_by = 11; +} + +message ScorecardList { + repeated Scorecard scorecards = 1; +} + +message CriteriaGroup { + optional int64 id = 1; + string name = 2; + double weight = 3; + int32 display_order = 4; + repeated Criterion criterias = 5; + google.protobuf.Timestamp created_at = 6; + google.protobuf.Timestamp updated_at = 7; + int32 created_by = 8; + int32 updated_by = 9; +} + +message Criterion { + optional int64 id = 1; + string name = 2; + optional string description = 3; + int64 answer_type_id = 4; + int32 display_order = 5; + optional string example = 6; + google.protobuf.Timestamp created_at = 7; + google.protobuf.Timestamp updated_at = 8; + int32 created_by = 9; + int32 updated_by = 10; +} \ No newline at end of file diff --git a/domain-layer/review/services/answer_type.proto b/domain-layer/review/services/answer_type.proto new file mode 100644 index 0000000..a65ce38 --- /dev/null +++ b/domain-layer/review/services/answer_type.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; + +package topcoder.domain.service.review.answertype; + +import "common/common.proto"; +import "domain-layer/review/answer_type.proto"; + +option java_multiple_files = true; +option java_package = "com.topcoder.domain.service.review.answertype"; + +service AnswerType { + rpc Get(topcoder.common.LookupCriteria) + returns (topcoder.domain.review.answertype.AnswerType); + + rpc Create(topcoder.domain.review.answertype.AnswerType) + returns (topcoder.domain.review.answertype.AnswerType); + + rpc Update(topcoder.domain.review.answertype.AnswerType) + returns (topcoder.domain.review.answertype.AnswerType); + + rpc Delete(topcoder.common.LookupCriteria) + returns (topcoder.domain.review.answertype.AnswerType); +} \ No newline at end of file diff --git a/domain-layer/review/services/discussion.proto b/domain-layer/review/services/discussion.proto new file mode 100644 index 0000000..ee1338c --- /dev/null +++ b/domain-layer/review/services/discussion.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package topcoder.domain.service.review.discussion; + +import "common/common.proto"; +import "domain-layer/review/discussion.proto"; + +option java_multiple_files = true; +option java_package = "com.topcoder.domain.service.review.discussion"; + +service Discussion { + rpc Get(topcoder.common.LookupCriteria) + returns (topcoder.domain.review.discussion.Discussion); + + rpc Search(topcoder.common.ScanRequest) + returns (topcoder.domain.review.discussion.DiscussionList); + + rpc Create(topcoder.domain.review.discussion.Discussion) + returns (topcoder.domain.review.discussion.Discussion); + + rpc Update(topcoder.domain.review.discussion.Discussion) + returns (topcoder.domain.review.discussion.Discussion); + + rpc Delete(topcoder.common.LookupCriteria) + returns (topcoder.domain.review.discussion.Discussion); +} \ No newline at end of file diff --git a/domain-layer/review/services/review.proto b/domain-layer/review/services/review.proto new file mode 100644 index 0000000..0a54357 --- /dev/null +++ b/domain-layer/review/services/review.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package topcoder.domain.service.review.review; + +import "common/common.proto"; +import "domain-layer/review/review.proto"; + +option java_multiple_files = true; +option java_package = "com.topcoder.domain.service.review.review"; + +service Discussion { + rpc Get(topcoder.common.LookupCriteria) + returns (topcoder.domain.review.review.Review); + + rpc Search(topcoder.common.ScanRequest) + returns (topcoder.domain.review.review.ReviewList); + + rpc Create(topcoder.domain.review.review.Review) + returns (topcoder.domain.review.review.Review); + + rpc Update(topcoder.domain.review.review.Review) + returns (topcoder.domain.review.review.Review); + + rpc Delete(topcoder.common.LookupCriteria) + returns (topcoder.domain.review.review.Review); +} \ No newline at end of file diff --git a/domain-layer/review/services/scorecard.proto b/domain-layer/review/services/scorecard.proto new file mode 100644 index 0000000..dd02808 --- /dev/null +++ b/domain-layer/review/services/scorecard.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package topcoder.domain.service.review.scorecard; + +import "common/common.proto"; +import "domain-layer/review/scorecard.proto"; + +option java_multiple_files = true; +option java_package = "com.topcoder.domain.service.review.scorecard"; + +service Scorecard { + rpc Get(topcoder.common.LookupCriteria) + returns (topcoder.domain.review.scorecard.Scorecard); + + rpc Search(topcoder.common.ScanRequest) + returns (topcoder.domain.review.scorecard.ScorecardList); + + rpc Create(topcoder.domain.review.scorecard.Scorecard) + returns (topcoder.domain.review.scorecard.Scorecard); + + rpc Update(topcoder.domain.review.scorecard.Scorecard) + returns (topcoder.domain.review.scorecard.Scorecard); + + rpc Delete(topcoder.common.LookupCriteria) + returns (topcoder.domain.review.scorecard.Scorecard); +} \ No newline at end of file From a44b22b54d6e993b0052cc4c6d5482b218b07df6 Mon Sep 17 00:00:00 2001 From: Emre Date: Mon, 24 Apr 2023 10:29:13 +0300 Subject: [PATCH 2/4] feat: include discussions in scores --- domain-layer/review/answer_type.proto | 4 ++++ domain-layer/review/review.proto | 10 ++++++---- domain-layer/review/services/answer_type.proto | 5 ++++- domain-layer/review/services/discussion.proto | 4 ++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/domain-layer/review/answer_type.proto b/domain-layer/review/answer_type.proto index 41b473f..697725c 100644 --- a/domain-layer/review/answer_type.proto +++ b/domain-layer/review/answer_type.proto @@ -18,6 +18,10 @@ message AnswerType { int32 updated_by = 8; } +message AnswerTypeList { + repeated AnswerType answer_types = 1; +} + message AnswerTypeValue { optional int64 id = 1; string value = 2; diff --git a/domain-layer/review/review.proto b/domain-layer/review/review.proto index 31c44ec..8965556 100644 --- a/domain-layer/review/review.proto +++ b/domain-layer/review/review.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package topcoder.domain.review.review; +import "domain-layer/review/discussion.proto"; import "google/protobuf/timestamp.proto"; option java_multiple_files = true; @@ -37,10 +38,11 @@ message Score { optional int64 id = 1; int64 criterion_id = 2; int64 answer_type_value_id = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - int32 created_by = 6; - int32 updated_by = 7; + repeated topcoder.domain.review.discussion.Discussion discussions = 4; + google.protobuf.Timestamp created_at = 5; + google.protobuf.Timestamp updated_at = 6; + int32 created_by = 7; + int32 updated_by = 8; } message WorkGroup { diff --git a/domain-layer/review/services/answer_type.proto b/domain-layer/review/services/answer_type.proto index a65ce38..5045c53 100644 --- a/domain-layer/review/services/answer_type.proto +++ b/domain-layer/review/services/answer_type.proto @@ -9,9 +9,12 @@ option java_multiple_files = true; option java_package = "com.topcoder.domain.service.review.answertype"; service AnswerType { - rpc Get(topcoder.common.LookupCriteria) + rpc Lookup(topcoder.common.LookupCriteria) returns (topcoder.domain.review.answertype.AnswerType); + rpc Scan(topcoder.common.ScanRequest) + returns (topcoder.domain.review.answertype.AnswerTypeList); + rpc Create(topcoder.domain.review.answertype.AnswerType) returns (topcoder.domain.review.answertype.AnswerType); diff --git a/domain-layer/review/services/discussion.proto b/domain-layer/review/services/discussion.proto index ee1338c..080ba90 100644 --- a/domain-layer/review/services/discussion.proto +++ b/domain-layer/review/services/discussion.proto @@ -9,10 +9,10 @@ option java_multiple_files = true; option java_package = "com.topcoder.domain.service.review.discussion"; service Discussion { - rpc Get(topcoder.common.LookupCriteria) + rpc Lookup(topcoder.common.LookupCriteria) returns (topcoder.domain.review.discussion.Discussion); - rpc Search(topcoder.common.ScanRequest) + rpc Scan(topcoder.common.ScanRequest) returns (topcoder.domain.review.discussion.DiscussionList); rpc Create(topcoder.domain.review.discussion.Discussion) From dedd2fe2827bf7f0490d8cd9f250c85e63515532 Mon Sep 17 00:00:00 2001 From: Emre Date: Mon, 24 Apr 2023 15:28:06 +0300 Subject: [PATCH 3/4] feat: add search/get message --- common/common.proto | 25 +++++++ domain-layer/review/answer_type.proto | 36 ++++----- domain-layer/review/discussion.proto | 38 +++++----- domain-layer/review/review.proto | 72 +++++++++--------- domain-layer/review/scorecard.proto | 74 +++++++++---------- .../review/services/answer_type.proto | 24 +++--- domain-layer/review/services/discussion.proto | 24 +++--- domain-layer/review/services/review.proto | 24 +++--- domain-layer/review/services/scorecard.proto | 24 +++--- 9 files changed, 183 insertions(+), 158 deletions(-) diff --git a/common/common.proto b/common/common.proto index f69ad38..876589c 100644 --- a/common/common.proto +++ b/common/common.proto @@ -36,6 +36,11 @@ enum Domain { DOMAIN_SUBMISSION = 10; } +enum SortOrder { + ASC = 0; + DESC = 1; +} + message ScanCriteria { string key = 1; optional Operator operator = 2; @@ -73,6 +78,26 @@ message LookupCriteria { google.protobuf.Value value = 3; } +message GetRequest { + oneof id { + int64 integer_id = 1; + string string_id = 2; + } +} + +message SearchRequest { + repeated SearchCriteria criteria = 1; + optional int32 page = 2; + optional int32 per_page = 3; + SortOrder sort_order = 4; + optional string sort_by = 5; +} + +message SearchCriteria { + string key = 1; + google.protobuf.Value value = 2; +} + // TODO: There has to be a better way to do this. message GoogleProtobufTypesPlaceholder { google.protobuf.Timestamp timestamp = 1; diff --git a/domain-layer/review/answer_type.proto b/domain-layer/review/answer_type.proto index 697725c..18ca3d2 100644 --- a/domain-layer/review/answer_type.proto +++ b/domain-layer/review/answer_type.proto @@ -8,27 +8,23 @@ option java_multiple_files = true; option java_package = "com.topcoder.domain.review.answertype"; message AnswerType { - optional int64 id = 1; - string name = 2; - optional string description = 3; - repeated AnswerTypeValue answer_type_values = 4; - google.protobuf.Timestamp created_at = 5; - google.protobuf.Timestamp updated_at = 6; - int32 created_by = 7; - int32 updated_by = 8; -} - -message AnswerTypeList { - repeated AnswerType answer_types = 1; + optional int64 id = 1; + string name = 2; + optional string description = 3; + repeated AnswerTypeValue answer_type_values = 4; + google.protobuf.Timestamp created_at = 5; + google.protobuf.Timestamp updated_at = 6; + int32 created_by = 7; + int32 updated_by = 8; } message AnswerTypeValue { - optional int64 id = 1; - string value = 2; - double weight = 3; - int32 display_order = 4; - google.protobuf.Timestamp created_at = 5; - google.protobuf.Timestamp updated_at = 6; - int32 created_by = 7; - int32 updated_by = 8; + optional int64 id = 1; + string value = 2; + double weight = 3; + int32 display_order = 4; + google.protobuf.Timestamp created_at = 5; + google.protobuf.Timestamp updated_at = 6; + int32 created_by = 7; + int32 updated_by = 8; } \ No newline at end of file diff --git a/domain-layer/review/discussion.proto b/domain-layer/review/discussion.proto index 7b2fce7..2f53b02 100644 --- a/domain-layer/review/discussion.proto +++ b/domain-layer/review/discussion.proto @@ -8,28 +8,24 @@ option java_multiple_files = true; option java_package = "com.topcoder.domain.review.discussion"; message Discussion { - optional int64 id = 1; - int64 score_id = 2; - optional int64 parent_id = 3; - int64 discussion_type_id = 4; - string text = 5; - optional string reference = 6; - google.protobuf.Timestamp created_at = 7; - google.protobuf.Timestamp updated_at = 8; - int32 created_by = 9; - int32 updated_by = 10; -} - -message DiscussionList { - repeated Discussion discussions = 1; + optional int64 id = 1; + int64 score_id = 2; + optional int64 parent_id = 3; + int64 discussion_type_id = 4; + string text = 5; + optional string reference = 6; + google.protobuf.Timestamp created_at = 7; + google.protobuf.Timestamp updated_at = 8; + int32 created_by = 9; + int32 updated_by = 10; } message DiscussionType { - optional int64 id = 1; - string name = 2; - optional string description = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - int32 created_by = 6; - int32 updated_by = 7; + optional int64 id = 1; + string name = 2; + optional string description = 3; + google.protobuf.Timestamp created_at = 4; + google.protobuf.Timestamp updated_at = 5; + int32 created_by = 6; + int32 updated_by = 7; } \ No newline at end of file diff --git a/domain-layer/review/review.proto b/domain-layer/review/review.proto index 8965556..8a5798e 100644 --- a/domain-layer/review/review.proto +++ b/domain-layer/review/review.proto @@ -9,48 +9,44 @@ option java_multiple_files = true; option java_package = "com.topcoder.domain.review.review"; message Review { - enum ReviewStatus { - DRAFT = 0; - SUBMITTED = 1; - PUBLISHED = 2; - } - - optional int64 id = 1; - int64 reviewer_id = 2; - int64 scorecard_id = 3; - int64 work_id = 4; - int64 work_group_id = 5; - double total_score = 6; - ReviewStatus status = 7; - optional string custom_data = 8; - repeated Score scores = 9; - google.protobuf.Timestamp created_at = 10; - google.protobuf.Timestamp updated_at = 11; - int32 created_by = 12; - int32 updated_by = 13; -} - -message ReviewList { - repeated Review reviews = 1; + enum ReviewStatus { + DRAFT = 0; + SUBMITTED = 1; + PUBLISHED = 2; + } + + optional int64 id = 1; + int64 reviewer_id = 2; + int64 scorecard_id = 3; + int64 work_id = 4; + int64 work_group_id = 5; + double total_score = 6; + ReviewStatus status = 7; + optional string custom_data = 8; + repeated Score scores = 9; + google.protobuf.Timestamp created_at = 10; + google.protobuf.Timestamp updated_at = 11; + int32 created_by = 12; + int32 updated_by = 13; } message Score { - optional int64 id = 1; - int64 criterion_id = 2; - int64 answer_type_value_id = 3; - repeated topcoder.domain.review.discussion.Discussion discussions = 4; - google.protobuf.Timestamp created_at = 5; - google.protobuf.Timestamp updated_at = 6; - int32 created_by = 7; - int32 updated_by = 8; + optional int64 id = 1; + int64 criterion_id = 2; + int64 answer_type_value_id = 3; + repeated topcoder.domain.review.discussion.Discussion discussions = 4; + google.protobuf.Timestamp created_at = 5; + google.protobuf.Timestamp updated_at = 6; + int32 created_by = 7; + int32 updated_by = 8; } message WorkGroup { - optional int64 id = 1; - string name = 2; - optional string description = 3; - google.protobuf.Timestamp created_at = 4; - google.protobuf.Timestamp updated_at = 5; - int32 created_by = 6; - int32 updated_by = 7; + optional int64 id = 1; + string name = 2; + optional string description = 3; + google.protobuf.Timestamp created_at = 4; + google.protobuf.Timestamp updated_at = 5; + int32 created_by = 6; + int32 updated_by = 7; } \ No newline at end of file diff --git a/domain-layer/review/scorecard.proto b/domain-layer/review/scorecard.proto index 91b1767..eb4b426 100644 --- a/domain-layer/review/scorecard.proto +++ b/domain-layer/review/scorecard.proto @@ -8,49 +8,45 @@ option java_multiple_files = true; option java_package = "com.topcoder.domain.review.scorecard"; message Scorecard { - enum Status { - ENABLED = 0; - DISABLED = 1; - } - - optional int64 id = 1; - string name = 2; - optional string description = 3; - int32 version = 4; - Status status = 5; - optional int64 parent_scorecard_id = 6; - repeated CriteriaGroup criteria_groups = 7; - google.protobuf.Timestamp created_at = 8; - google.protobuf.Timestamp updated_at = 9; - int32 created_by = 10; - int32 updated_by = 11; -} - -message ScorecardList { - repeated Scorecard scorecards = 1; + enum Status { + ENABLED = 0; + DISABLED = 1; + } + + optional int64 id = 1; + string name = 2; + optional string description = 3; + int32 version = 4; + Status status = 5; + optional int64 parent_scorecard_id = 6; + repeated CriteriaGroup criteria_groups = 7; + google.protobuf.Timestamp created_at = 8; + google.protobuf.Timestamp updated_at = 9; + int32 created_by = 10; + int32 updated_by = 11; } message CriteriaGroup { - optional int64 id = 1; - string name = 2; - double weight = 3; - int32 display_order = 4; - repeated Criterion criterias = 5; - google.protobuf.Timestamp created_at = 6; - google.protobuf.Timestamp updated_at = 7; - int32 created_by = 8; - int32 updated_by = 9; + optional int64 id = 1; + string name = 2; + double weight = 3; + int32 display_order = 4; + repeated Criterion criterias = 5; + google.protobuf.Timestamp created_at = 6; + google.protobuf.Timestamp updated_at = 7; + int32 created_by = 8; + int32 updated_by = 9; } message Criterion { - optional int64 id = 1; - string name = 2; - optional string description = 3; - int64 answer_type_id = 4; - int32 display_order = 5; - optional string example = 6; - google.protobuf.Timestamp created_at = 7; - google.protobuf.Timestamp updated_at = 8; - int32 created_by = 9; - int32 updated_by = 10; + optional int64 id = 1; + string name = 2; + optional string description = 3; + int64 answer_type_id = 4; + int32 display_order = 5; + optional string example = 6; + google.protobuf.Timestamp created_at = 7; + google.protobuf.Timestamp updated_at = 8; + int32 created_by = 9; + int32 updated_by = 10; } \ No newline at end of file diff --git a/domain-layer/review/services/answer_type.proto b/domain-layer/review/services/answer_type.proto index 5045c53..5f81035 100644 --- a/domain-layer/review/services/answer_type.proto +++ b/domain-layer/review/services/answer_type.proto @@ -8,19 +8,23 @@ import "domain-layer/review/answer_type.proto"; option java_multiple_files = true; option java_package = "com.topcoder.domain.service.review.answertype"; +message AnswerTypeList { + repeated topcoder.domain.review.answertype.AnswerType answer_types = 1; +} + service AnswerType { - rpc Lookup(topcoder.common.LookupCriteria) - returns (topcoder.domain.review.answertype.AnswerType); + rpc Get(topcoder.common.GetRequest) + returns (topcoder.domain.review.answertype.AnswerType); - rpc Scan(topcoder.common.ScanRequest) - returns (topcoder.domain.review.answertype.AnswerTypeList); + rpc Search(topcoder.common.SearchRequest) + returns (AnswerTypeList); - rpc Create(topcoder.domain.review.answertype.AnswerType) - returns (topcoder.domain.review.answertype.AnswerType); + rpc Create(topcoder.domain.review.answertype.AnswerType) + returns (topcoder.domain.review.answertype.AnswerType); - rpc Update(topcoder.domain.review.answertype.AnswerType) - returns (topcoder.domain.review.answertype.AnswerType); + rpc Update(topcoder.domain.review.answertype.AnswerType) + returns (topcoder.domain.review.answertype.AnswerType); - rpc Delete(topcoder.common.LookupCriteria) - returns (topcoder.domain.review.answertype.AnswerType); + rpc Delete(topcoder.common.GetRequest) + returns (topcoder.domain.review.answertype.AnswerType); } \ No newline at end of file diff --git a/domain-layer/review/services/discussion.proto b/domain-layer/review/services/discussion.proto index 080ba90..b01de16 100644 --- a/domain-layer/review/services/discussion.proto +++ b/domain-layer/review/services/discussion.proto @@ -8,19 +8,23 @@ import "domain-layer/review/discussion.proto"; option java_multiple_files = true; option java_package = "com.topcoder.domain.service.review.discussion"; +message DiscussionList { + repeated topcoder.domain.review.discussion.Discussion discussions = 1; +} + service Discussion { - rpc Lookup(topcoder.common.LookupCriteria) - returns (topcoder.domain.review.discussion.Discussion); + rpc Get(topcoder.common.GetRequest) + returns (topcoder.domain.review.discussion.Discussion); - rpc Scan(topcoder.common.ScanRequest) - returns (topcoder.domain.review.discussion.DiscussionList); + rpc Search(topcoder.common.SearchRequest) + returns (DiscussionList); - rpc Create(topcoder.domain.review.discussion.Discussion) - returns (topcoder.domain.review.discussion.Discussion); + rpc Create(topcoder.domain.review.discussion.Discussion) + returns (topcoder.domain.review.discussion.Discussion); - rpc Update(topcoder.domain.review.discussion.Discussion) - returns (topcoder.domain.review.discussion.Discussion); + rpc Update(topcoder.domain.review.discussion.Discussion) + returns (topcoder.domain.review.discussion.Discussion); - rpc Delete(topcoder.common.LookupCriteria) - returns (topcoder.domain.review.discussion.Discussion); + rpc Delete(topcoder.common.GetRequest) + returns (topcoder.domain.review.discussion.Discussion); } \ No newline at end of file diff --git a/domain-layer/review/services/review.proto b/domain-layer/review/services/review.proto index 0a54357..1b141e1 100644 --- a/domain-layer/review/services/review.proto +++ b/domain-layer/review/services/review.proto @@ -8,19 +8,23 @@ import "domain-layer/review/review.proto"; option java_multiple_files = true; option java_package = "com.topcoder.domain.service.review.review"; +message ReviewList { + repeated topcoder.domain.review.review.Review reviews = 1; +} + service Discussion { - rpc Get(topcoder.common.LookupCriteria) - returns (topcoder.domain.review.review.Review); + rpc Get(topcoder.common.GetRequest) + returns (topcoder.domain.review.review.Review); - rpc Search(topcoder.common.ScanRequest) - returns (topcoder.domain.review.review.ReviewList); + rpc Search(topcoder.common.SearchRequest) + returns (ReviewList); - rpc Create(topcoder.domain.review.review.Review) - returns (topcoder.domain.review.review.Review); + rpc Create(topcoder.domain.review.review.Review) + returns (topcoder.domain.review.review.Review); - rpc Update(topcoder.domain.review.review.Review) - returns (topcoder.domain.review.review.Review); + rpc Update(topcoder.domain.review.review.Review) + returns (topcoder.domain.review.review.Review); - rpc Delete(topcoder.common.LookupCriteria) - returns (topcoder.domain.review.review.Review); + rpc Delete(topcoder.common.GetRequest) + returns (topcoder.domain.review.review.Review); } \ No newline at end of file diff --git a/domain-layer/review/services/scorecard.proto b/domain-layer/review/services/scorecard.proto index dd02808..136803e 100644 --- a/domain-layer/review/services/scorecard.proto +++ b/domain-layer/review/services/scorecard.proto @@ -8,19 +8,23 @@ import "domain-layer/review/scorecard.proto"; option java_multiple_files = true; option java_package = "com.topcoder.domain.service.review.scorecard"; +message ScorecardList { + repeated topcoder.domain.review.scorecard.Scorecard scorecards = 1; +} + service Scorecard { - rpc Get(topcoder.common.LookupCriteria) - returns (topcoder.domain.review.scorecard.Scorecard); + rpc Get(topcoder.common.GetRequest) + returns (topcoder.domain.review.scorecard.Scorecard); - rpc Search(topcoder.common.ScanRequest) - returns (topcoder.domain.review.scorecard.ScorecardList); + rpc Search(topcoder.common.SearchRequest) + returns (ScorecardList); - rpc Create(topcoder.domain.review.scorecard.Scorecard) - returns (topcoder.domain.review.scorecard.Scorecard); + rpc Create(topcoder.domain.review.scorecard.Scorecard) + returns (topcoder.domain.review.scorecard.Scorecard); - rpc Update(topcoder.domain.review.scorecard.Scorecard) - returns (topcoder.domain.review.scorecard.Scorecard); + rpc Update(topcoder.domain.review.scorecard.Scorecard) + returns (topcoder.domain.review.scorecard.Scorecard); - rpc Delete(topcoder.common.LookupCriteria) - returns (topcoder.domain.review.scorecard.Scorecard); + rpc Delete(topcoder.common.GetRequest) + returns (topcoder.domain.review.scorecard.Scorecard); } \ No newline at end of file From b3452ff28a0b0ea7bb7540493f56bc486423ef63 Mon Sep 17 00:00:00 2001 From: Emre Date: Mon, 24 Apr 2023 17:28:48 +0300 Subject: [PATCH 4/4] feat: add attributes field for select queries --- common/common.proto | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/common.proto b/common/common.proto index 876589c..503ccd5 100644 --- a/common/common.proto +++ b/common/common.proto @@ -83,14 +83,16 @@ message GetRequest { int64 integer_id = 1; string string_id = 2; } + repeated string attributes = 3; } message SearchRequest { repeated SearchCriteria criteria = 1; - optional int32 page = 2; - optional int32 per_page = 3; - SortOrder sort_order = 4; - optional string sort_by = 5; + repeated string attributes = 2; + optional int32 page = 3; + optional int32 per_page = 4; + SortOrder sort_order = 5; + optional string sort_by = 6; } message SearchCriteria {