from django.urls import path, include
from rest_framework.routers import DefaultRouter

from apps.wpm.views import (SfLogViewSet, StLogViewSet, SfLogExpViewSet, 
                            WMaterialViewSet, MlogViewSet, HandoverViewSet, 
                            AttlogViewSet, OtherLogViewSet, MlogbViewSet, MlogbInViewSet, 
                            MlogbOutViewSet, FmlogViewSet, BatchStViewSet,
                            MlogbwViewSet, MlogUserViewSet, BatchLogViewSet)
from apps.wpm.datax import AnaViewSet
from apps.wpm.views_ana import BatchWorkView


API_BASE_URL = 'api/wpm/'
HTML_BASE_URL = 'dhtml/wpm/'

router = DefaultRouter()
router.register('sflog', SfLogViewSet, basename='sflog')
router.register('stlog', StLogViewSet, basename='stlog')
router.register('sflogexp', SfLogExpViewSet, basename='sflogexp')
router.register('wmaterial', WMaterialViewSet, basename='wmaterial')
router.register('fmlog', FmlogViewSet, basename='fmlog')
router.register('mlog', MlogViewSet, basename='mlog')
router.register('mlogb', MlogbViewSet, basename='mlogb')
router.register('mlogb/in', MlogbInViewSet, basename='mlogb_in')
router.register('mlogb/out', MlogbOutViewSet, basename='mlogb_out')
router.register('handover', HandoverViewSet, basename='handover')
router.register('attlog', AttlogViewSet, basename='attlog')
router.register('otherlog', OtherLogViewSet, basename='otherlog')
router.register('ana', AnaViewSet, basename='ana')
router.register('batchst', BatchStViewSet, basename='batchst')
router.register('mlogbw', MlogbwViewSet, basename='mlogbw')
router.register('mloguser', MlogUserViewSet, basename='mloguser')
router.register('batchlog', BatchLogViewSet, basename='batchlog')
urlpatterns = [
    path(API_BASE_URL, include(router.urls)),
    path(API_BASE_URL + 'ana/batchwork/', BatchWorkView.as_view(), name='batchwork'),
]
