diff --git a/api/effect.py b/api/effect.py new file mode 100644 index 0000000000000000000000000000000000000000..168b9609774cd2ca0c05a1f144a57bbb38549b2c --- /dev/null +++ b/api/effect.py @@ -0,0 +1,14 @@ +import json +from utils.base import APIView, get_offset_count +from utils.logger import error_logger + + +class EffectListView(APIView): + + def get(self, request): + offset, count = get_offset_count(request) + cn_name = request.GET.get('cn_name') + + data = self.rpc['neptune/commodity/effect/list']( + offset=offset, count=count, cn_name=cn_name).unwrap() + return data diff --git a/api/urls.py b/api/urls.py index 5c10839afc5c55f55cecea416a707e9fb1e7204f..0341d2841f77d7c7fb5ef81585b6e70f43ce5d63 100644 --- a/api/urls.py +++ b/api/urls.py @@ -30,6 +30,7 @@ from .brand import * from .product import * from .category import * from .classify import * +from .effect import * urlpatterns = [ @@ -209,6 +210,9 @@ urlpatterns = [ # 商å“分类 url(r'^classify/list$', ClassifyListView.as_view()), + + # 商å“功效 + url(r'^effect/list$', EffectListView.as_view()), ]