from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from apartamento.serializers import ApartamentoResponseSerializer
from apartamento.services import ApartamentoService


class ApartamentoView(GenericAPIView):

    def __init__(self):
        super().__init__()
        self.service = ApartamentoService()

    def get(self, request):
        data = self.service.find()
        serialized = ApartamentoResponseSerializer(data, many=True)
        return Response(serialized.data)

d7c8d429a824bdcf68893033903c37e967afb7fd
<mask token>


class ApartamentoView(GenericAPIView):
    <mask token>
    <mask token>

<mask token>


class ApartamentoView(GenericAPIView):

    def __init__(self):
        super().__init__()
        self.service = ApartamentoService()
    <mask token>

<mask token>


class ApartamentoView(GenericAPIView):

    def __init__(self):
        super().__init__()
        self.service = ApartamentoService()

    def get(self, request):
        data = self.service.find()
        serialized = ApartamentoResponseSerializer(data, many=True)
        return Response(serialized.data)

from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from apartamento.serializers import ApartamentoResponseSerializer
from apartamento.services import ApartamentoService


class ApartamentoView(GenericAPIView):

    def __init__(self):
        super().__init__()
        self.service = ApartamentoService()

    def get(self, request):
        data = self.service.find()
        serialized = ApartamentoResponseSerializer(data, many=True)
        return Response(serialized.data)
