joint-online-judge / horse

The new generation of JOJ Backend.
https://joint-online-judge.github.io/horse/
MIT License
5 stars 3 forks source link

Domain Group API Set #95

Closed nichujie closed 2 years ago

nichujie commented 2 years ago

Discussed in https://github.com/joint-online-judge/horse/discussions/91

Originally posted by **nichujie** January 18, 2022 Create a new API set called **Domain Group**. This is used for any APIs involved in 2 domains: * Clone problems * List domains with same tags * List problems in domains with same tags * Problem group * ... The basic rules of this API set are: * There should be 2 domain id in Path: e.g. `/domains/{domainA}/with/{domainB}` (`with` can be changed) * permissions expand from domainA to domainB * The user send request from domainA to request some resources related to domainB. * If user has permission in domainA, we assume it to have same permission in domainB.
nichujie commented 2 years ago

See #92 as a side quest (optional).

nichujie commented 2 years ago

Background

Imagine someone want to clone problems now. We shall first provide a list of domains (with same tags) which he/she can clone from. Then, after selecting a certain domain, we need to show the list of all problems (and probably can be filtered by problem title) in this domain to select from.

nichujie commented 2 years ago

Current task: finish the first 3 APIs listed above, in a new API set.

In #94, I have written some relevant code for reference. You can either keep it or start from scratch.

Notice that problem_set is cancelled in problem cloning as described in #93.