chore(api): spec improvements

This commit is contained in:
ITQ
2025-12-17 12:15:27 +03:00
parent 7545e7c0d7
commit e78bd03396
6 changed files with 45 additions and 43 deletions
+4 -3
View File
@@ -35,9 +35,10 @@ message GetCompetitionResultsRequest {
string competition_id = 3;
}
message GetCompetitionResultsResponse {
repeated UserResult results = 1;
int32 total_count = 2;
int32 next_page_token = 3;
int32 total_count = 1;
int32 next_page_token = 2;
repeated UserResult results = 3;
}
message GetUserCompetitionResultsRequest {
+4 -3
View File
@@ -59,9 +59,10 @@ message ValidateReviewTokenResponse {
}
message ListSubmissionsForReviewRequest {
string token = 1;
int32 page_size = 2;
int32 page_token = 3;
int32 page_size = 1;
int32 page_token = 2;
string token = 3;
optional ReviewStatus status = 4;
}
message ListSubmissionsForReviewResponse {
+3 -3
View File
@@ -64,8 +64,8 @@ message ListSubmissionsRequest {
SubmissionStatus status = 6;
}
message ListSubmissionsResponse {
int32 total_count = 2;
int32 next_page_token = 3;
int32 total_count = 1;
int32 next_page_token = 2;
repeated Submission submissions = 1;
repeated Submission submissions = 3;
}
+14 -14
View File
@@ -236,9 +236,9 @@ func (x *GetCompetitionResultsRequest) GetCompetitionId() string {
type GetCompetitionResultsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Results []*UserResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
TotalCount int32 `protobuf:"varint,2,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"`
NextPageToken int32 `protobuf:"varint,3,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
TotalCount int32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"`
NextPageToken int32 `protobuf:"varint,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
Results []*UserResult `protobuf:"bytes,3,rep,name=results,proto3" json:"results,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -273,13 +273,6 @@ func (*GetCompetitionResultsResponse) Descriptor() ([]byte, []int) {
return file_api_proto_results_proto_rawDescGZIP(), []int{3}
}
func (x *GetCompetitionResultsResponse) GetResults() []*UserResult {
if x != nil {
return x.Results
}
return nil
}
func (x *GetCompetitionResultsResponse) GetTotalCount() int32 {
if x != nil {
return x.TotalCount
@@ -294,6 +287,13 @@ func (x *GetCompetitionResultsResponse) GetNextPageToken() int32 {
return 0
}
func (x *GetCompetitionResultsResponse) GetResults() []*UserResult {
if x != nil {
return x.Results
}
return nil
}
type GetUserCompetitionResultsRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
CompetitionId string `protobuf:"bytes,1,opt,name=competition_id,json=competitionId,proto3" json:"competition_id,omitempty"`
@@ -462,11 +462,11 @@ const file_api_proto_results_proto_rawDesc = "" +
"\n" +
"page_token\x18\x02 \x01(\x05R\tpageToken\x12%\n" +
"\x0ecompetition_id\x18\x03 \x01(\tR\rcompetitionId\"\x97\x01\n" +
"\x1dGetCompetitionResultsResponse\x12-\n" +
"\aresults\x18\x01 \x03(\v2\x13.results.UserResultR\aresults\x12\x1f\n" +
"\vtotal_count\x18\x02 \x01(\x05R\n" +
"\x1dGetCompetitionResultsResponse\x12\x1f\n" +
"\vtotal_count\x18\x01 \x01(\x05R\n" +
"totalCount\x12&\n" +
"\x0fnext_page_token\x18\x03 \x01(\x05R\rnextPageToken\"b\n" +
"\x0fnext_page_token\x18\x02 \x01(\x05R\rnextPageToken\x12-\n" +
"\aresults\x18\x03 \x03(\v2\x13.results.UserResultR\aresults\"b\n" +
" GetUserCompetitionResultsRequest\x12%\n" +
"\x0ecompetition_id\x18\x01 \x01(\tR\rcompetitionId\x12\x17\n" +
"\auser_id\x18\x02 \x01(\tR\x06userId\"P\n" +
+14 -14
View File
@@ -428,9 +428,9 @@ func (x *ValidateReviewTokenResponse) GetCompetitionId() string {
type ListSubmissionsForReviewRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
PageToken int32 `protobuf:"varint,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
PageToken int32 `protobuf:"varint,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"`
Status *ReviewStatus `protobuf:"varint,4,opt,name=status,proto3,enum=review.ReviewStatus,oneof" json:"status,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
@@ -466,13 +466,6 @@ func (*ListSubmissionsForReviewRequest) Descriptor() ([]byte, []int) {
return file_api_proto_review_proto_rawDescGZIP(), []int{5}
}
func (x *ListSubmissionsForReviewRequest) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
func (x *ListSubmissionsForReviewRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
@@ -487,6 +480,13 @@ func (x *ListSubmissionsForReviewRequest) GetPageToken() int32 {
return 0
}
func (x *ListSubmissionsForReviewRequest) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
func (x *ListSubmissionsForReviewRequest) GetStatus() ReviewStatus {
if x != nil && x.Status != nil {
return *x.Status
@@ -829,11 +829,11 @@ const file_api_proto_review_proto_rawDesc = "" +
"\vreviewer_id\x18\x02 \x01(\tR\n" +
"reviewerId\x12%\n" +
"\x0ecompetition_id\x18\x03 \x01(\tR\rcompetitionId\"\xb1\x01\n" +
"\x1fListSubmissionsForReviewRequest\x12\x14\n" +
"\x05token\x18\x01 \x01(\tR\x05token\x12\x1b\n" +
"\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" +
"\x1fListSubmissionsForReviewRequest\x12\x1b\n" +
"\tpage_size\x18\x01 \x01(\x05R\bpageSize\x12\x1d\n" +
"\n" +
"page_token\x18\x03 \x01(\x05R\tpageToken\x121\n" +
"page_token\x18\x02 \x01(\x05R\tpageToken\x12\x14\n" +
"\x05token\x18\x03 \x01(\tR\x05token\x121\n" +
"\x06status\x18\x04 \x01(\x0e2\x14.review.ReviewStatusH\x00R\x06status\x88\x01\x01B\t\n" +
"\a_status\"\xa8\x01\n" +
" ListSubmissionsForReviewResponse\x12\x1f\n" +
+6 -6
View File
@@ -490,9 +490,9 @@ func (x *ListSubmissionsRequest) GetStatus() SubmissionStatus {
type ListSubmissionsResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
TotalCount int32 `protobuf:"varint,2,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"`
NextPageToken int32 `protobuf:"varint,3,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
Submissions []*Submission `protobuf:"bytes,1,rep,name=submissions,proto3" json:"submissions,omitempty"`
TotalCount int32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"`
NextPageToken int32 `protobuf:"varint,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
Submissions []*Submission `protobuf:"bytes,3,rep,name=submissions,proto3" json:"submissions,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -588,10 +588,10 @@ const file_api_proto_submission_proto_rawDesc = "" +
"\auser_id\x18\x05 \x01(\tR\x06userId\x124\n" +
"\x06status\x18\x06 \x01(\x0e2\x1c.submission.SubmissionStatusR\x06status\"\x9c\x01\n" +
"\x17ListSubmissionsResponse\x12\x1f\n" +
"\vtotal_count\x18\x02 \x01(\x05R\n" +
"\vtotal_count\x18\x01 \x01(\x05R\n" +
"totalCount\x12&\n" +
"\x0fnext_page_token\x18\x03 \x01(\x05R\rnextPageToken\x128\n" +
"\vsubmissions\x18\x01 \x03(\v2\x16.submission.SubmissionR\vsubmissions*\xd7\x01\n" +
"\x0fnext_page_token\x18\x02 \x01(\x05R\rnextPageToken\x128\n" +
"\vsubmissions\x18\x03 \x03(\v2\x16.submission.SubmissionR\vsubmissions*\xd7\x01\n" +
"\x10SubmissionStatus\x12!\n" +
"\x1dSUBMISSION_STATUS_UNSPECIFIED\x10\x00\x12\x1d\n" +
"\x19SUBMISSION_STATUS_PENDING\x10\x01\x12$\n" +