From 9416fd846d4eb6619e6a0cce462b8891d542046c Mon Sep 17 00:00:00 2001 From: cuiweizhi <560397@gree.com.cn> Date: Sat, 4 Nov 2023 12:20:51 +0800 Subject: [PATCH] Update project --- application/utils/__init__.py | 2 +- application/utils/elasticsearch/__init__.py | 2 +- application/utils/elasticsearch/elasticsearch.py | 2 +- application/views/user/user.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/application/utils/__init__.py b/application/utils/__init__.py index b33a1fc..734a651 100644 --- a/application/utils/__init__.py +++ b/application/utils/__init__.py @@ -11,4 +11,4 @@ """ from .dsn import DatabaseURI -from .elasticsearch import ElasticsearchUtils +from .elasticsearch import ElasticsearchUtil diff --git a/application/utils/elasticsearch/__init__.py b/application/utils/elasticsearch/__init__.py index afb6616..82dd20b 100644 --- a/application/utils/elasticsearch/__init__.py +++ b/application/utils/elasticsearch/__init__.py @@ -10,4 +10,4 @@ # @Description : """ -from .elasticsearch import ElasticsearchUtils +from .elasticsearch import ElasticsearchUtil diff --git a/application/utils/elasticsearch/elasticsearch.py b/application/utils/elasticsearch/elasticsearch.py index bf6fc41..fa0fecf 100644 --- a/application/utils/elasticsearch/elasticsearch.py +++ b/application/utils/elasticsearch/elasticsearch.py @@ -15,7 +15,7 @@ import datetime from application.extensions.init_elasticsearch import es -class ElasticsearchUtils: +class ElasticsearchUtil: @classmethod def dsl(cls, _start: str, _end: str, size=10000) -> dict: """ diff --git a/application/views/user/user.py b/application/views/user/user.py index 4de1dc1..469fcd6 100644 --- a/application/views/user/user.py +++ b/application/views/user/user.py @@ -16,7 +16,7 @@ from application.services import UserService from marshmallow import ValidationError from application.schemas import UserSchema -from application.utils import ElasticsearchUtils +from application.utils import ElasticsearchUtil from application.common import ConfigHelper user_api = Blueprint('user_api', __name__) @@ -58,9 +58,9 @@ def test_user(): data = request.get_json() start = data.get('start') end = data.get('end') - dsl = ElasticsearchUtils.dsl(start, end) + dsl = ElasticsearchUtil.dsl(start, end) index = current_app.config.Elasticsearch.Index - res = ElasticsearchUtils.search(index, dsl) + res = ElasticsearchUtil.search(index, dsl) print(len(res)) data = { "user_name": "libai", -- GitLab