Commit 8b810bfc authored by 许俊鹏's avatar 许俊鹏

Merge branch 'xujunpeng/feature/1_9' into 'test'

1.9需求开发

See merge request alpha/sun!212
parents d40f1124 f0f72d57
......@@ -188,3 +188,23 @@ class OperationList(APIView):
raise
return data
class OperationSearchKeyword(APIView):
def get(self, request):
try:
data = self.rpc['venus/sun/operation/search_keyword/get']().unwrap()
except Exception as e:
error_logger.error(u'获取搜索热门词失败%s', e)
raise
return data
def post(self, request):
update = json.loads(request.POST.get('update'))
try:
data = self.rpc['venus/sun/operation/search_keyword/edit'](data=update).unwrap()
except Exception as e:
error_logger.error(u'获取搜索热门词失败%s', e)
raise
return data
......@@ -199,3 +199,49 @@ class TagFilterDelete(APIView):
return {'message': '操作失败'}
return {'message': '操作成功'}
class TagSearchRecommendKeyword(APIView):
def get(self, request):
try:
data = self.rpc['venus/sun/tag/recommend_keyword/get']().unwrap()
except Exception as e:
error_logger.error(u'获取搜索热门词失败%s', e)
raise
return data
def post(self, request):
# 如果有id 走update 。 否则走创建
id = request.POST.get('id', None)
update = request.POST.get('update')
if not update:
return {'message': '参数不完整'}
try:
data = self.rpc['venus/sun/tag/recommend_keyword/edit'](data=update, id=id).unwrap()
except Exception as e:
error_logger.error(u'获取搜索热门词失败%s', e)
raise
return data
class SearchDefaultKeyword(APIView):
def get(self, request):
try:
data = self.rpc['venus/sun/tag/search_default_keyword/get']().unwrap()
except Exception as e:
error_logger.error(u'获取搜索默认关键字失败%s', e)
raise
return data
def post(self, request):
id = request.POST.get('id', None)
update = request.POST.get('update')
if not update:
return {'message': '参数不完整'}
try:
data = self.rpc['venus/sun/tag/search_default_keyword/edit'](data=update, id=id).unwrap()
except Exception as e:
error_logger.error(u'更新搜索默认关键字失败%s', e)
raise
return data
......@@ -94,6 +94,8 @@ urlpatterns = [
url(r'^tag/filter/list$', TagFilterList.as_view()),
url(r'^tag/filter/add$', TagFilterCreate.as_view()),
url(r'^tag/filter/delete$', TagFilterDelete.as_view()),
url(r'^tag/search_recommend_keyword$', TagSearchRecommendKeyword.as_view()),
url(r'^tag/search_default_keyword$', SearchDefaultKeyword.as_view()),
# 标签类型相关
url(r'^tag/tagtype/list$', TagTypeListView.as_view()),
......@@ -149,6 +151,7 @@ urlpatterns = [
url(r'^operation/edit', OperationEdit.as_view()),
url(r'^operation/list', OperationList.as_view()),
url(r'^operation/delete', OperationDelete.as_view()),
url(r'^operation/search_keyword$', OperationSearchKeyword.as_view()),
# 工具
url(r'^tools/virtual_vote$', VirtualVote.as_view()),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment