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
4d7c889b
Commit
4d7c889b
authored
Aug 23, 2023
by
周田
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc:注释
parent
57b653a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
views.py
device_communication/views.py
+6
-1
No files found.
device_communication/views.py
View file @
4d7c889b
...
@@ -7,7 +7,9 @@ from protocol_version_manage.models import (AllProtocolVersion, AllProtocolDefin
...
@@ -7,7 +7,9 @@ from protocol_version_manage.models import (AllProtocolVersion, AllProtocolDefin
@api_view
([
'GET'
])
@api_view
([
'GET'
])
def
get_protocol_names
(
request
):
def
get_protocol_names
(
request
):
"""
获取所有协议,并返回
"""
protocol_names
=
AllProtocolVersion
.
objects
.
all
()
protocol_names
=
AllProtocolVersion
.
objects
.
all
()
res_data
=
([{
'value'
:
protocol_name
.
protocol_name
,
'label'
:
protocol_name
.
protocol_name
}
res_data
=
([{
'value'
:
protocol_name
.
protocol_name
,
'label'
:
protocol_name
.
protocol_name
}
for
protocol_name
in
protocol_names
])
for
protocol_name
in
protocol_names
])
...
@@ -17,6 +19,9 @@ def get_protocol_names(request):
...
@@ -17,6 +19,9 @@ def get_protocol_names(request):
@api_view
([
'POST'
])
@api_view
([
'POST'
])
def
get_protocol_field_names
(
request
):
def
get_protocol_field_names
(
request
):
"""
获取指定协议下的指令集
"""
protocol_name
=
request
.
data
.
get
(
'protocol_name'
)
protocol_name
=
request
.
data
.
get
(
'protocol_name'
)
if
protocol_name
is
None
or
protocol_name
==
''
:
if
protocol_name
is
None
or
protocol_name
==
''
:
return
Response
(
status
=
status
.
HTTP_400_BAD_REQUEST
)
return
Response
(
status
=
status
.
HTTP_400_BAD_REQUEST
)
...
...
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