-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandler_stub.py
74 lines (57 loc) · 1.66 KB
/
handler_stub.py
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import json
from gamecontroller import handler as GameController
def user_status_action(event, context):
print(event)
result = GameController.user_status_action(event, context)
response = {
'statusCode': result['statusCode'],
'body': json.dumps(result['body'])
}
print(response)
return response
def play_action(event, context):
result = GameController.play_action(event, context)
# response_temp = {
# "points": 27,
# "params":
# {
# "sicurezza": 0.37,
# "salute": 0.74,
# "sostenibilita": 0,
# "risparmio": 0.51
# }
# }
# attenzione deve ritonrare response, il temp momentaneamente per una response statica
# response = {
# 'statusCode': '200',
# 'body': json.dumps(response_temp)
# }
response = {
'statusCode': result['statusCode'],
'body': json.dumps(result['body'])
}
print(response)
return response
def level_upgrade(event, context):
print(event)
result = GameController.level_upgrade_action(event, context)
response = {
'statusCode': result['statusCode'],
'body': json.dumps(result['body'])
}
print(response)
return response
def get_lazy_users(event, context):
result = GameController.get_lazy_users(event, context)
response = {
'statusCode': 200,
'body': json.dumps(result)
}
print(response)
return response
def reset_players(event, context):
print(event)
GameController.reset_players()
def auth(event, context):
print(event)
return GameController.auth(event, context)