Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-dfs
csst-dfs-api-cluster
Commits
7bb80498
Commit
7bb80498
authored
Jun 27, 2024
by
Wei Shoulin
Browse files
module_id validation
parent
5fc2146b
Pipeline
#5810
passed with stage
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
csst_dfs_api_cluster/facility/level1.py
View file @
7bb80498
...
@@ -3,12 +3,15 @@ import datetime
...
@@ -3,12 +3,15 @@ import datetime
from
..common.service
import
grpc_channel
from
..common.service
import
grpc_channel
from
..common.utils
import
*
from
..common.utils
import
*
from
..common.constants
import
*
from
..common.constants
import
*
from
csst_dfs_commons.models.constants
import
MODULES
class
Level1DataApi
(
object
):
class
Level1DataApi
(
object
):
def
__init__
(
self
):
def
__init__
(
self
):
self
.
stub
=
None
self
.
stub
=
None
@
grpc_channel
@
grpc_channel
def
find
(
self
,
**
kwargs
):
def
find
(
self
,
**
kwargs
):
if
get_parameter
(
kwargs
,
"module_id"
)
not
in
MODULES
:
return
Result
.
error
(
message
=
"module_id is not allowed"
)
return
find_req
(
"Level1Servicer.Find"
,
kwargs
)
return
find_req
(
"Level1Servicer.Find"
,
kwargs
)
@
grpc_channel
@
grpc_channel
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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