osu-tournament-rating / otr-api

API powering osu! Tournament Rating
https://otr.stagec.xyz/
GNU General Public License v3.0
8 stars 5 forks source link

Feature/search api #189

Closed bugg86 closed 6 months ago

bugg86 commented 6 months ago

Closes #111

Adds new controller with a new endpoint that allows for searching of Matches, Tournaments and Players all by name. Request takes in query parameters for either of the 3 and will return a SearchResponseDTO with the following formats:

bugg86 commented 6 months ago

Logic looks ok to me now. @hburn7 I was thinking that the code for validating the (tournament, match, user) DTO and creating the new SearchResponseDTO looks weird to add into the controller itself. It should probably be moved into it's own SearchService?

I was honestly thinking about doing this originally, but it didn't strike me as something that was complex enough to justify creating an entire new service. If we potentially (we probably will) expand this controller, it would probably end up making more sense to create a SearchService.

hburn7 commented 6 months ago

Yes definitely create a new service. Logic like that should not be in the controller, even if it's one method.