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
