We have introduced some new standards in terms of design and code quality, and I feel they should be consolidated into a single issue to give a more clear goal to work towards. Each endpoint controller and it's relevant services / resource repositories in the API should be refactored to conform to the following:
Resource oriented design (Discussed in #138)
Our API is a resource API. We are accessing users, tournaments, etc. Our choices of not only routing but method naming should reflect this. This article is a great start and should serve as a general guideline.
Use consistent decorators and return values (Discussed in #223)
It is important for development and code readability for us to clearly define the interactions that occur on each endpoint. We currently use a very inconsistent mix of IActionResult, ActionResult<T>, and ProducesResponseTypeAttribute, which should be refactored into a consistent use of IActionResult.
Prefer overloads in method naming (Discussed in #95, #154)
This one is pretty self explanatory. We want to prefer overloading existing methods over using overly descriptive names. This also applies to controller method names and enforcing resource oriented design. Existing methods like MeController.GetLoggedInUserAsync should instead be named simply MeContoller.GetAsync (See Standard Methods).
Objective
We have introduced some new standards in terms of design and code quality, and I feel they should be consolidated into a single issue to give a more clear goal to work towards. Each endpoint controller and it's relevant services / resource repositories in the API should be refactored to conform to the following:
Resource oriented design (Discussed in #138)
Our API is a resource API. We are accessing users, tournaments, etc. Our choices of not only routing but method naming should reflect this. This article is a great start and should serve as a general guideline.
Use consistent decorators and return values (Discussed in #223)
It is important for development and code readability for us to clearly define the interactions that occur on each endpoint. We currently use a very inconsistent mix of
IActionResult
,ActionResult<T>
, andProducesResponseTypeAttribute
, which should be refactored into a consistent use ofIActionResult
.Prefer overloads in method naming (Discussed in #95, #154)
This one is pretty self explanatory. We want to prefer overloading existing methods over using overly descriptive names. This also applies to controller method names and enforcing resource oriented design. Existing methods like
MeController.GetLoggedInUserAsync
should instead be named simplyMeContoller.GetAsync
(See Standard Methods).Tasks:
BeatmapsController
LeaderboardsController
MatchesController
MeController
OAuthController
PlayersController
StatsController
TournamentsController