add subuser finding api
This commit is contained in:
parent
b6fea1ba1b
commit
e58d95a9d7
2
app.py
2
app.py
|
|
@ -16,4 +16,4 @@ app.mount(
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
uvicorn.run("main:app", port=5000, log_level="info")
|
||||
uvicorn.run("main:app", port=5000)
|
||||
|
|
|
|||
9
main.py
9
main.py
|
|
@ -5,6 +5,8 @@ from app import app
|
|||
from badmin.models.model import AccountAdmin
|
||||
from config import conf
|
||||
from core.auth.auth import PasswordMaker
|
||||
|
||||
from badmin.models.model import SubscriptionContract, SubscriptionPlan , AccountLawyeruser
|
||||
from database import get_db
|
||||
|
||||
import admin.urls
|
||||
|
|
@ -14,6 +16,11 @@ def ping():
|
|||
return {"message": "pong", "production": conf.IS_PROD}
|
||||
|
||||
|
||||
@app.get("/subUser" + "/{_id}/")
|
||||
async def hi(_id:int):
|
||||
db = next(get_db())
|
||||
row = db.query(AccountLawyeruser).filter(AccountLawyeruser.main_id == _id).all()
|
||||
return {"users": row}
|
||||
@app.get('/create')
|
||||
def create_user():
|
||||
db = next(get_db())
|
||||
|
|
@ -47,4 +54,4 @@ app.add_middleware(
|
|||
app.router.redirect_slashes = False
|
||||
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run(app, host="0.0.0.0", port=5000)
|
||||
uvicorn.run("main:app", host="0.0.0.0", port=5000 , log_level='info')
|
||||
|
|
|
|||
Loading…
Reference in New Issue