modified docker structure

This commit is contained in:
Lukian 2024-12-28 16:58:59 +01:00
parent e2d8d04c04
commit 8f11c56d1a
5 changed files with 37 additions and 4 deletions

42
client/company/main.py Normal file
View file

@ -0,0 +1,42 @@
import requests
HOST = "http://localhost:3000/"
"""Affichage des actions mises en vente par une entreprise
input :
- idComp : Identifiant de l'entreprise
"""
def getShares(idComp):
url = HOST + 'api/companies/'+idComp+'/shares'
r = requests.get(url)
return r.json()
"""Création d'une action par une entreprise
input :
- idComp : identifiant de l'entreprise
- price : prix de l'action sur le marché
"""
def emmitShare(idComp, price):
url = HOST + 'api/shares/emmit'
obj={'id':idComp,'price':price}
r = requests.post(url, json=obj)
return r.json()
"""Affichage des informations d'une enteprise
input :
- idComp : identifiant de l'entreprise
"""
def getCompany(idComp):
url = HOST + 'api/companies/'+idComp
r=requests.get(url)
return r.json()
"""Affichage les enteprises """
def getCompanies():
url = HOST + 'api/companies/'
r=requests.get(url)
return r.json()
if __name__ == "__main__":
pass