Commit 0a56dbb6 authored by 许俊鹏's avatar 许俊鹏

Merge branch 'xujunpeng/feature/add_product' into 'test'

后台帖子表增加人脸字段

See merge request alpha/sun!325
parents b44f8e33 106f2ef0
...@@ -204,3 +204,16 @@ class ProductUpdateView(APIView): ...@@ -204,3 +204,16 @@ class ProductUpdateView(APIView):
category_ids=category_ids, effect_ids=effect_ids, is_online=is_online, brand_id=brand_id).unwrap() category_ids=category_ids, effect_ids=effect_ids, is_online=is_online, brand_id=brand_id).unwrap()
return data return data
class ProductSearchView(APIView):
def post(self, request):
name = request.POST.get('name')
if not name:
return r'缺少参数'
data = self.rpc['neptune/commodity/product/search'](name=name).unwrap()
return data
...@@ -146,6 +146,8 @@ class TopicUpdateOrCreateView(APIView): ...@@ -146,6 +146,8 @@ class TopicUpdateOrCreateView(APIView):
'is_home': int(request.POST.get('is_home', 0)), 'is_home': int(request.POST.get('is_home', 0)),
'is_recommend': int(request.POST.get('is_recommend', 0)), 'is_recommend': int(request.POST.get('is_recommend', 0)),
'body_esthetics_tag_ids': body_esthetics_tag_ids, 'body_esthetics_tag_ids': body_esthetics_tag_ids,
'product_id': request.POST.get('product_id'),
'have_face': request.POST.get('have_face'),
} }
try: try:
self.rpc['venus/sun/topic/edit'](id=id, data=data).unwrap() self.rpc['venus/sun/topic/edit'](id=id, data=data).unwrap()
......
...@@ -208,6 +208,7 @@ urlpatterns = [ ...@@ -208,6 +208,7 @@ urlpatterns = [
url(r'^product/create$', ProductCreateView.as_view()), url(r'^product/create$', ProductCreateView.as_view()),
url(r'^product/update$', ProductUpdateView.as_view()), url(r'^product/update$', ProductUpdateView.as_view()),
url(r'^product/info$', ProductInfoView.as_view()), url(r'^product/info$', ProductInfoView.as_view()),
url(r'^product/search', ProductSearchView.as_view()),
# 商品类目 # 商品类目
url(r'^category/list$', CategoryListView.as_view()), url(r'^category/list$', CategoryListView.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