mdcpp / mdoj

Mingdao OnlineJudge, A performant contest management system base on cutting edge stack.
https://mdcpp.github.io/mdoj/
5 stars 1 forks source link

Make contest with timer visible before joinable #86

Closed Eason0729 closed 1 month ago

Eason0729 commented 1 month ago

As the title said.

And this will also be part of basis backend.

proto draft:

message PublishContestRequest{
    require int32 contest_id = 1;
    // if set, user can only join after this timestamp(admin can bypass restriction
    optional google.protobuf.Timestamp begin = 4;
}

service Contest {
  rpc List(ListContestRequest) returns (ListContestResponse);
  rpc FullInfo(Id) returns (ContestFullInfo);

  rpc Create(CreateContestRequest) returns (Id);
  rpc Update(UpdateContestRequest) returns (google.protobuf.Empty);
  rpc Remove(RemoveRequest) returns (google.protobuf.Empty);

  rpc Publish(PublishContestRequest) returns (google.protobuf.Empty);
  rpc Unpublish(PublishRequest) returns (google.protobuf.Empty);

  rpc Join(JoinContestRequest) returns (google.protobuf.Empty);
}

message UpdateContestRequest {
  message Info {
    optional string title = 1;
    optional string content = 4;
    optional string tags = 6;
    // if there is password: enter original password to disable password, null
    // to keep password. if there isn't: enter new password to set password,
    // null to keep it password disable
    optional string password = 5;
    optional google.protobuf.Timestamp end_of_submission  = 7;
  }
  required Info info = 1;
  required int32 id = 2;
  // can prevent duplicate request.
  // It will return cache result if server the request with the same
  // `request_id` has be processed.
  optional string request_id = 3;
}
Eason0729 commented 1 month ago

https://github.com/mdcpp/mdoj/pull/90