fix: endpoints
Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>
This commit is contained in:
parent
fab0a7ada3
commit
563a23a1d9
3 changed files with 2 additions and 19 deletions
|
|
@ -7,7 +7,6 @@
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
from app.views import (
|
from app.views import (
|
||||||
BhavCopyEquityView,
|
BhavCopyEquityView,
|
||||||
BhavCopyEquityDefaultRedisView,
|
|
||||||
BhavCopyEquityCustomRedisView,
|
BhavCopyEquityCustomRedisView,
|
||||||
EmptyRespoinseView
|
EmptyRespoinseView
|
||||||
)
|
)
|
||||||
|
|
@ -15,11 +14,6 @@ from app.views import (
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('emptyresponse/', EmptyRespoinseView.as_view(), name='emptyresponse_view'),
|
path('emptyresponse/', EmptyRespoinseView.as_view(), name='emptyresponse_view'),
|
||||||
path('bhavcopyequity/', BhavCopyEquityView.as_view(), name='bhavcopyequity_view'),
|
path('bhavcopyequity/', BhavCopyEquityView.as_view(), name='bhavcopyequity_view'),
|
||||||
path(
|
|
||||||
'bhavcopyequitydefaultredis/',
|
|
||||||
BhavCopyEquityDefaultRedisView.as_view(),
|
|
||||||
name='bhavcopyequitydefaultredis_view'
|
|
||||||
),
|
|
||||||
path(
|
path(
|
||||||
'bhavcopyequitycustomredis/',
|
'bhavcopyequitycustomredis/',
|
||||||
BhavCopyEquityCustomRedisView.as_view(),
|
BhavCopyEquityCustomRedisView.as_view(),
|
||||||
|
|
|
||||||
|
|
@ -30,16 +30,6 @@ class BhavCopyEquityView(generics.RetrieveAPIView):
|
||||||
return Response(serializer.data)
|
return Response(serializer.data)
|
||||||
|
|
||||||
|
|
||||||
class BhavCopyEquityDefaultRedisView(generics.RetrieveAPIView):
|
|
||||||
queryset = BhavCopyEquity.objects.all()
|
|
||||||
|
|
||||||
@method_decorator(cache_page(60*60*2))
|
|
||||||
def get(self, request, *args, **kwargs):
|
|
||||||
queryset = self.get_queryset()
|
|
||||||
serializer = BhavCopyEquitySerializer(queryset, many=True)
|
|
||||||
return Response(serializer.data)
|
|
||||||
|
|
||||||
|
|
||||||
class EmptyRespoinseView(generics.RetrieveAPIView):
|
class EmptyRespoinseView(generics.RetrieveAPIView):
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
return Response([])
|
return Response([])
|
||||||
|
|
|
||||||
|
|
@ -132,9 +132,8 @@
|
||||||
apiEndpointSelected: { endpoint: 'bhavcopyequitycustomredis', text: "Custom Redis Cache" },
|
apiEndpointSelected: { endpoint: 'bhavcopyequitycustomredis', text: "Custom Redis Cache" },
|
||||||
apiEndpoints: [
|
apiEndpoints: [
|
||||||
{ endpoint: 'emptyresponse', text: "Empty Response Endpoint" },
|
{ endpoint: 'emptyresponse', text: "Empty Response Endpoint" },
|
||||||
{ endpoint: 'bhavcopyequity', text: "Plain Endpoint" },
|
{ endpoint: 'bhavcopyequity', text: "Postgres Endpoint" },
|
||||||
{ endpoint: 'bhavcopyequitydefaultredis', text: "Default Redis Cache" },
|
{ endpoint: 'bhavcopyequitycustomredis', text: "Redis Cache" },
|
||||||
{ endpoint: 'bhavcopyequitycustomredis', text: "Custom Redis Cache" },
|
|
||||||
],
|
],
|
||||||
headersData: [
|
headersData: [
|
||||||
{text: 'Stock Code', value: 'sc_code'},
|
{text: 'Stock Code', value: 'sc_code'},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue