Merge branch 'main' of git.opencomputing.cn:yumoqing/uapi
This commit is contained in:
commit
7545aef6cb
@ -4,12 +4,6 @@
|
|||||||
"title":"API输入输出",
|
"title":"API输入输出",
|
||||||
"description":"API的输入输出定义",
|
"description":"API的输入输出定义",
|
||||||
"sortby": "name",
|
"sortby": "name",
|
||||||
"data_filter":{
|
|
||||||
"fields":[
|
|
||||||
{"field":"name","title":"类型名","uitype":"str"},
|
|
||||||
{"field":"description","title":"类型说明","uitype":"str"}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"browserfields":{
|
"browserfields":{
|
||||||
"exclouded":["id"],
|
"exclouded":["id"],
|
||||||
"alters":{}
|
"alters":{}
|
||||||
|
|||||||
@ -143,7 +143,7 @@ where b.orgid = c.ownerid
|
|||||||
i = randint(0, cnt - 1)
|
i = randint(0, cnt - 1)
|
||||||
return users[i].userid
|
return users[i].userid
|
||||||
|
|
||||||
async def get_api(self, appid, apiname):
|
async def get_api_from_db(self, appid, apiname):
|
||||||
key = f'{appid}.{apiname}'
|
key = f'{appid}.{apiname}'
|
||||||
if _cache_enabled():
|
if _cache_enabled():
|
||||||
api = self.apidata.get(key)
|
api = self.apidata.get(key)
|
||||||
@ -163,3 +163,10 @@ where b.orgid = c.ownerid
|
|||||||
exception(f'{e}')
|
exception(f'{e}')
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
async def get_api(self, appid, apiname):
|
||||||
|
key = f'{appid}.{apiname}'
|
||||||
|
api = self.apidata.get(key)
|
||||||
|
if api:
|
||||||
|
return api
|
||||||
|
return await self.get_api_from_db(appid, apiname)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user