2018-07-12 16:31:50 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
|
2019-08-21 12:27:21 +00:00
|
|
|
from django.urls import re_path
|
2018-07-25 03:21:12 +00:00
|
|
|
from rest_framework.routers import DefaultRouter
|
2019-08-21 12:27:21 +00:00
|
|
|
|
|
|
|
from common import api as capi
|
2018-07-25 03:21:12 +00:00
|
|
|
from .. import api
|
|
|
|
|
2018-07-12 16:31:50 +00:00
|
|
|
|
|
|
|
app_name = 'orgs'
|
2018-07-25 03:21:12 +00:00
|
|
|
router = DefaultRouter()
|
2018-11-02 06:38:44 +00:00
|
|
|
|
2019-01-15 11:01:33 +00:00
|
|
|
# 将会删除
|
|
|
|
router.register(r'orgs/(?P<org_id>[0-9a-zA-Z\-]{36})/membership/admins',
|
2019-08-21 12:27:21 +00:00
|
|
|
api.OrgMembershipAdminsViewSet, 'membership-admins')
|
2019-01-15 11:01:33 +00:00
|
|
|
router.register(r'orgs/(?P<org_id>[0-9a-zA-Z\-]{36})/membership/users',
|
2019-08-21 12:27:21 +00:00
|
|
|
api.OrgMembershipUsersViewSet, 'membership-users'),
|
2018-11-02 06:38:44 +00:00
|
|
|
|
2018-07-25 03:21:12 +00:00
|
|
|
router.register(r'orgs', api.OrgViewSet, 'org')
|
|
|
|
|
2019-08-21 12:27:21 +00:00
|
|
|
old_version_urlpatterns = [
|
|
|
|
re_path('(?P<resource>org)/.*', capi.redirect_plural_name_api)
|
|
|
|
]
|
2018-07-12 16:31:50 +00:00
|
|
|
|
|
|
|
urlpatterns = [
|
2018-07-25 03:21:12 +00:00
|
|
|
]
|
|
|
|
|
2019-08-21 12:27:21 +00:00
|
|
|
urlpatterns += router.urls + old_version_urlpatterns
|