explication des routes : méthodes, body, ...
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
d31875144c
commit
4fa4c41be1
@ -0,0 +1,163 @@
|
||||
# API
|
||||
|
||||
TOKEN = "qUOGkWdoPCgbmuqxIC8xiaX0rV1Pw1LoPafkaoHOgszEyD9P2vcOu493xCDZpAqO"
|
||||
URL : "https://trusting-panini.87-106-126-109.plesk.page/api/"
|
||||
|
||||
|
||||
# Administrator
|
||||
|
||||
add a new administrator : API.API_URL + "add/administrator/" + API.TOKEN
|
||||
méthode : post
|
||||
requête : rien à ajouter
|
||||
body : List<KeyValuePair<string, string>> des valeurs à ajouter (username et password)
|
||||
retourne : rien (voir le contrôleur des administrateurs pour les codes de retour)
|
||||
log : Logger.LogInformation("Admin '{administratorsModelName}' added", administratorModel.Username);
|
||||
|
||||
get all administrator : API.API_URL + "all/administrators/" + API.TOKEN + "/" + page
|
||||
méthode : get
|
||||
requête : page : numéro de la page
|
||||
body : pas de contenu
|
||||
retourne : les 10 administrateurs de la page (voir le contrôleur des administrateurs pour les codes de retour)
|
||||
log : pas de log
|
||||
|
||||
delete an administrator : API.API_URL + "delete/administrator/" + id + "/" + API.TOKEN
|
||||
méthode : delete
|
||||
requête : id : identifiant de l'administrateur à supprimer
|
||||
body : pas de contenu
|
||||
retourne : rien (voir le contrôleur des administrateurs pour les codes de retour)
|
||||
log : Logger.LogInformation("Admin '{OldAdminModelName}' deleted", OldAdminName);
|
||||
|
||||
edit an administrator : API.API_URL + "update/administrator/" + Id + "/" + API.TOKEN
|
||||
requête : id : identifiant de l'administrateur à modifier
|
||||
body : nouveau username et nouveau mot de passe
|
||||
retourne : rien (voir le contrôleur des administrateurs pour les codes de retour)
|
||||
log : Logger.LogInformation("Admin '{OldAdminModelName}' edited in '{NewAdminModelName}'", OldAdminName, administratorModel.Username);
|
||||
|
||||
# Chapter
|
||||
add a new chapter : API.API_URL + "add/chapter/" + API.TOKEN
|
||||
méthode : post
|
||||
requête : rien à ajouter
|
||||
body : List<KeyValuePair<string, string>> des valeurs à ajouter (name)
|
||||
retourne : rien (voir le contrôleur des chapitres pour les codes de retour)
|
||||
log : Logger.LogInformation("Chapter '{chaptersModelName}' added", chapterModel.Username);
|
||||
|
||||
delete a chapter : API.API_URL + "delete/chapter/" + Id + "/" + API.TOKEN
|
||||
méthode : delete
|
||||
requête : Id : id du chapitre à supprimer
|
||||
body : pas de contenu
|
||||
retourne : rien (voir le contrôleur des chapitres pour les codes de retour)
|
||||
log : pas de log
|
||||
|
||||
get all chapters : API.API_URL + "all/chapters/" + API.TOKEN + "/" + page
|
||||
méthode : get
|
||||
requête : page : numéro de la page
|
||||
body : pas de contenu
|
||||
retourne : les 10 chapitres de la page (voir le contrôleur des chapitres pour les codes de retour)
|
||||
log : pas de log
|
||||
|
||||
récupérer un chapitre par son nom : API.API_URL + "chapters/name/" + Name + "/" + API.TOKEN
|
||||
méthode : get
|
||||
requête : Name : nom du chapitre
|
||||
body : pas de contenu
|
||||
retourne : une liste des chapitres correspondants à ce nom
|
||||
log : pas de log
|
||||
edit a chapter : API.API_URL + "update/chapter/" + Id + "/" + API.TOKEN
|
||||
méthode : post
|
||||
requête : Id : id du chapitre à modifier
|
||||
body : nouveau nom
|
||||
retourne : rien (voir le contrôleur des chapitres pour les codes de retour)
|
||||
log : Logger.LogInformation("Chapter '{OldChapterModelName}' edited in '{NewChapterModelName}'", OldChapterName, chapterModel.Name);
|
||||
|
||||
# Player
|
||||
add a new player : API.API_URL + "add/player/" + API.TOKEN
|
||||
méthode : post
|
||||
requête : rien à ajouter
|
||||
body : List<KeyValuePair<string, string>> des valeurs à ajouter (nickname, password)
|
||||
retourne : rien (voir le contrôleur des joueurs pour les codes de retour)
|
||||
log : Logger.LogInformation("Chapter '{chaptersModelName}' added", chapterModel.Username);
|
||||
edit a player : API.API_URL + "update/player/" + Id + "/" + API.TOKEN
|
||||
méthode : post
|
||||
requête : Id : id du chapitre à modifier
|
||||
body : nouveau nickname et nouveau password
|
||||
retourne : rien (voir le contrôleur des joueurs pour les codes de retour)
|
||||
log : pas de log
|
||||
delete a player : API.API_URL + "delete/player/" + id + "/" + API.TOKEN
|
||||
méthode : delete
|
||||
requête : id : identifiant du joueur à supprimer
|
||||
body : pas de contenu
|
||||
retourne : rien (voir le contrôleur des administrateurs pour les codes de retour)
|
||||
log : pas de log
|
||||
get players : API.API_URL + "all/players/" + API.TOKEN + "/" + page
|
||||
méthode : get
|
||||
requête : page : numéro de la page
|
||||
body : pas de contenu
|
||||
retourne : les 10 joueur de la page (voir le contrôleur des joueurs pour les codes de retour)
|
||||
log : pas de log
|
||||
|
||||
|
||||
# Question
|
||||
add a new question : API.API_URL + "add/question/" + API.TOKEN
|
||||
méthode : post
|
||||
requête : rien à ajouter
|
||||
body : List<KeyValuePair<string, string>> des valeurs à ajouter (content, idChapter, answerContent1/2/3/4 (faire une boucle), idAnswerGood)
|
||||
retourne : rien (voir le contrôleur des joueurs pour les codes de retour)
|
||||
log : Logger.LogInformation("Chapter '{chaptersModelName}' added", chapterModel.Username);
|
||||
|
||||
update a question API.API_URL + "/update/question/" + Id + "/" + API.TOKEN
|
||||
méthode : post
|
||||
requête : Id : identifiant de la question à modifier
|
||||
body : List<KeyValuePair<string, string>> des valeurs à ajouter (content, idChapter, answerContent1/2/3/4 (faire une boucle), idAnswerGood)
|
||||
retourne : rien (voir le contrôleur des joueurs pour les codes de retour)
|
||||
log : Logger.LogInformation("Question '{OldQuestionContent}', Chapter '{OldchapterId}' and the correct answer '{OldIdAnswerGood}' edited in '{NewQuestionContent}' for Chapter '{NewchapterId}' with 4 answers : '{IdAnswer1}':'{NewAnswerContent1}', '{IdAnswer2}':'{NewAnswerContent2}', '{IdAnswer3}':'{NewAnswerContent3}', '{IdAnswer4}':'{NewAnswerContent4}' the correct '{IdAnswerGood}'", OldQuestionContent, OldQuestionIdChapter,OldIdAnswerGood, question.Content, question.IdChapter, answers[0].Id, answers[0].Content, answers[1].Id, answers[1].Content, answers[2].Id, answers[2].Content, answers[3].Id, answers[3].Content,IdAgood);
|
||||
delete a question : API.API_URL + "delete/question/" + id + "/" + API.TOKEN
|
||||
méthode : delete
|
||||
requête : id : identifiant de la question à supprimer
|
||||
body : pas de contenu
|
||||
retourne : rien (voir le contrôleur des administrateurs pour les codes de retour)
|
||||
log : pas de log
|
||||
get questions : API.API_URL + "all/questions/" + API.TOKEN + "/" + page
|
||||
méthode : get
|
||||
requête : page : numéro de la page
|
||||
body : pas de contenu
|
||||
retourne : les 10 questions de la page (voir le contrôleur des joueurs pour les codes de retour)
|
||||
log : pas de log
|
||||
get all questions to convert it in a CSV format : API.API_URL + "questionsExport/" + API.TOKEN
|
||||
méthode : get
|
||||
requête : rien à ajouter
|
||||
retourne : une chaîne de caractères pouvant être convertie en csv
|
||||
log : pas de log
|
||||
|
||||
# Data local service
|
||||
|
||||
get some questions : API.API_URL + "questions/" + Id + "/" + API.TOKEN
|
||||
méthode : get
|
||||
requête : Id : identifiant de la question
|
||||
body : pas de contenu
|
||||
retourne : une liste de questions dont la première correspond à la question d'identifiant "Id"
|
||||
log : pas de log
|
||||
get some chapters : API.API_URL + "chapters/" + Id + "/" + API.TOKEN).Result
|
||||
méthode : get
|
||||
requête : Id : identifiant du chapitre
|
||||
body : pas de contenu
|
||||
retourne : une liste de chapitres dont le premier correspond au chapitre d'identifiant "Id"
|
||||
log : pas de log
|
||||
|
||||
get some administrators : API.API_URL + "administrators/" + Id + "/" + API.TOKEN).Result
|
||||
méthode : get
|
||||
requête : Id : identifiant de l'administrateur
|
||||
body : pas de contenu
|
||||
retourne : une liste d'administrateurs dont le premier correspond à l'administrateur d'identifiant "Id"
|
||||
log : pas de log
|
||||
get some questions : API.API_URL + "questions/" + API.TOKEN <=> API.API_URL + "all/questions/" + API.TOKEN + "/" + page
|
||||
get some players : API.API_URL + "players/" + id + "/" + API.TOKEN)
|
||||
méthode : get
|
||||
requête : Id : identifiant du joueur
|
||||
body : pas de contenu
|
||||
retourne : une liste de joueurs dont le premier correspond au joueur d'identifiant "Id"
|
||||
log : pas de log
|
||||
get an answer : API.API_URL + "answer/" + id + "/" + API.TOKEN
|
||||
méthode : get
|
||||
requête : Id : identifiant de la réponse
|
||||
body : pas de contenu
|
||||
retourne : la réponse d'identifiant "Id"
|
||||
log : pas de log
|
@ -1,34 +0,0 @@
|
||||
./Blazor/Blazor/Pages/Admins/AddAdministrator.razor.cs: string apiUri = API.API_URL + "add/administrator/" + API.TOKEN
|
||||
./Blazor/Blazor/Pages/Admins/Administrators.razor.cs: var response = await Http.GetFromJsonAsync<Administrator[]>(API.API_URL + "all/administrators/" + API.TOKEN + "/" + page)
|
||||
./Blazor/Blazor/Pages/Admins/Administrators.razor.cs: string apiUri = API.API_URL +"delete/administrator/" + id + "/" + API.TOKEN
|
||||
./Blazor/Blazor/Pages/Admins/EditAdministrator.razor.cs: string apiUri = API.API_URL + "update/administrator/" + administratorModel.Id + "/" + API.TOKEN
|
||||
./Blazor/Blazor/Pages/Chapters/AddChapter.razor.cs: string apiUri = API.API_URL + "add/chapter/" + API.TOKEN
|
||||
./Blazor/Blazor/Pages/Chapters/Chapters.razor.cs: string apiUri = API.API_URL+"delete/chapter/" + id + "/" + API.TOKEN
|
||||
./Blazor/Blazor/Pages/Chapters/Chapters.razor.cs: var response = await Http.GetFromJsonAsync<Chapter[]>(API.API_URL + "all/chapters/" + API.TOKEN + "/" + page)
|
||||
./Blazor/Blazor/Pages/Chapters/EditChapter.razor.cs: string apiUri = API.API_URL+"update/chapter/" + chapterModel.Id + "/" + API.TOKEN
|
||||
./Blazor/Blazor/Pages/Players/AddPlayer.razor.cs: string apiUri = API.API_URL + "add/player/" + API.TOKEN
|
||||
./Blazor/Blazor/Pages/Players/EditPlayer.razor.cs: string apiUri = API.API_URL+"update/player/" + playerModel.Id + "/" + API.TOKEN
|
||||
./Blazor/Blazor/Pages/Players/Players.razor.cs: string apiUri = API.API_URL+"delete/player/" + id + "/" + API.TOKEN
|
||||
./Blazor/Blazor/Pages/Players/Players.razor.cs: var response = await Http.GetFromJsonAsync<Player[]>(API.API_URL + "all/players/" + API.TOKEN + "/" + page)
|
||||
./Blazor/Blazor/Pages/Questions/AddQuestion.razor.cs: var response = Http.GetFromJsonAsync<Chapter[]>(API.API_URL + "all/chapters/" + API.TOKEN + "/1").Result
|
||||
./Blazor/Blazor/Pages/Questions/AddQuestion.razor.cs: string apiUri = API.API_URL + "add/question/" + API.TOKEN
|
||||
./Blazor/Blazor/Pages/Questions/DisplayQuestions.razor.cs: var response = Http.GetFromJsonAsync<Question[]>(API.API_URL + "questions/" + QuestionId + "/" + API.TOKEN).Result
|
||||
./Blazor/Blazor/Pages/Questions/EditQuestion.razor.cs: var response = Http.GetFromJsonAsync<Chapter[]>(API.API_URL + "all/chapters/" + API.TOKEN + "/1").Result
|
||||
./Blazor/Blazor/Pages/Questions/EditQuestion.razor.cs: var resp = Http.GetFromJsonAsync<Question[]>(API.API_URL + "questions/" + Id + "/" + API.TOKEN).Result
|
||||
./Blazor/Blazor/Pages/Questions/EditQuestion.razor.cs: string apiUri = API.API_URL+"/update/question/" + question.Id + "/" + API.TOKEN
|
||||
./Blazor/Blazor/Pages/Questions/Questions.razor.cs: string apiUri = API.API_URL+"delete/question/" + id + "/" + API.TOKEN
|
||||
./Blazor/Blazor/Pages/Questions/Questions.razor.cs: var response = await Http.GetFromJsonAsync<Question[]>(API.API_URL + "all/questions/" + API.TOKEN + "/" + page)
|
||||
./Blazor/Blazor/Pages/Questions/Questions.razor.cs: HttpResponseMessage response = await Http.GetAsync(API.API_URL+"questionsExport/"+API.TOKEN)
|
||||
./Blazor/Blazor/Pages/Questions/Questions.razor.cs: string apiUri = API.API_URL+"chapters/name/"+field[1] + "/" + API.TOKEN
|
||||
./Blazor/Blazor/Pages/Questions/Questions.razor.cs: apiUri = API.API_URL+"add/question/"+API.TOKEN
|
||||
./Blazor/Blazor/Services/DataLocalService.cs: var currentData = _http.GetFromJsonAsync<List<Chapter>>(API.API_URL + "chapters/" + id + "/" + API.TOKEN).Result
|
||||
./Blazor/Blazor/Services/DataLocalService.cs: var currentData = _http.GetFromJsonAsync<List<Administrator>>(API.API_URL + "administrators/" + id + "/" + API.TOKEN).Result
|
||||
./Blazor/Blazor/Services/DataLocalService.cs: var currentData = _http.GetFromJsonAsync<List<Question>>(API.API_URL + "questions/"+API.TOKEN).Result
|
||||
./Blazor/Blazor/Services/DataLocalService.cs: var currentData = await _http.GetFromJsonAsync<List<Question>>(API.API_URL + "questions/" + API.TOKEN)
|
||||
./Blazor/Blazor/Services/DataLocalService.cs: var currentData = _http.GetFromJsonAsync<List<Player>>(API.API_URL + "players/" + id + "/" + API.TOKEN).Result
|
||||
./Blazor/Blazor/Services/DataLocalService.cs: var answer = _http.GetFromJsonAsync<Answer>(API.API_URL + "answer/" + id + "/" + API.TOKEN).Result
|
||||
public static class API
|
||||
{
|
||||
public static string TOKEN = "qUOGkWdoPCgbmuqxIC8xiaX0rV1Pw1LoPafkaoHOgszEyD9P2vcOu493xCDZpAqO"; //ASK IF YOU WANT THOSE ACCESS
|
||||
public static string API_URL = "https://trusting-panini.87-106-126-109.plesk.page/api/"; //ASK IF YOU WANT THOSE ACCESS
|
||||
}
|
Loading…
Reference in new issue