Commit 9416fd84 authored by 崔为之's avatar 崔为之 💪🏽

Update project

parent a148dedb
......@@ -11,4 +11,4 @@
"""
from .dsn import DatabaseURI
from .elasticsearch import ElasticsearchUtils
from .elasticsearch import ElasticsearchUtil
......@@ -10,4 +10,4 @@
# @Description :
"""
from .elasticsearch import ElasticsearchUtils
from .elasticsearch import ElasticsearchUtil
......@@ -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:
"""
......
......@@ -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",
......
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