Début implémentation notes autres dans manager backend

This commit is contained in:
Quentin Roussel
2023-05-04 00:23:59 +02:00
parent d16f543056
commit b709602be6
5 changed files with 222 additions and 108 deletions

View File

@@ -41,7 +41,6 @@ class ApiClient():
self.port = port
def send(self,note,commentaire):
#Exemple ajout d'un commentaire depuis la borne (site ou geste)
avis = {
"note": note,
@@ -50,3 +49,11 @@ class ApiClient():
}
print(self.host, self.port)
return requests.post("http://"+self.host+":"+self.port+"/add_review", data=avis)
def get_criteria(self):
res = []
crits = json.loads(requests.get("http://"+self.host+":"+self.port+"/borne/get_criteres").text)
for c in crits:
res.append(c["nom"])
return res
print(ApiClient().get_criteria())