-
+
+
#tab {
- background-color: pink;
width: 100%;
height: 100%;
margin-top: 30px;
diff --git a/frontend/src/components/banner.vue b/frontend/src/components/banner.vue
index 21fefdd7..b375ed27 100644
--- a/frontend/src/components/banner.vue
+++ b/frontend/src/components/banner.vue
@@ -1,6 +1,6 @@
-
+
-
-
diff --git a/lyrebird_api_coverage/handlers/base_source_handler.py b/lyrebird_api_coverage/handlers/base_source_handler.py
index d19962db..ce976171 100644
--- a/lyrebird_api_coverage/handlers/base_source_handler.py
+++ b/lyrebird_api_coverage/handlers/base_source_handler.py
@@ -2,6 +2,7 @@
import lyrebird
from lyrebird.mock import context
+from lyrebird.log import get_logger
from lyrebird_api_coverage.client.context import app_context
from lyrebird_api_coverage.client.jsonscheme import check_schema, check_url_redundant
@@ -17,6 +18,8 @@
# 默认base 文件
DEFAULT_BASE = os.path.join(PLUGINS_CONF_DIR, 'base.json')
+logger = get_logger()
+
'''
Base 处理器
'''
@@ -31,9 +34,10 @@ def get_base_source(self):
json_obj = context.make_fail_response('暂无默认文件,需手动导入base文件')
# 检查不为空的base文件是否符合标准,符合标准check_base返回0
else:
- if self.check_base(json_obj):
+ error_response = self.check_base(json_obj)
+ if error_response:
# 遇到异常就返回
- return self.check_base(json_obj)
+ return error_response
return json_obj
'''
@@ -46,6 +50,12 @@ def check_base(self, obj):
# 检查url是否有重复项存在
redundant_items = check_url_redundant(obj)
if redundant_items:
+ redundant_items_str = '\n'.join(redundant_items)
+ logger.error(
+ f'API-Coverage import API file error: Duplicated API\n'
+ f'{len(redundant_items)} duplicated API:\n'
+ f'{redundant_items_str}\n'
+ )
resp = context.make_fail_response('导入API有重复项' + str(redundant_items))
lyrebird.publish('api_coverage', 'error', name='import_base')
return resp
@@ -57,7 +67,6 @@ def check_base(self, obj):
app_context.version_code = obj.get('version_code')
return
except Exception as e:
- resp = context.make_fail_response(
- '导入文件有误:' + '\n' + e.__getattribute__('message') + '\n' + '!请重新import base')
+ resp = context.make_fail_response(f'导入文件有误: {e}\n请重新import base')
return resp
diff --git a/lyrebird_api_coverage/version.py b/lyrebird_api_coverage/version.py
index 162e6fff..a6106e84 100644
--- a/lyrebird_api_coverage/version.py
+++ b/lyrebird_api_coverage/version.py
@@ -1,2 +1,2 @@
-IVERSION = (0, 3, 0)
+IVERSION = (0, 3, 1)
VERSION = ".".join(str(i) for i in IVERSION)
diff --git a/requirements.txt b/requirements.txt
index 52113799..aefbcb6d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1 @@
-lyrebird
-jsonschema
\ No newline at end of file
+-e .[dev]
diff --git a/setup.py b/setup.py
index aa7d1429..2ab22317 100644
--- a/setup.py
+++ b/setup.py
@@ -35,6 +35,12 @@
install_requires=[
'lyrebird',
'jsonschema'
- ]
-
+ ],
+ extras_require={
+ 'dev': [
+ "autopep8",
+ "pylint",
+ "pytest"
+ ]
+ }
)