Skip to content

Commit

Permalink
feat(rsjudge-grpc): 🚚 restructure proto packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Jisu-Woniu committed Apr 17, 2024
1 parent dc770f3 commit 5da0295
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 26 deletions.
26 changes: 26 additions & 0 deletions crates/rsjudge-grpc/proto/cases/v1/cases.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
syntax = "proto3";

package cases.v1;

// Fetch cases from backend server.
service CasesService {
// Fetch cases from the backend server.
rpc FetchCases(FetchCasesRequest) returns (FetchCasesResponse) {}
}

// Request to fetch cases from the backend server.
message FetchCasesRequest {
// The id of the problem.
int32 problem_id = 1;
}

// Response to fetch cases from the backend server.
message FetchCasesResponse {
// The id of the cases requested.
int32 cases_id = 1;
// The tarball of the cases, with config file.
//
// TODO: The tarball should be compressed in a specified format.
// Maybe .tar.zst
bytes tarball = 2;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

package rsjudge.v1;
package judge.v1;

import "google/protobuf/empty.proto";

Expand Down
23 changes: 0 additions & 23 deletions crates/rsjudge-grpc/proto/register/v1/register.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,3 @@ message RegisterResponse {
// The id for the rsjudge instance.
int32 id = 1;
}

// Fetch cases from backend server.
service CaseService {
// Fetch cases from the backend server.
rpc FetchCases(FetchCasesRequest) returns (FetchCasesResponse) {}
}

// Request to fetch cases from the backend server.
message FetchCasesRequest {
// The id of the problem.
int32 problem_id = 1;
}

// Response to fetch cases from the backend server.
message FetchCasesResponse {
// The id of the cases requested.
int32 cases_id = 1;
// The tarball of the cases, with config file.
//
// TODO: The tarball should be compressed in a specified format.
// Maybe .tar.zst
bytes tarball = 2;
}
4 changes: 2 additions & 2 deletions crates/rsjudge-grpc/src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
#![allow(clippy::match_single_binding)]
use tonic::include_proto;

include_proto!("rsjudge.v1");

include_proto!("cases.v1");
include_proto!("judge.v1");
include_proto!("register.v1");

0 comments on commit 5da0295

Please sign in to comment.