28 lines
583 B
Python
28 lines
583 B
Python
# encoding:utf-8
|
|
|
|
from fastapi import FastAPI
|
|
from pydantic import BaseModel
|
|
import uvicorn
|
|
|
|
from lib.service.baidu import check_baidu
|
|
from lib.service.local import check_local
|
|
from lib.service.wechat import msg_sec_check
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
class Item(BaseModel):
|
|
content: str
|
|
|
|
|
|
@app.post("/check")
|
|
async def check_content(item: Item):
|
|
# res_wechat = await msg_sec_check(item.content)
|
|
# res_baidu = await check_baidu(item.content)
|
|
res_local = check_local(item.content)
|
|
return res_local
|
|
|
|
|
|
if __name__ == "__main__":
|
|
uvicorn.run(app, host="0.0.0.0", port=8009)
|