from django.conf.urls import url
from rest_framework.routers import SimpleRouter
from apps.account.views import *

urlpatterns = [
    url(r'^login/$', LoginView.as_view()),
    url(r'^token_refresh/$', RefreshTokenView.as_view()),
    url(r'^employee/change_password/$', ChangePassword.as_view()),

    url(r'^code2Session/$', WxLoginView.as_view()), # 自动登录
    url(r'^setUserInfo/$', SetUserInfoView.as_view()),
    url(r'^wxbind/$', WxBindView.as_view()), # 微信快捷登录

    url(r'^permission/dict/$', PermissionDictView.as_view()),  # 人员管理，编辑，权限组
    url(r'^permission/all/$', PermissionsListView.as_view()),  # 权限管理，编辑，加载所有权限
]

router = SimpleRouter()
router.register(r'employee', EmployeeViewSet)
router.register(r'permission', GroupsViewSet)
urlpatterns += router.urls
