2021-06-13 11:39:56 +00:00
|
|
|
|
import main
|
2022-01-10 13:07:30 +00:00
|
|
|
|
import push
|
2022-04-26 08:15:47 +00:00
|
|
|
|
import config
|
2021-06-13 11:39:56 +00:00
|
|
|
|
import main_multi
|
2022-01-10 13:07:30 +00:00
|
|
|
|
from error import CookieError
|
2021-06-13 11:39:56 +00:00
|
|
|
|
|
|
|
|
|
|
2021-10-25 14:53:34 +00:00
|
|
|
|
def main_handler(event: dict, context: dict):
|
2022-04-26 08:15:47 +00:00
|
|
|
|
config.serverless = True
|
2022-01-10 13:07:30 +00:00
|
|
|
|
try:
|
2022-02-04 02:57:26 +00:00
|
|
|
|
status_code, push_message = main.main()
|
2022-01-10 13:07:30 +00:00
|
|
|
|
except CookieError:
|
|
|
|
|
status_code = 0
|
2022-02-04 02:57:26 +00:00
|
|
|
|
push.push(status_code, push_message)
|
2021-06-13 11:39:56 +00:00
|
|
|
|
print("云函数测试支持!")
|
|
|
|
|
return 0
|
|
|
|
|
|
2021-10-25 14:53:34 +00:00
|
|
|
|
|
|
|
|
|
def main_handler_mulit(event: dict, context: dict):
|
2022-04-26 08:15:47 +00:00
|
|
|
|
config.serverless = True
|
2021-10-25 14:53:34 +00:00
|
|
|
|
# 多用户需要传递True表示自动执行,不需要手动进行确认
|
2021-06-13 11:39:56 +00:00
|
|
|
|
main_multi.main_multi(True)
|
|
|
|
|
print("云函数多用户测试支持!")
|
|
|
|
|
return 0
|