Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
I
install.api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Script
install.api
Commits
7b362c71
Commit
7b362c71
authored
Apr 09, 2020
by
金凯强
🎨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增删除配置功能
parent
2333961c
Pipeline
#22381
passed with stage
in 23 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
0 deletions
+78
-0
conncetion_api.py
app/conncetion/conncetion_api.py
+34
-0
conncetion_service.py
app/conncetion/conncetion_service.py
+44
-0
No files found.
app/conncetion/conncetion_api.py
View file @
7b362c71
...
@@ -82,3 +82,37 @@ class ConnectionAPI(ApiController):
...
@@ -82,3 +82,37 @@ class ConnectionAPI(ApiController):
:return:
:return:
'''
'''
return
ConnectionService
()
.
get_remote_db_info
(
project_no
,
work_shop_no
,
sync_file
=
True
)
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
)
app/conncetion/conncetion_service.py
View file @
7b362c71
...
@@ -400,3 +400,47 @@ from remote_server_db_info
...
@@ -400,3 +400,47 @@ from remote_server_db_info
where project_no='{project_no}' '''
where project_no='{project_no}' '''
with
db_driver
as
session
:
with
db_driver
as
session
:
return
session
.
query_sql
(
sql
)
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment