Diskuze: Správný návrh API - pacient a doktoři
V předchozím kvízu, Test znalostí C# .NET online, jsme si ověřili nabyté zkušenosti z kurzu.
Zobrazeno 4 zpráv z 4.
V předchozím kvízu, Test znalostí C# .NET online, jsme si ověřili nabyté zkušenosti z kurzu.
upřímně toto jsem vůbec nepochopil. Já se ptám na návrh API. Frondend mám v React JS
Tak jsem dostal odpověď na stackoverflow.com, myslím, že krásně odpověděla na můj dotaz.
This question is subjective since there's not one "correct" way to do it, and everyone will have differing opinions. But, there are best practices to follow, and based on the info given, here's how I would approach the URI design for your API.
Patient
/api/patients/{id}
/api/patients/{id}/profiles
Doctor
/api/doctors/{id}
/api/doctors/{id}/profiles
/api/doctors/{id}/patients
/api/doctors/{id}/patients/{patientid}/profiles
The authorization for accessing these resources should be handled by OAuth 2.0 +
OpenID, using claims and scopes.
Here's a link to some URI best practices - https://blog.restcase.com/…-uri-design/
Zobrazeno 4 zpráv z 4.