Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue_django_test
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周田
vue_django_test
Commits
d836256a
Commit
d836256a
authored
Aug 24, 2023
by
周田
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:(模拟)设备通信参数的增删查
parent
b2d99fdd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
urls.py
device_communication/urls.py
+8
-2
views.py
device_communication/views.py
+10
-0
No files found.
device_communication/urls.py
View file @
d836256a
...
@@ -4,7 +4,12 @@ from . import views
...
@@ -4,7 +4,12 @@ from . import views
urlpatterns
=
[
urlpatterns
=
[
re_path
(
r'^device_communication/$'
,
views
.
get_protocol_names
),
re_path
(
r'^device_communication/$'
,
views
.
get_protocol_names
),
re_path
(
r'^device_communication/protocol_performance/$'
,
views
.
get_protocol_field_names
),
re_path
(
r'^device_communication/protocol_performance/$'
,
views
.
get_protocol_field_names
),
re_path
(
r'^device_communication/set_communication_to_devinfo_table/$'
,
views
.
set_communication_to_devinfo_table
),
re_path
(
r'^device_communication/set_communication_to_devinfo_table/$'
,
views
.
set_communication_to_devinfo_table
),
re_path
(
r'^device_communication/communicate/$'
,
re_path
(
r'^device_communication/communicate/$'
,
views
.
DeviceCommunicationParameterViewSet
.
as_view
({
'post'
:
'create'
})),
views
.
DeviceCommunicationParameterViewSet
.
as_view
(
{
'get'
:
'list'
,
'post'
:
'create'
,
'delete'
:
'destroy'
})),
re_path
(
r'^device_communication/simulate_communicate/$'
,
views
.
SimulateDeviceCommunicationParameterViewSet
.
as_view
(
{
'get'
:
'list'
,
'post'
:
'create'
,
'delete'
:
'destroy'
})),
]
]
\ No newline at end of file
device_communication/views.py
View file @
d836256a
...
@@ -87,7 +87,17 @@ def set_communication_to_devinfo_table(request):
...
@@ -87,7 +87,17 @@ def set_communication_to_devinfo_table(request):
class
DeviceCommunicationParameterViewSet
(
mixins
.
CreateModelMixin
,
class
DeviceCommunicationParameterViewSet
(
mixins
.
CreateModelMixin
,
mixins
.
DestroyModelMixin
,
mixins
.
ListModelMixin
,
GenericViewSet
):
GenericViewSet
):
queryset
=
DeviceCommunicationParameter
.
objects
.
all
()
queryset
=
DeviceCommunicationParameter
.
objects
.
all
()
serializer_class
=
DeviceCommunicationParameterSerializer
serializer_class
=
DeviceCommunicationParameterSerializer
class
SimulateDeviceCommunicationParameterViewSet
(
mixins
.
CreateModelMixin
,
mixins
.
DestroyModelMixin
,
mixins
.
ListModelMixin
,
GenericViewSet
):
queryset
=
SimulateDeviceCommunicationParameter
.
objects
.
all
()
serializer_class
=
SimulateDeviceCommunicationParameterSerializer
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment