Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
崔为之
elp
Commits
9416fd84
Commit
9416fd84
authored
Nov 04, 2023
by
崔为之
💪🏽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update project
parent
a148dedb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
application/utils/__init__.py
application/utils/__init__.py
+1
-1
application/utils/elasticsearch/__init__.py
application/utils/elasticsearch/__init__.py
+1
-1
application/utils/elasticsearch/elasticsearch.py
application/utils/elasticsearch/elasticsearch.py
+1
-1
application/views/user/user.py
application/views/user/user.py
+3
-3
No files found.
application/utils/__init__.py
View file @
9416fd84
...
...
@@ -11,4 +11,4 @@
"""
from
.dsn
import
DatabaseURI
from
.elasticsearch
import
ElasticsearchUtil
s
from
.elasticsearch
import
ElasticsearchUtil
application/utils/elasticsearch/__init__.py
View file @
9416fd84
...
...
@@ -10,4 +10,4 @@
# @Description :
"""
from
.elasticsearch
import
ElasticsearchUtil
s
from
.elasticsearch
import
ElasticsearchUtil
application/utils/elasticsearch/elasticsearch.py
View file @
9416fd84
...
...
@@ -15,7 +15,7 @@ import datetime
from
application.extensions.init_elasticsearch
import
es
class
ElasticsearchUtil
s
:
class
ElasticsearchUtil
:
@
classmethod
def
dsl
(
cls
,
_start
:
str
,
_end
:
str
,
size
=
10000
)
->
dict
:
"""
...
...
application/views/user/user.py
View file @
9416fd84
...
...
@@ -16,7 +16,7 @@ from application.services import UserService
from
marshmallow
import
ValidationError
from
application.schemas
import
UserSchema
from
application.utils
import
ElasticsearchUtil
s
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
=
ElasticsearchUtil
s
.
dsl
(
start
,
end
)
dsl
=
ElasticsearchUtil
.
dsl
(
start
,
end
)
index
=
current_app
.
config
.
Elasticsearch
.
Index
res
=
ElasticsearchUtil
s
.
search
(
index
,
dsl
)
res
=
ElasticsearchUtil
.
search
(
index
,
dsl
)
print
(
len
(
res
))
data
=
{
"user_name"
:
"libai"
,
...
...
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