Commit 4e374248 authored by 钟尚武's avatar 钟尚武

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

Xujunpeng/feature/add product

See merge request alpha/sun!330
parents e0438c35 42438bb4
......@@ -204,3 +204,16 @@ class ProductUpdateView(APIView):
category_ids=category_ids, effect_ids=effect_ids, is_online=is_online, brand_id=brand_id).unwrap()
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):
'is_home': int(request.POST.get('is_home', 0)),
'is_recommend': int(request.POST.get('is_recommend', 0)),
'body_esthetics_tag_ids': body_esthetics_tag_ids,
'product_id': request.POST.get('product_id'),
'have_face': int(request.POST.get('have_face', 0)),
'is_finished': int(request.POST.get('is_finished', 1)),
}
try:
......
......@@ -208,6 +208,7 @@ urlpatterns = [
url(r'^product/create$', ProductCreateView.as_view()),
url(r'^product/update$', ProductUpdateView.as_view()),
url(r'^product/info$', ProductInfoView.as_view()),
url(r'^product/search', ProductSearchView.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