Commit 83042640 authored by 金凯强's avatar 金凯强 🎨

下载接口 获取json格式修改

parent 480fe1b2
Pipeline #22238 failed with stage
in 11 seconds
...@@ -26,7 +26,8 @@ class ApplicationAPI(ApiController): ...@@ -26,7 +26,8 @@ class ApplicationAPI(ApiController):
:param project_no: :param project_no:
:return: :return:
''' '''
return ApplicationService().edit_application_list(project_no, request.json) json_data_list = request.json.get('data')
return ApplicationService().edit_application_list(project_no, json_data_list)
@api('test_port/<string:project_no>') @api('test_port/<string:project_no>')
def get_port_list(self, project_no): def get_port_list(self, project_no):
......
...@@ -80,7 +80,7 @@ where B.default_version=1''' ...@@ -80,7 +80,7 @@ where B.default_version=1'''
if not os.path.exists(git_path): if not os.path.exists(git_path):
raise HSException('未能找到Git仓库,联系技术人员协调解决') raise HSException('未能找到Git仓库,联系技术人员协调解决')
def edit_application_list(self, project_no, json_data): def edit_application_list(self, project_no, json_data_list):
''' '''
修改应用列表并上传git 修改应用列表并上传git
:param project_no: :param project_no:
...@@ -93,11 +93,11 @@ where B.default_version=1''' ...@@ -93,11 +93,11 @@ where B.default_version=1'''
compose_content = self.get_compose_content() compose_content = self.get_compose_content()
# 全选是* # 全选是*
if json_data == '*': if json_data_list == '*':
app_list_str = '*' app_list_str = '*'
else: else:
app_list = [] app_list = []
for app_str in json_data: for app_str in json_data_list:
app = re.findall(f'# {app_str} *\n *(.*):', compose_content) app = re.findall(f'# {app_str} *\n *(.*):', compose_content)
if not app or len(app) > 1: if not app or len(app) > 1:
raise HSException('获取app出错,联系技术人员协调解决') raise HSException('获取app出错,联系技术人员协调解决')
......
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