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
ab384acb
Commit
ab384acb
authored
5 years ago
by
杨成林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ycl/push_blacklist' into 'master'
add black_list See merge request
alpha/sun!348
parents
bdef5df7
631dff16
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
push.py
api/push.py
+47
-0
urls.py
api/urls.py
+3
-0
No files found.
api/push.py
View file @
ab384acb
...
@@ -75,3 +75,50 @@ class EffectPushTaskView(APIView):
...
@@ -75,3 +75,50 @@ class EffectPushTaskView(APIView):
return
{
return
{
'message'
:
'操作成功'
'message'
:
'操作成功'
}
}
class
PushBlackListView
(
APIView
):
def
get
(
self
,
request
):
page
=
int
(
request
.
GET
.
get
(
'page'
,
1
))
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
))
try
:
data
=
self
.
rpc
[
'venus/sun/push/black_list'
](
offset
=
(
page
-
1
)
*
limit
,
limit
=
limit
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'获取push黑名单列表失败
%
s'
,
e
)
raise
return
data
class
AddBlackListView
(
APIView
):
def
post
(
self
,
request
):
user_id
=
request
.
POST
.
get
(
'user_id'
)
.
split
(
':'
)[
0
]
try
:
self
.
rpc
[
'venus/sun/push/add_black_list'
](
user_id
=
user_id
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'添加失败
%
s'
,
e
)
raise
return
{
"message"
:
'添加成功'
}
class
RmBlackListView
(
APIView
):
def
post
(
self
,
request
):
user_id
=
request
.
POST
.
get
(
'user_id'
)
.
split
(
':'
)[
0
]
try
:
self
.
rpc
[
'venus/sun/push/rm_black_list'
](
user_id
=
user_id
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'删除失败
%
s'
,
e
)
raise
return
{
"message"
:
'添加成功'
}
This diff is collapsed.
Click to expand it.
api/urls.py
View file @
ab384acb
...
@@ -78,6 +78,9 @@ urlpatterns = [
...
@@ -78,6 +78,9 @@ urlpatterns = [
url
(
r'^push/create'
,
PushUpdateOrCreateView
.
as_view
()),
url
(
r'^push/create'
,
PushUpdateOrCreateView
.
as_view
()),
url
(
r'^push/detail'
,
PushUpdateOrCreateView
.
as_view
()),
url
(
r'^push/detail'
,
PushUpdateOrCreateView
.
as_view
()),
url
(
r'^push/effect_push'
,
EffectPushTaskView
.
as_view
()),
url
(
r'^push/effect_push'
,
EffectPushTaskView
.
as_view
()),
url
(
r'^push/black_list'
,
PushBlackListView
.
as_view
()),
url
(
r'^push/add_black_list'
,
AddBlackListView
.
as_view
()),
url
(
r'^push/rm_black_list'
,
RmBlackListView
.
as_view
()),
# pick相关
# pick相关
url
(
r'^pick/list$'
,
PickListView
.
as_view
()),
url
(
r'^pick/list$'
,
PickListView
.
as_view
()),
...
...
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