Skip to content

Commit

Permalink
docs: 🔧 update config for quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
Eason0729 committed Dec 23, 2023
1 parent d576426 commit 8d61541
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 27 deletions.
8 changes: 4 additions & 4 deletions backend/src/endpoint/contest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl ContestSet for Arc<Server> {
}
list_request::Request::Pager(old) => {
reverse = old.reverse;
<Pager<Entity> as NoParentPager<Entity>>::from_raw(old.session, &self)?
<Pager<Entity> as NoParentPager<Entity>>::from_raw(old.session, self)?
}
};

Expand All @@ -117,7 +117,7 @@ impl ContestSet for Arc<Server> {
.map(|x| x.into())
.collect();

let next_session = pager.into_raw(&self);
let next_session = pager.into_raw(self);

Ok(Response::new(ListContestResponse { list, next_session }))
}
Expand All @@ -133,7 +133,7 @@ impl ContestSet for Arc<Server> {
text_search_request::Request::Text(create) => Pager::text_search(create),
text_search_request::Request::Pager(old) => {
reverse = old.reverse;
<Pager<_> as NoParentPager<Entity>>::from_raw(old.session, &self)?
<Pager<_> as NoParentPager<Entity>>::from_raw(old.session, self)?
}
};

Expand All @@ -144,7 +144,7 @@ impl ContestSet for Arc<Server> {
.map(|x| x.into())
.collect();

let next_session = pager.into_raw(&self);
let next_session = pager.into_raw(self);

Ok(Response::new(ListContestResponse { list, next_session }))
}
Expand Down
4 changes: 2 additions & 2 deletions backend/src/endpoint/education.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl EducationSet for Arc<Server> {
reverse = old.reverse;
<Pager<Entity> as HasParentPager<problem::Entity, Entity>>::from_raw(
old.session,
&self,
self,
)?
}
};
Expand All @@ -248,7 +248,7 @@ impl EducationSet for Arc<Server> {
.map(|x| x.into())
.collect();

let next_session = pager.into_raw(&self);
let next_session = pager.into_raw(self);

Ok(Response::new(ListEducationResponse { list, next_session }))
}
Expand Down
12 changes: 6 additions & 6 deletions backend/src/endpoint/problem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl ProblemSet for Arc<Server> {
reverse = old.reverse;
<Pager<Entity> as HasParentPager<contest::Entity, Entity>>::from_raw(
old.session,
&self,
self,
)?
}
};
Expand All @@ -126,7 +126,7 @@ impl ProblemSet for Arc<Server> {
.map(|x| x.into())
.collect();

let next_session = pager.into_raw(&self);
let next_session = pager.into_raw(self);

Ok(Response::new(ListProblemResponse { list, next_session }))
}
Expand All @@ -145,7 +145,7 @@ impl ProblemSet for Arc<Server> {
}
text_search_request::Request::Pager(old) => {
reverse = old.reverse;
<Pager<_> as HasParentPager<contest::Entity, Entity>>::from_raw(old.session, &self)?
<Pager<_> as HasParentPager<contest::Entity, Entity>>::from_raw(old.session, self)?
}
};

Expand All @@ -156,7 +156,7 @@ impl ProblemSet for Arc<Server> {
.map(|x| x.into())
.collect();

let next_session = pager.into_raw(&self);
let next_session = pager.into_raw(self);

Ok(Response::new(ListProblemResponse { list, next_session }))
}
Expand Down Expand Up @@ -414,7 +414,7 @@ impl ProblemSet for Arc<Server> {
reverse = old.reverse;
<Pager<Entity> as HasParentPager<contest::Entity, Entity>>::from_raw(
old.session,
&self,
self,
)?
}
};
Expand All @@ -426,7 +426,7 @@ impl ProblemSet for Arc<Server> {
.map(|x| x.into())
.collect();

let next_session = pager.into_raw(&self);
let next_session = pager.into_raw(self);

Ok(Response::new(ListProblemResponse { list, next_session }))
}
Expand Down
8 changes: 4 additions & 4 deletions backend/src/endpoint/submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl SubmitSet for Arc<Server> {
reverse = old.reverse;
<Pager<Entity> as HasParentPager<problem::Entity, Entity>>::from_raw(
old.session,
&self,
self,
)?
}
};
Expand All @@ -89,7 +89,7 @@ impl SubmitSet for Arc<Server> {
.map(|x| x.into())
.collect();

let next_session = pager.into_raw(&self);
let next_session = pager.into_raw(self);

Ok(Response::new(ListSubmitResponse { list, next_session }))
}
Expand All @@ -111,7 +111,7 @@ impl SubmitSet for Arc<Server> {
reverse = old.reverse;
<Pager<Entity> as HasParentPager<problem::Entity, Entity>>::from_raw(
old.session,
&self,
self,
)?
}
};
Expand All @@ -123,7 +123,7 @@ impl SubmitSet for Arc<Server> {
.map(|x| x.into())
.collect();

let next_session = pager.into_raw(&self);
let next_session = pager.into_raw(self);

Ok(Response::new(ListSubmitResponse { list, next_session }))
}
Expand Down
8 changes: 4 additions & 4 deletions backend/src/endpoint/testcase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl TestcaseSet for Arc<Server> {
reverse = old.reverse;
<Pager<Entity> as HasParentPager<problem::Entity, Entity>>::from_raw(
old.session,
&self,
self,
)?
}
};
Expand All @@ -109,7 +109,7 @@ impl TestcaseSet for Arc<Server> {
.map(|x| x.into())
.collect();

let next_session = pager.into_raw(&self);
let next_session = pager.into_raw(self);

Ok(Response::new(ListTestcaseResponse { list, next_session }))
}
Expand Down Expand Up @@ -298,7 +298,7 @@ impl TestcaseSet for Arc<Server> {
reverse = old.reverse;
<Pager<Entity> as HasParentPager<problem::Entity, Entity>>::from_raw(
old.session,
&self,
self,
)?
}
};
Expand All @@ -310,7 +310,7 @@ impl TestcaseSet for Arc<Server> {
.map(|x| x.into())
.collect();

let next_session = pager.into_raw(&self);
let next_session = pager.into_raw(self);

Ok(Response::new(ListTestcaseResponse { list, next_session }))
}
Expand Down
8 changes: 4 additions & 4 deletions backend/src/endpoint/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl UserSet for Arc<Server> {
}
list_request::Request::Pager(old) => {
reverse = old.reverse;
<Pager<Entity> as NoParentPager<Entity>>::from_raw(old.session, &self)?
<Pager<Entity> as NoParentPager<Entity>>::from_raw(old.session, self)?
}
};

Expand All @@ -116,7 +116,7 @@ impl UserSet for Arc<Server> {
.map(|x| x.into())
.collect();

let next_session = pager.into_raw(&self);
let next_session = pager.into_raw(self);

Ok(Response::new(ListUserResponse { list, next_session }))
}
Expand All @@ -132,7 +132,7 @@ impl UserSet for Arc<Server> {
text_search_request::Request::Text(create) => Pager::text_search(create),
text_search_request::Request::Pager(old) => {
reverse = old.reverse;
<Pager<_> as NoParentPager<Entity>>::from_raw(old.session, &self)?
<Pager<_> as NoParentPager<Entity>>::from_raw(old.session, self)?
}
};

Expand All @@ -143,7 +143,7 @@ impl UserSet for Arc<Server> {
.map(|x| x.into())
.collect();

let next_session = pager.into_raw(&self);
let next_session = pager.into_raw(self);

Ok(Response::new(ListUserResponse { list, next_session }))
}
Expand Down
4 changes: 2 additions & 2 deletions backend/src/endpoint/util/pagination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ where
SearchDep::Parent(x) => RawSearchDep::Parent(x),
},
};
let byte = server.crypto.encode(&raw);
let byte = server.crypto.encode(raw);

base64::Engine::encode(
&base64::engine::general_purpose::STANDARD_NO_PAD,
Expand Down Expand Up @@ -273,7 +273,7 @@ where
SearchDep::Parent(x) => RawSearchDep::Parent(x),
},
};
let byte = server.crypto.encode(&raw);
let byte = server.crypto.encode(raw);

base64::Engine::encode(
&base64::engine::general_purpose::STANDARD_NO_PAD,
Expand Down
2 changes: 1 addition & 1 deletion backend/src/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Hash for judger::LangInfo {

impl PartialOrd for judger::LangInfo {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.lang_uid.partial_cmp(&other.lang_uid)
Some(self.lang_uid.cmp(&other.lang_uid))
}
}

Expand Down
4 changes: 4 additions & 0 deletions docker/quickstart/backend.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ type = "static"
trust_x_forwarded_for = true
public_pem = "../cert/cert.pem"
private_pem = "../cert/key.pem"

[imgur]
client_id = "fffffffffffffff"
client_secret = "ffffffffffffffffffffffffffffffffffffffff"

0 comments on commit 8d61541

Please sign in to comment.