2022-04-13 13:23:47 +02:00
|
|
|
class Dp:
|
2022-04-20 11:25:16 +02:00
|
|
|
def __init__(self, act, param):
|
|
|
|
self.act = act
|
|
|
|
self.param = param
|
|
|
|
self.answers = {
|
2022-06-01 16:25:19 +02:00
|
|
|
'request': {
|
|
|
|
'imie': "welcomemsg",
|
|
|
|
'from': "from",
|
|
|
|
'to': "to",
|
|
|
|
'time': "date",
|
|
|
|
'passangerCount': "travelers_count",
|
|
|
|
'discountCount': "travelers_discount_count",
|
|
|
|
'seatType': "seat_type",
|
|
|
|
'wagonType': "carrige_class",
|
|
|
|
}
|
2022-04-20 11:25:16 +02:00
|
|
|
}
|
2022-06-07 23:11:29 +02:00
|
|
|
|
2022-04-20 11:25:16 +02:00
|
|
|
def identify(self):
|
|
|
|
req = self.answers.get(self.act)
|
2022-06-07 23:11:29 +02:00
|
|
|
response = req.get(self.param[0]) if req is not None else "null"
|
|
|
|
return response if response is not None else "null"
|