rogerxavier commited on
Commit
29e1c17
1 Parent(s): d5b0b2f

Update server/api.py

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