from email.mime import base
from django.urls import path, include
from rest_framework import routers
from apps.third.views import DahuaTestView, DhCommonViewSet, SpTestView, SpeakerViewSet, XxCommonViewSet, XxTestView, KingCommonViewSet
from apps.third.views_d import BltViewSet, TDeviceViewSet, TlogViewSet

API_BASE_URL = 'api/third/'
HTML_BASE_URL = 'dhtml/third/'

router = routers.DefaultRouter()
router.register('xunxi', XxCommonViewSet, basename='api_xunxi')
router.register('dahua', DhCommonViewSet, basename='api_dahua')
router.register('speaker', SpeakerViewSet, basename='api_speaker')
router.register('tdevice', TDeviceViewSet, basename='tdevice')
router.register('tlog', TlogViewSet, basename='tlog')
router.register('tdevice/blt', BltViewSet, basename='blt')
router.register('king', KingCommonViewSet, basename='king')
# router.register('doorauth', DoorAuthViewSet, basename='doorauth')
urlpatterns = [
    path(API_BASE_URL, include(router.urls)),
    path(API_BASE_URL + 'dahua/test/', DahuaTestView.as_view()),
    path(API_BASE_URL + 'xunxi/test/', XxTestView.as_view()),
    path(API_BASE_URL + 'speaker/test/', SpTestView.as_view())
]
