from django.urls import path, include, re_path
from rest_framework.routers import DefaultRouter
from .views import (
    ESP32ConfigViewSet, OrderViewSet, order_check_view, 
    ServiceViewSet, ARServiceViewSet, ServiceOrderViewSet, 
    payment_finish, pay
)

router = DefaultRouter()
router.register(r'configs', ESP32ConfigViewSet)
router.register(r'orders', OrderViewSet)
router.register(r'services', ServiceViewSet)
router.register(r'ar', ARServiceViewSet)
router.register(r'service-orders', ServiceOrderViewSet)

urlpatterns = [
    re_path(r'^finish/?$', payment_finish, name='payment-finish'),
    re_path(r'^pay/?$', pay, name='wechat-pay-v3'),
    path('page/check-order/', order_check_view, name='check-order-page'),
    path('', include(router.urls)),
]
