Spaces:
Sleeping
Sleeping
File size: 1,207 Bytes
29e1c17 7f4c5ee 29e1c17 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
from fastapi import FastAPI
from .notify import router as NotifyRouter
from .utils import config
from tablestore import OTSClient
from .account_manager import router as accountManagerRouter
access_key_id='LTAI5tNwpEHCMTupADmx6xA4'
access_key_secret="vX1q5Tvj3LSsIMUXN6SPbMUBCET3qG"
end_point='https://v2b-user-table.ap-southeast-1.ots.aliyuncs.com'
instance_name='v2b-user-table'
table_name = 'user'
primary_key = 'email'
ots_client = OTSClient(
end_point=end_point,
access_key_id=access_key_id,
access_key_secret=access_key_secret,
instance_name=instance_name
)
accountManagerRouter.key = primary_key
accountManagerRouter.ots_client = ots_client
accountManagerRouter.table_name = table_name
#和hook.pixiv.digital/uu兼容 故分开
NotifyRouter.key = primary_key
NotifyRouter.ots_client = ots_client
NotifyRouter.table_name = table_name
app = FastAPI()
@app.get("/config.json", tags=["Root"])
async def read_root() -> dict:
return config
# 全局路由
app.include_router(accountManagerRouter,prefix='/accountManager')
app.include_router(NotifyRouter, prefix=config['notify']) # https://hook.pixiv.digital/uu接受回调
if __name__ == '__main__':
print(config['notify'])
|