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
1
Merge Requests
1
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
alpha
sun
Commits
9103dfb2
Commit
9103dfb2
authored
Mar 27, 2019
by
杨成林
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'revert-
74510081
' into 'test'
Revert "首页运营位" See merge request
!149
parents
1d11d0da
9389571a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
88 deletions
+6
-88
__init__.py
api/mock/__init__.py
+6
-0
operation.py
api/operation.py
+0
-81
urls.py
api/urls.py
+0
-7
No files found.
api/mock/__init__.py
0 → 100644
View file @
9103dfb2
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = "chenwei"
# Date: 2018/11/15
api/operation.py
deleted
100644 → 0
View file @
1d11d0da
from
utils.base
import
APIView
,
get_offset_count
from
utils.logger
import
error_logger
class
TopicHomeRecommendList
(
APIView
):
def
get
(
self
,
request
):
sort_
=
request
.
GET
.
get
(
'sort'
,
'-topic_id'
)
offset
,
count
=
get_offset_count
(
request
)
try
:
data
=
self
.
rpc
[
'venus/sun/operation/topic_recommend/list'
](
sort_
=
sort_
,
offset
=
offset
,
count
=
count
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'获取首页推荐帖子列表失败
%
s'
,
e
)
raise
return
{
'data'
:
data
}
class
TopicHomeRecommendEdit
(
APIView
):
def
post
(
self
,
request
):
id_
=
request
.
POST
.
get
(
'id'
)
is_online
=
request
.
POST
.
get
(
"is_online"
)
rank
=
request
.
POST
.
get
(
"rank"
)
data
=
{}
if
is_online
is
not
None
:
data
[
"is_online"
]
=
int
(
is_online
)
if
rank
is
not
None
:
data
[
"rank"
]
=
int
(
rank
)
if
not
data
and
not
id_
:
return
{
'message'
:
'参数不全'
}
try
:
self
.
rpc
[
'venus/sun/operation/topic_recommend/edit'
](
id_
=
id_
,
data
=
data
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'更新失败'
,
e
)
raise
return
{
'message'
:
'更新成功'
}
class
TopicHomeFixOperation
(
APIView
):
def
get
(
self
,
request
):
try
:
pos
=
request
.
GET
.
get
(
"pos"
,
4
)
data
=
self
.
rpc
[
'venus/sun/operation/home_fix/info'
](
pos
=
pos
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'运营位获取失败
%
s'
,
e
)
raise
return
{
'data'
:
data
}
def
post
(
self
,
request
):
image
=
request
.
POST
.
get
(
'image'
)
protocol
=
request
.
POST
.
get
(
"protocol"
)
pos
=
request
.
POST
.
get
(
"pos"
,
4
)
if
not
image
or
not
protocol
:
return
{
'message'
:
'参数不全'
}
try
:
self
.
rpc
[
'venus/sun/operation/home_fix/edit'
](
image
=
image
,
protocol
=
protocol
,
pos
=
pos
)
.
unwrap
()
except
Exception
as
e
:
error_logger
.
error
(
u'更新失败'
,
e
)
raise
return
{
'message'
:
'更新成功'
}
api/urls.py
View file @
9103dfb2
...
...
@@ -21,7 +21,6 @@ from .advertise import *
from
.channel_build
import
*
from
.commons
import
*
from
.pictorial
import
*
from
.operation
import
*
urlpatterns
=
[
# 登陆,注销相关
...
...
@@ -131,12 +130,6 @@ urlpatterns = [
url
(
r'^pictorial/create$'
,
PictorialUpdateOrCreate
.
as_view
()),
url
(
r'^pictorial/topics$'
,
PictorialTopics
.
as_view
()),
url
(
r'^pictorial/user/list$'
,
PictorialUserList
.
as_view
()),
#运营位
url
(
r'^topic/home_recommend/list'
,
TopicHomeRecommendList
.
as_view
()),
url
(
r'^topic/home_recommend/edit'
,
TopicHomeRecommendEdit
.
as_view
()),
url
(
r'^operation/home_fix'
,
TopicHomeFixOperation
.
as_view
()),
]
search_urlpatterns
=
[
...
...
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