from rest_framework.routers import SimpleRouter
from .views import (TableAllDevCmdDefineView, TableDevCmdNamePollView, 
                    TableSoftLimitAngleView, TableXproAllDevinfoView,
                    TableAllDevCmdDefineView_1, TableDevCmdNamePollView_1)
from .views import test, remove_protocol, protocol_add_version
from django.urls import re_path

router = SimpleRouter()
router.register(r'all_dev_cmd_define', TableAllDevCmdDefineView)
router.register(r'dev_cmd_name_poll', TableDevCmdNamePollView)
router.register(r'soft_limit_angle', TableSoftLimitAngleView)
router.register(r'xpro_all_devinfo', TableXproAllDevinfoView)

router.register(r'all_dev_cmd_define_1', TableAllDevCmdDefineView_1)
router.register(r'dev_cmd_name_poll_1', TableDevCmdNamePollView_1)

urlpatterns = [
    re_path(r'^test/$', test),
    re_path(r'^protocol/protocol_add_version/$', protocol_add_version),
    re_path(r'^protocol/(?P<protocol_name>.+)/$', remove_protocol),
]


urlpatterns += router.urls
