import json
from utils.base import APIView, get_offset_count
from utils.logger import error_logger


class ClassifyListView(APIView):

    def get(self, request):
        offset, count = get_offset_count(request)
        cn_name = request.GET.get('cn_name')

        data = self.rpc['neptune/commodity/classify/list'](
            offset=offset, count=count, cn_name=cn_name).unwrap()
        return data
