Merge branch 'dev3' of https://dev.azure.com/alicorn-dev/KintoneAppBuilder/_git/KintoneAppBuilder into dev3
This commit is contained in:
@@ -12,7 +12,7 @@ from app.core.dbmanager import get_db
|
|||||||
from app.db.crud import get_flows_by_app,get_kintoneformat
|
from app.db.crud import get_flows_by_app,get_kintoneformat
|
||||||
from app.core.auth import get_current_active_user,get_current_user
|
from app.core.auth import get_current_active_user,get_current_user
|
||||||
from app.core.apiexception import APIException
|
from app.core.apiexception import APIException
|
||||||
from app.db.cruddb import domainService
|
from app.db.cruddb import domainService,appService
|
||||||
|
|
||||||
kinton_router = r = APIRouter()
|
kinton_router = r = APIRouter()
|
||||||
|
|
||||||
@@ -452,10 +452,10 @@ def getTempPath(filename):
|
|||||||
fpath = os.path.join(rootdir,"Temp",filename)
|
fpath = os.path.join(rootdir,"Temp",filename)
|
||||||
return fpath
|
return fpath
|
||||||
|
|
||||||
def createappjs(domain_url,app):
|
def createappjs(domain_url,app,db = Depends(get_db)):
|
||||||
db = SessionLocal()
|
#db = SessionLocal()
|
||||||
flows = get_flows_by_app(db,domain_url,app)
|
flows = appService.get_flow(domain_url,app) #get_flows_by_app(db,domain_url,app)
|
||||||
db.close()
|
#db.close()
|
||||||
content={}
|
content={}
|
||||||
for flow in flows:
|
for flow in flows:
|
||||||
content[flow.eventid] = {'flowid':flow.flowid,'name':flow.name,'content':flow.content}
|
content[flow.eventid] = {'flowid':flow.flowid,'name':flow.name,'content':flow.content}
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ async def flow_details(
|
|||||||
domainurl = domainCacheService.get_default_domainurl(db,user.id)
|
domainurl = domainCacheService.get_default_domainurl(db,user.id)
|
||||||
if not domainurl:
|
if not domainurl:
|
||||||
return ApiReturnModel(data = None)
|
return ApiReturnModel(data = None)
|
||||||
return ApiReturnModel(data = appService.get_flow(db, domainurl, appid,user.id))
|
return ApiReturnModel(data = appService.get_flow(db, domainurl, appid))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise APIException('platform:flow',request.url._url,f"Error occurred while get flow by flowid:",e)
|
raise APIException('platform:flow',request.url._url,f"Error occurred while get flow by flowid:",e)
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ async def flow_list(
|
|||||||
if not domainurl:
|
if not domainurl:
|
||||||
return []
|
return []
|
||||||
#flows = get_flows_by_app(db, domainurl, appid)
|
#flows = get_flows_by_app(db, domainurl, appid)
|
||||||
flows = appService.get_flow(db,domainurl,appid,user.id)
|
flows = appService.get_flow(db,domainurl,appid)
|
||||||
return flows
|
return flows
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise APIException('platform:flow',request.url._url,f"Error occurred while get flow by appid:",e)
|
raise APIException('platform:flow',request.url._url,f"Error occurred while get flow by appid:",e)
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ class dbapp(crudbase):
|
|||||||
def get_appversions(self,db: Session, domainurl:str,appid:str):
|
def get_appversions(self,db: Session, domainurl:str,appid:str):
|
||||||
return paginate(db,dbappversion.get_appversions(domainurl,appid))
|
return paginate(db,dbappversion.get_appversions(domainurl,appid))
|
||||||
|
|
||||||
def get_flow(self,db: Session, domainurl: str, appid:str,userid:int):
|
def get_flow(self,db: Session, domainurl: str, appid:str):
|
||||||
return dbflow.get_flows_by_appid(db,domainurl,appid)
|
return dbflow.get_flows_by_appid(db,domainurl,appid)
|
||||||
|
|
||||||
def create_flow(self,db: Session, domainurl: str, flow: schemas.FlowIn,userid:int):
|
def create_flow(self,db: Session, domainurl: str, flow: schemas.FlowIn,userid:int):
|
||||||
|
|||||||
Reference in New Issue
Block a user