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
a7b59391
Commit
a7b59391
authored
Nov 21, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成明星创建逻辑
parent
208b2164
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
6 deletions
+93
-6
group.py
api/group.py
+28
-3
star.py
api/star.py
+31
-2
urls.py
api/urls.py
+3
-0
group.js
vu/src/api/group.js
+8
-0
star.js
vu/src/api/star.js
+23
-0
PickDetail.vue
vu/src/views/pick/components/PickDetail.vue
+0
-1
StarDetail.vue
vu/src/views/star/components/StarDetail.vue
+0
-0
No files found.
api/group.py
View file @
a7b59391
...
...
@@ -13,7 +13,6 @@ class GroupListView(APIView):
filters
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
try
:
data
=
self
.
rpc
[
'venus/community/group/list'
](
filters
=
filters
,
offset
=
offset
,
count
=
count
)
.
unwrap
()
print
(
data
,
'----------------'
)
except
Exception
as
e
:
raise
e
return
data
...
...
@@ -34,4 +33,30 @@ class GroupListView(APIView):
raise
e
return
{
"message"
:
"更新成功"
}
\ No newline at end of file
}
class
GroupUpdateOrCreate
(
APIView
):
def
get
(
self
,
request
):
id
=
request
.
GET
.
get
(
'id'
)
try
:
data
=
self
.
rpc
[
'venus/community/group/detail'
](
id
=
id
)
.
unwrap
()
except
Exception
as
e
:
data
=
[{
'id'
:
1
,
'name'
:
'我是一个小组名称'
,
'description'
:
'小组简介简介'
,
'user_nums'
:
22
,
'topic_nums'
:
32
,
'user'
:
{
'id'
:
22
,
'name'
:
'真好'
,
}
},]
return
{
'total'
:
20
,
'data'
:
data
}
def
post
(
self
,
request
):
pass
\ No newline at end of file
api/star.py
View file @
a7b59391
...
...
@@ -3,6 +3,7 @@
# __author__ = "chenwei"
# Date: 2018/11/15
import
json
from
utils.base
import
APIView
...
...
@@ -15,4 +16,32 @@ class StarListView(APIView):
data
=
self
.
rpc
[
'venus/community/star/get'
](
offset
=
page
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
data
\ No newline at end of file
return
data
class
StarUpdateOrCreate
(
APIView
):
def
get
(
self
,
request
):
id
=
request
.
GET
.
get
(
'id'
)
try
:
data
=
self
.
rpc
[
'venus/community/star/detail'
](
id
=
id
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
'data'
:
data
}
def
post
(
self
,
request
):
data
=
{
'gender'
:
request
.
POST
.
get
(
'gender'
),
'region'
:
request
.
POST
.
get
(
'region'
),
'is_online'
:
request
.
POST
.
get
(
'is_online'
),
'description'
:
request
.
POST
.
get
(
'description'
),
'avatar'
:
request
.
POST
.
get
(
'avatar'
)[:
-
2
],
'group_ids'
:
list
(
set
(
json
.
loads
(
request
.
POST
.
get
(
'group_ids'
,
[])))),
}
try
:
self
.
rpc
[
'venus/community/star/create'
](
data
=
data
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
'message'
:
'更新成功'
}
\ No newline at end of file
api/urls.py
View file @
a7b59391
...
...
@@ -34,12 +34,15 @@ urlpatterns = [
# group相关
url
(
r'group/list$'
,
GroupListView
.
as_view
()),
url
(
r'group/update$'
,
GroupListView
.
as_view
()),
url
(
r'group/detail'
,
GroupUpdateOrCreate
.
as_view
()),
# topic相关
url
(
r'topic/list$'
,
TopicListView
.
as_view
()),
# star相关
url
(
r'star/list$'
,
StarListView
.
as_view
()),
url
(
r'star/create'
,
StarUpdateOrCreate
.
as_view
()),
url
(
r'star/detail'
,
StarUpdateOrCreate
.
as_view
()),
# push相关
url
(
r'push/list$'
,
PushListView
.
as_view
()),
...
...
vu/src/api/group.js
View file @
a7b59391
...
...
@@ -15,3 +15,11 @@ export function OffLineOrOnLine(data) {
data
})
}
export
function
GroupDetail
(
id
)
{
return
request
({
url
:
'/api/group/detail'
,
method
:
'get'
,
params
:
{
id
}
})
}
vu/src/api/star.js
View file @
a7b59391
...
...
@@ -8,6 +8,21 @@ export function fetchList(query) {
})
}
export
function
starCreate
(
data
)
{
return
request
({
url
:
'/api/star/create'
,
method
:
'post'
,
data
})
}
export
function
starDetail
(
id
)
{
return
request
({
url
:
'/api/star/detail'
,
method
:
'get'
,
params
:
{
id
}
})
}
export
function
OffLineOrOnLine
(
data
)
{
return
request
({
...
...
@@ -16,3 +31,11 @@ export function OffLineOrOnLine(data) {
data
})
}
export
function
fetchStarRelatedGroup
(
id
)
{
return
request
({
url
:
'/api/star/star_related_group_info'
,
method
:
'get'
,
params
:
{
id
}
})
}
vu/src/views/pick/components/PickDetail.vue
View file @
a7b59391
...
...
@@ -241,7 +241,6 @@
this
.
postForm
.
region
=
Assembledata
(
this
.
temparray
[
'region'
],
this
.
postForm
.
region
);
this
.
postForm
.
pick_group
=
Assembledata
(
this
.
temparray
[
'pick_group'
],
this
.
postForm
.
pick_group
);
}
else
{
console
.
log
(
this
.
postForm
.
region
)
this
.
postForm
.
region
=
this
.
postForm
.
region
.
join
(
','
)
this
.
postForm
.
pick_group
=
this
.
postForm
.
pick_group
.
join
(
','
)
}
...
...
vu/src/views/star/components/StarDetail.vue
View file @
a7b59391
This diff is collapsed.
Click to expand it.
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