File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
REST-Server/openapi_server Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 4
4
from openapi_server .models .concept import Concept # noqa: E501
5
5
from openapi_server import util
6
6
7
+ import configparser
8
+ import redis
7
9
8
- def concept_mapping_concept_get (concept ): # noqa: E501
10
+ config = configparser .ConfigParser ()
11
+ config .read ('config.ini' )
12
+
13
+ r = redis .Redis (host = config ['REDIS' ]['HOST' ],
14
+ port = config ['REDIS' ]['PORT' ],
15
+ db = config ['REDIS' ]['DB' ])
16
+
17
+ def concept_mapping_concept_get (Concept ): # noqa: E501
9
18
"""Get an array of models related to a concept.
10
19
11
20
Submit a concept name and receive an array of model related to that concept. # noqa: E501
@@ -15,7 +24,8 @@ def concept_mapping_concept_get(concept): # noqa: E501
15
24
16
25
:rtype: Concept
17
26
"""
18
- return 'do some magic!'
27
+ models = [m .decode ('utf-8' ) for m in list (r .smembers (Concept ))]
28
+ return models
19
29
20
30
21
31
def list_concepts_get (): # noqa: E501
@@ -26,4 +36,5 @@ def list_concepts_get(): # noqa: E501
26
36
27
37
:rtype: List[str]
28
38
"""
29
- return 'do some magic!'
39
+ concepts = [c .decode ('utf-8' ) for c in list (r .smembers ('concepts' ))]
40
+ return concepts
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ paths:
189
189
content :
190
190
application/json :
191
191
schema :
192
- $ref : ' #/components/schemas/Concept '
192
+ $ref : ' #/components/schemas/ConceptMapping '
193
193
description : SUCCESS
194
194
summary : Get an array of models related to a concept.
195
195
tags :
Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ paths:
173
173
content :
174
174
application/json :
175
175
schema :
176
- $ref : ' #/components/schemas/Concept '
176
+ $ref : ' #/components/schemas/ConceptMapping '
177
177
/run_model :
178
178
post :
179
179
tags :
You can’t perform that action at this time.
0 commit comments