Commit 7b362c71 authored by 金凯强's avatar 金凯强 🎨

新增删除配置功能

parent 2333961c
Pipeline #22381 passed with stage
in 23 seconds
......@@ -82,3 +82,37 @@ class ConnectionAPI(ApiController):
:return:
'''
return ConnectionService().get_remote_db_info(project_no, work_shop_no, sync_file=True)
@api('project_info_list')
def get_project_info_list(self):
'''
获取项目配置列表
:return:
'''
return ConnectionService().get_project_info_list()
@api('project_info_list')
def delete_project_info_list(self):
'''
删除项目配置列表
:return:
'''
id_list = request.json.get('id_list', [])
return ConnectionService().delete_project_info_list(id_list)
@api('remote_db_list')
def get_remote_db_list(self):
'''
获取远程服务器DB列表
:return:
'''
return ConnectionService().get_remote_db_list()
@api('remote_db_list')
def delete_remote_db_list(self):
'''
删除远程服务器DB列表
:return:
'''
id_list = request.json.get('id_list', [])
return ConnectionService().delete_remote_db_list(id_list)
......@@ -400,3 +400,47 @@ from remote_server_db_info
where project_no='{project_no}' '''
with db_driver as session:
return session.query_sql(sql)
def get_project_info_list(self):
'''
获取项目信息列表
:return:
'''
sql = '''select * from project_info'''
with db_driver as session:
return session.query_sql(sql)
def delete_project_info_list(self, id_list):
'''
删除项目信息列表
:param id_list:
:return:
'''
id_str = ','.join(id_list)
sql = f'''delete from project_info
where id in ({id_str})'''
with db_driver as session:
session.exec_sql(sql)
def get_remote_db_list(self):
'''
获取远程服务器DB列表
:return:
'''
sql = '''select * from remote_server_db_info'''
with db_driver as session:
return session.query_sql(sql)
def delete_remote_db_list(self, id_list):
'''
删除远程服务器DB列表
:param id_list:
:return:
'''
id_str = ','.join(id_list)
sql = f'''delete from remote_server_db_info
where id in ({id_str})'''
with db_driver as session:
session.exec_sql(sql)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment