Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
sun
Commits
ba4c850f
Commit
ba4c850f
authored
Nov 17, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成远程搜索功能
parent
51e1a750
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
26 deletions
+5
-26
search.py
api/search.py
+5
-26
No files found.
api/search.py
View file @
ba4c850f
...
...
@@ -9,43 +9,22 @@ from utils.base import APIView
class
GroupSearchView
(
APIView
):
def
get
(
self
,
request
):
name
=
request
.
GET
.
get
(
'name'
)
print
(
name
,
'0------'
)
try
:
pass
data
=
self
.
rpc
[
'venus/community/group/search'
](
name
=
name
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
'total'
:
100
,
'data'
:
[
{
'name'
:
'小组1'
,
'id'
:
1
},
{
'name'
:
'小组2'
,
'id'
:
2
},
{
'name'
:
'小组3'
,
'id'
:
3
},
{
'name'
:
'小组4'
,
'id'
:
4
},
{
'name'
:
'小组5'
,
'id'
:
5
},
{
'name'
:
'小组6'
,
'id'
:
6
},
]
}
return
{
'data'
:
data
}
class
RegionSearchView
(
APIView
):
def
get
(
self
,
request
):
name
=
request
.
GET
.
get
(
'name'
)
print
(
request
.
GET
)
try
:
pass
data
=
self
.
rpc
[
'venus/community/country/search'
](
name
=
name
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
'total'
:
100
,
'data'
:
[
{
'name'
:
'北京'
,
'id'
:
1
},
{
'name'
:
'上海'
,
'id'
:
2
},
{
'name'
:
'深圳'
,
'id'
:
3
},
{
'name'
:
'武汉'
,
'id'
:
4
},
{
'name'
:
'成都'
,
'id'
:
5
},
{
'name'
:
'宁波'
,
'id'
:
6
},
]
}
return
{
'data'
:
data
}
class
UserSearchView
(
APIView
):
...
...
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