From eafb074fdabd69a47a4affc2e0ddbb8acd44d12b Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Fri, 22 Nov 2024 14:41:37 +0800 Subject: [PATCH] refactor: API endpoint --- apps/audits/urls/api_urls.py | 2 +- apps/ops/api/variable.py | 2 +- apps/ops/urls/api_urls.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/audits/urls/api_urls.py b/apps/audits/urls/api_urls.py index 0af151070..8b34602db 100644 --- a/apps/audits/urls/api_urls.py +++ b/apps/audits/urls/api_urls.py @@ -14,7 +14,7 @@ router.register(r'login-logs', api.UserLoginLogViewSet, 'login-log') router.register(r'operate-logs', api.OperateLogViewSet, 'operate-log') router.register(r'password-change-logs', api.PasswordChangeLogViewSet, 'password-change-log') router.register(r'job-logs', api.JobLogAuditViewSet, 'job-log') -router.register(r'jobs', api.JobsAuditViewSet, 'jobs') +router.register(r'jobs', api.JobsAuditViewSet, 'job') router.register(r'my-login-logs', api.MyLoginLogViewSet, 'my-login-log') router.register(r'user-sessions', api.UserSessionViewSet, 'user-session') diff --git a/apps/ops/api/variable.py b/apps/ops/api/variable.py index a3ea5ee4e..eaba4ca41 100644 --- a/apps/ops/api/variable.py +++ b/apps/ops/api/variable.py @@ -19,7 +19,7 @@ class VariableViewSet(JMSModelViewSet): http_method_names = ['options', 'get'] @action(methods=[GET], detail=False, serializer_class=VariableFormDataSerializer, - permission_classes=[IsValidUser, ], url_path='form_data') + permission_classes=[IsValidUser, ], url_path='form-data') def form_data(self, request, *args, **kwargs): # 只是为了动态返回serializer fields info return Response({}) diff --git a/apps/ops/urls/api_urls.py b/apps/ops/urls/api_urls.py index 28157972a..12801b1a3 100644 --- a/apps/ops/urls/api_urls.py +++ b/apps/ops/urls/api_urls.py @@ -15,7 +15,7 @@ bulk_router = BulkRouter() bulk_router.register(r'adhocs', api.AdHocViewSet, 'adhoc') bulk_router.register(r'playbooks', api.PlaybookViewSet, 'playbook') bulk_router.register(r'jobs', api.JobViewSet, 'job') -bulk_router.register(r'variable', api.VariableViewSet, 'variable') +bulk_router.register(r'variables', api.VariableViewSet, 'variable') bulk_router.register(r'job-executions', api.JobExecutionViewSet, 'job-execution') router.register(r'celery/period-tasks', api.CeleryPeriodTaskViewSet, 'celery-period-task')