dingxin_toolbox
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.7 KiB

from dspt_api.util.general.handle_redis import get_data_from_redis
from dspt_api.util.general.handle_params import add_param
import time
class MapiPlayInfo:
def __init__(self, **kwargs):
self.member_type = kwargs.get('member_type')
self.api = kwargs.get('api')
self.ip = kwargs.get('ip')
self.env = kwargs.get('env')
self.cid = kwargs.get('cid')
self.pid = kwargs.get('pid')
self.sale_type = kwargs.get('sale_type')
self.pay_type = kwargs.get('pay_type')
self.user_data = {
'ip': self.ip,
'env': self.env,
'member_type': self.member_type,
'pid': self.pid,
'cid': self.cid,
'sale_type': self.sale_type,
'pay_type': self.pay_type,
}
self.return_data = []
def get_suggestion(self):
print('get_suggestion', self.user_data, self.sale_type, self.pay_type)
# 获取play_id
redis_key_prefix = f'dspt_api_{self.ip}_{self.env}_{self.member_type}_{self.pid}_{self.cid}'
request_api_play = {'name': '3.2.3 获取放映计划列表', 'path': 'cinema/plays'}
redis_key_api_play = f'{redis_key_prefix}_{request_api_play["path"]}'
result_play, _format_play, seat_price_from_play, _timestamp_play = get_data_from_redis(redis_key_api_play)
play_id = '请手动输入参数,检查相关接口返回值:3.2.3 获取放映计划列表'
if result_play:
play_id = seat_price_from_play['id']
add_param(self.return_data, 'play_id', play_id, timestamp=_timestamp_play)
print(__name__, self.return_data)
return self.return_data
@staticmethod
def get_timestamp():
return int(time.time() * 1000)