add tenant logic

This commit is contained in:
2024-12-15 12:28:22 +09:00
parent 2823364148
commit 39775a5179
16 changed files with 138 additions and 55 deletions

View File

@@ -0,0 +1,13 @@
from app.db.cruddb.crudbase import crudbase
from app.db import models, schemas
from sqlalchemy.orm import Session
class dbtenant(crudbase):
def __init__(self):
super().__init__(model=models.Tenant)
def get_tenant(sefl,db:Session,tenantid: str):
tenant = db.execute(super().get_by_conditions({"tenantid":tenantid})).scalars().first()
return tenant
tenantService = dbtenant()