Commit 1ead0077 authored by 王浩's avatar 王浩

Merge branch 'test' into 'master'

Alpha 1.9

See merge request alpha/sun!214
parents 0f8e4475 8c60946d
...@@ -188,3 +188,23 @@ class OperationList(APIView): ...@@ -188,3 +188,23 @@ class OperationList(APIView):
raise raise
return data 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
...@@ -137,9 +137,10 @@ class TagRegisterUpdateView(APIView): ...@@ -137,9 +137,10 @@ class TagRegisterUpdateView(APIView):
return data return data
def post(self, request): def post(self, request):
ids = request.POST.get('tag_ids') male_ids = request.POST.get('male_ids')
female_ids = request.POST.get('female_ids')
try: try:
self.rpc['venus/sun/tag/register_tag/update'](ids=ids).unwrap() self.rpc['venus/sun/tag/register_tag/update'](female_ids=female_ids, male_ids=male_ids).unwrap()
except Exception as e: except Exception as e:
error_logger.error(u'配置失败') error_logger.error(u'配置失败')
raise raise
...@@ -198,3 +199,44 @@ class TagFilterDelete(APIView): ...@@ -198,3 +199,44 @@ class TagFilterDelete(APIView):
return {'message': '操作失败'} return {'message': '操作失败'}
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', '')
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', '')
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 = [ ...@@ -94,6 +94,8 @@ urlpatterns = [
url(r'^tag/filter/list$', TagFilterList.as_view()), url(r'^tag/filter/list$', TagFilterList.as_view()),
url(r'^tag/filter/add$', TagFilterCreate.as_view()), url(r'^tag/filter/add$', TagFilterCreate.as_view()),
url(r'^tag/filter/delete$', TagFilterDelete.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()), url(r'^tag/tagtype/list$', TagTypeListView.as_view()),
...@@ -149,6 +151,7 @@ urlpatterns = [ ...@@ -149,6 +151,7 @@ urlpatterns = [
url(r'^operation/edit', OperationEdit.as_view()), url(r'^operation/edit', OperationEdit.as_view()),
url(r'^operation/list', OperationList.as_view()), url(r'^operation/list', OperationList.as_view()),
url(r'^operation/delete', OperationDelete.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()), 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