added two output
This commit is contained in:
parent
c421c885d4
commit
2d8b314e32
31
main.py
31
main.py
@ -11,19 +11,22 @@ app = FastAPI()
|
|||||||
|
|
||||||
def query(query:str):
|
def query(query:str):
|
||||||
res = []
|
res = []
|
||||||
list = search_paper(query)
|
try:
|
||||||
for i in list:
|
list = search_paper(query)
|
||||||
if mysql_connector.is_loaded(i['paperId']):
|
for i in list:
|
||||||
print(i['paperId'])
|
if mysql_connector.is_loaded(i['paperId']):
|
||||||
else:
|
print(i['paperId'])
|
||||||
print(i['citationStyles']['bibtex'])
|
else:
|
||||||
res.append({
|
print(i['citationStyles']['bibtex'])
|
||||||
'id':i['paperId'],
|
res.append({
|
||||||
'q':str(i['citationStyles']['bibtex']),
|
'id':i['paperId'],
|
||||||
'a':str(i['abstract']),
|
'q':str(i['citationStyles']['bibtex']),
|
||||||
'score':[]
|
'a':str(i['abstract']),
|
||||||
})
|
'score':[]
|
||||||
print('New load: '+str(len(res))+'/'+str(len(list)))
|
})
|
||||||
|
print('New load: '+str(len(res))+'/'+str(len(list)))
|
||||||
|
except Exception as e:
|
||||||
|
print(str(e))
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@app.get("/fastdoi")
|
@app.get("/fastdoi")
|
||||||
@ -37,7 +40,7 @@ async def get_reference(questions):
|
|||||||
|
|
||||||
@app.get("/rss")
|
@app.get("/rss")
|
||||||
async def miniflux_rss():
|
async def miniflux_rss():
|
||||||
load_rss()
|
return load_rss()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import uvicorn
|
import uvicorn
|
||||||
|
Loading…
Reference in New Issue
Block a user